You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.1 KiB

  1. begin;
  2. INSERT INTO addresses (
  3. address_line_1,
  4. address_line_2,
  5. city,
  6. region,
  7. country,
  8. zip_code,
  9. phone
  10. ) VALUES
  11. (
  12. 'test_line_1',
  13. 'test_line_2',
  14. 'test_city',
  15. 'test_region',
  16. 'JP',
  17. '103-0023',
  18. '090-0000-1111'
  19. )
  20. ,(
  21. 'Mars',
  22. 'Moon',
  23. 'Chuo-ku',
  24. 'Tokyo',
  25. 'JP',
  26. '000-0001',
  27. '090-0000-1112'
  28. )
  29. ,(
  30. 'Saturn',
  31. 'Sun',
  32. 'Shinjuku-ku',
  33. 'Tokyo',
  34. 'JP',
  35. '000-0002',
  36. '090-0000-1113'
  37. )
  38. ,(
  39. 'S',
  40. 'S',
  41. 'Shinjuku-ku',
  42. 'Tokyo',
  43. 'JP',
  44. '000-0003',
  45. '090-0000-1114'
  46. )
  47. ,(
  48. 'A',
  49. 'A',
  50. 'Shinjuku-ku',
  51. 'Tokyo',
  52. 'JP',
  53. '000-0004',
  54. '090-0000-1115'
  55. )
  56. ,(
  57. 'B',
  58. 'B',
  59. 'Shinjuku-ku',
  60. 'Tokyo',
  61. 'JP',
  62. '000-0005',
  63. '090-0000-1116'
  64. )
  65. ,(
  66. 'D',
  67. 'D',
  68. 'Shinjuku-ku',
  69. 'Tokyo',
  70. 'JP',
  71. '000-0005',
  72. '090-0000-1116'
  73. )
  74. ;
  75. INSERT INTO organizations (
  76. name,
  77. address_id,
  78. type
  79. ) VALUES
  80. (
  81. 'Zoozle',
  82. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 0),
  83. 'CUSTOMER'
  84. )
  85. ,(
  86. 'Bmazon',
  87. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 1),
  88. 'ENTERPRISE'
  89. )
  90. ,(
  91. 'Ncrosoft',
  92. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 2),
  93. 'ENTERPRISE_CUSTOMER'
  94. )
  95. ,(
  96. 'Moomle',
  97. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 3),
  98. 'ENTERPRISE_CUSTOMER'
  99. )
  100. ,(
  101. 'Cmazon',
  102. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 4),
  103. 'ENTERPRISE_CUSTOMER'
  104. )
  105. ,(
  106. 'Zcrosoft',
  107. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 5),
  108. 'ENTERPRISE'
  109. )
  110. ,(
  111. 'Ecrosoft',
  112. (SELECT id FROM addresses ORDER BY id ASC LIMIT 1 OFFSET 6),
  113. 'ENTERPRISE_CUSTOMER'
  114. )
  115. ;
  116. INSERT INTO enterprise_sales_enterprise_customers (
  117. sales_organization_id,
  118. customer_organization_id
  119. ) VALUES
  120. (
  121. (SELECT id FROM organizations WHERE name = 'Bmazon' ORDER BY id DESC LIMIT 1),
  122. (SELECT id FROM organizations WHERE name = 'Ncrosoft' ORDER BY id DESC LIMIT 1)
  123. )
  124. ,(
  125. (SELECT id FROM organizations WHERE name = 'Bmazon' ORDER BY id DESC LIMIT 1),
  126. (SELECT id FROM organizations WHERE name = 'Moomle' ORDER BY id DESC LIMIT 1)
  127. )
  128. ,(
  129. (SELECT id FROM organizations WHERE name = 'Bmazon' ORDER BY id DESC LIMIT 1),
  130. (SELECT id FROM organizations WHERE name = 'Cmazon' ORDER BY id DESC LIMIT 1)
  131. )
  132. ,(
  133. (SELECT id FROM organizations WHERE name = 'Bmazon' ORDER BY id DESC LIMIT 1),
  134. (SELECT id FROM organizations WHERE name = 'Zcrosoft' ORDER BY id DESC LIMIT 1)
  135. )
  136. ,(
  137. (SELECT id FROM organizations WHERE name = 'Zcrosoft' ORDER BY id DESC LIMIT 1),
  138. (SELECT id FROM organizations WHERE name = 'Ncrosoft' ORDER BY id DESC LIMIT 1)
  139. )
  140. ;
  141. commit;