ridgepole 0.7.0.alpha → 0.7.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.travis.yml +1 -0
  4. data/README.md +7 -5
  5. data/bin/ridgepole +14 -14
  6. data/lib/ridgepole/cli/config.rb +1 -1
  7. data/lib/ridgepole/client.rb +0 -4
  8. data/lib/ridgepole/delta.rb +15 -9
  9. data/lib/ridgepole/diff.rb +13 -9
  10. data/lib/ridgepole/dsl_parser/context.rb +2 -6
  11. data/lib/ridgepole/version.rb +1 -1
  12. data/ridgepole.gemspec +3 -1
  13. data/spec/erb_helper.rb +0 -39
  14. data/spec/hide_pending_formatter.rb +6 -0
  15. data/spec/mysql/bigint_pk/bigint_pk_spec.rb +9 -9
  16. data/spec/mysql/bigint_pk/int_pk_spec.rb +9 -9
  17. data/spec/mysql/cli/ridgepole_spec.rb +2 -2
  18. data/spec/mysql/collation/collation_spec.rb +28 -28
  19. data/spec/mysql/comment/comment_spec.rb +36 -36
  20. data/spec/mysql/default_lambda/default_lambda_spec.rb +1 -1
  21. data/spec/mysql/diff/diff2_spec.rb +41 -41
  22. data/spec/mysql/diff/diff_spec.rb +41 -41
  23. data/spec/mysql/dump/dump_class_method_spec.rb +26 -33
  24. data/spec/mysql/dump/dump_some_tables_spec.rb +16 -18
  25. data/spec/mysql/dump/dump_spec.rb +27 -34
  26. data/spec/mysql/dump/dump_without_table_options_spec.rb +5 -5
  27. data/spec/mysql/fk/migrate_change_fk_spec.rb +76 -23
  28. data/spec/mysql/fk/migrate_create_fk_spec.rb +70 -50
  29. data/spec/mysql/fk/migrate_drop_fk_spec.rb +131 -32
  30. data/spec/mysql/migrate/check_orphan_index_spec.rb +19 -19
  31. data/spec/mysql/migrate/migrate_add_column2_spec.rb +33 -45
  32. data/spec/mysql/migrate/migrate_add_column_order_spec.rb +47 -47
  33. data/spec/mysql/migrate/migrate_add_column_spec.rb +75 -89
  34. data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +72 -86
  35. data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +72 -86
  36. data/spec/mysql/migrate/migrate_change_column2_spec.rb +27 -32
  37. data/spec/mysql/migrate/migrate_change_column3_spec.rb +78 -78
  38. data/spec/mysql/migrate/migrate_change_column4_spec.rb +24 -24
  39. data/spec/mysql/migrate/migrate_change_column5_spec.rb +42 -42
  40. data/spec/mysql/migrate/migrate_change_column6_spec.rb +60 -60
  41. data/spec/mysql/migrate/migrate_change_column_default_spec.rb +47 -47
  42. data/spec/mysql/migrate/migrate_change_column_float_spec.rb +16 -16
  43. data/spec/mysql/migrate/migrate_change_column_spec.rb +65 -79
  44. data/spec/mysql/migrate/migrate_change_index2_spec.rb +22 -27
  45. data/spec/mysql/migrate/migrate_change_index3_spec.rb +52 -62
  46. data/spec/mysql/migrate/migrate_change_index4_spec.rb +32 -38
  47. data/spec/mysql/migrate/migrate_change_index5_spec.rb +24 -28
  48. data/spec/mysql/migrate/migrate_change_index6_spec.rb +105 -119
  49. data/spec/mysql/migrate/migrate_change_index7_spec.rb +27 -30
  50. data/spec/mysql/migrate/migrate_change_index_spec.rb +99 -120
  51. data/spec/mysql/migrate/migrate_change_table_option_spec.rb +14 -14
  52. data/spec/mysql/migrate/migrate_create_index2_spec.rb +101 -112
  53. data/spec/mysql/migrate/migrate_create_index_spec.rb +55 -66
  54. data/spec/mysql/migrate/migrate_create_table_spec.rb +68 -91
  55. data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +1 -1
  56. data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +58 -70
  57. data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +62 -76
  58. data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +58 -72
  59. data/spec/mysql/migrate/migrate_drop_column_spec.rb +63 -77
  60. data/spec/mysql/migrate/migrate_drop_index_spec.rb +55 -66
  61. data/spec/mysql/migrate/migrate_drop_table_spec.rb +51 -63
  62. data/spec/mysql/migrate/migrate_duplicate_index_spec.rb +3 -3
  63. data/spec/mysql/migrate/migrate_duplicate_table_spec.rb +12 -12
  64. data/spec/mysql/migrate/migrate_empty_spec.rb +35 -42
  65. data/spec/mysql/migrate/migrate_execute_spec.rb +16 -24
  66. data/spec/mysql/migrate/migrate_log_file_spec.rb +58 -70
  67. data/spec/mysql/migrate/migrate_merge_mode_spec.rb +75 -99
  68. data/spec/mysql/migrate/migrate_noop_spec.rb +38 -38
  69. data/spec/mysql/migrate/migrate_rename_column_spec.rb +74 -88
  70. data/spec/mysql/migrate/migrate_rename_table_spec.rb +100 -97
  71. data/spec/mysql/migrate/migrate_same_default_null_spec.rb +18 -18
  72. data/spec/mysql/migrate/migrate_same_spec.rb +29 -37
  73. data/spec/mysql/migrate/migrate_script_error_spec.rb +19 -19
  74. data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +148 -0
  75. data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +70 -84
  76. data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +70 -84
  77. data/spec/mysql/migrate/migrate_with_ignore_tables_spec.rb +87 -87
  78. data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +61 -75
  79. data/spec/mysql/migrate/migrate_with_tables_spec.rb +41 -41
  80. data/spec/mysql/migrate/migrate_with_verbose_log_spec.rb +10 -10
  81. data/spec/mysql/migrate_/migrate_create_index_with_alter_spec.rb +67 -78
  82. data/spec/mysql/migrate_/migrate_drop_index_with_alter_spec.rb +67 -78
  83. data/spec/mysql/text_blob_types/text_blob_types_spec.rb +9 -9
  84. data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +21 -24
  85. data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +35 -67
  86. data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +28 -34
  87. data/spec/postgresql/diff/diff_spec.rb +37 -37
  88. data/spec/postgresql/dump/dump_spec.rb +27 -34
  89. data/spec/postgresql/fk/migrate_change_fk_spec.rb +76 -23
  90. data/spec/postgresql/fk/migrate_create_fk_spec.rb +73 -54
  91. data/spec/postgresql/fk/migrate_drop_fk_spec.rb +131 -32
  92. data/spec/postgresql/migrate/migrate_add_column_spec.rb +63 -75
  93. data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +1 -1
  94. data/spec/postgresql/migrate/migrate_change_column_default_spec.rb +7 -7
  95. data/spec/postgresql/migrate/migrate_change_column_spec.rb +53 -65
  96. data/spec/postgresql/migrate/migrate_change_index_spec.rb +54 -68
  97. data/spec/postgresql/migrate/migrate_create_table_spec.rb +56 -77
  98. data/spec/postgresql/migrate/migrate_drop_column_spec.rb +46 -60
  99. data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +41 -55
  100. data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +3 -3
  101. data/spec/postgresql/migrate/migrate_drop_index_spec.rb +51 -62
  102. data/spec/postgresql/migrate/migrate_drop_table_spec.rb +48 -60
  103. data/spec/postgresql/migrate/migrate_ext_cols_spec.rb +6 -6
  104. data/spec/postgresql/migrate/migrate_rename_column_spec.rb +54 -68
  105. data/spec/postgresql/migrate/migrate_rename_table_spec.rb +62 -78
  106. data/spec/postgresql/migrate/migrate_same_spec.rb +27 -34
  107. data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +21 -24
  108. data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +35 -66
  109. data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +28 -34
  110. data/spec/spec_helper.rb +1 -1
  111. metadata +9 -8
  112. data/ridgepole.iml +0 -9
  113. data/spec/string_ext.rb +0 -40
@@ -3,28 +3,26 @@ describe 'Ridgepole::Client#diff -> migrate' do
3
3
  let(:actual_dsl) {
4
4
  erbh(<<-EOS)
5
5
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
6
- t.date "birth_date", null: false
6
+ t.date "birth_date", null: false
7
7
  t.string "first_name", limit: 14, null: false
8
- t.string "last_name", limit: 16, null: false
9
- t.string "gender", limit: 1, null: false
10
- t.date "hire_date", null: false
8
+ t.string "last_name", limit: 16, null: false
9
+ t.string "gender", limit: 1, null: false
10
+ t.date "hire_date", null: false
11
+ t.index ["gender"], name: "gender", <%= i cond(5.0, using: :btree) %>
11
12
  end
12
-
13
- <%= add_index "employees", ["gender"], name: "gender", using: :btree %>
14
13
  EOS
15
14
  }
16
15
 
17
16
  let(:expected_dsl) {
18
17
  erbh(<<-EOS)
19
18
  create_table :employees, primary_key: :emp_no, force: :cascade do |t|
20
- t.date "birth_date", null: false
19
+ t.date "birth_date", null: false
21
20
  t.string "first_name", limit: 14, null: false
22
- t.string "last_name", limit: 16, null: false
23
- t.string "gender", limit: 1, null: false
24
- t.date :hire_date, null: false
21
+ t.string "last_name", limit: 16, null: false
22
+ t.string "gender", limit: 1, null: false
23
+ t.date :hire_date, null: false
24
+ t.index :gender, name: :gender, <%= i cond(5.0, using: :btree) %>
25
25
  end
26
-
27
- <%= add_index :employees, :gender, name: :gender, using: :btree %>
28
26
  EOS
29
27
  }
30
28
 
@@ -40,43 +38,40 @@ describe 'Ridgepole::Client#diff -> migrate' do
40
38
  context 'when change column (change)' do
41
39
  let(:actual_dsl) {
42
40
  erbh(<<-EOS)
43
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
44
- t.date "birth_date", null: false
41
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
42
+ t.date "birth_date", null: false
45
43
  t.string "first_name", limit: 14, null: false
46
- t.string "last_name", limit: 16, null: false
47
- t.string "gender", limit: 1, null: false
48
- t.date "hire_date", null: false
44
+ t.string "last_name", limit: 16, null: false
45
+ t.string "gender", limit: 1, null: false
46
+ t.date "hire_date", null: false
47
+ t.index ["gender"], name: "gender", <%= i cond(5.0, using: :btree) %>
49
48
  end
50
-
51
- <%= add_index "employees", ["gender"], name: "gender", using: :btree %>
52
49
  EOS
53
50
  }
54
51
 
55
52
  let(:dsl) {
56
53
  erbh(<<-EOS)
57
54
  create_table :employees, primary_key: :emp_no, force: :cascade do |t|
58
- t.date "birth_date", null: false
55
+ t.date "birth_date", null: false
59
56
  t.string "first_name", limit: 14, null: false
60
- t.string "last_name", limit: 16, null: false
61
- t.string "gender", limit: 1, null: false
62
- t.date :hire_date2, null: false
57
+ t.string "last_name", limit: 16, null: false
58
+ t.string "gender", limit: 1, null: false
59
+ t.date :hire_date2, null: false
60
+ t.index :last_name, name: :last_name, <%= i cond(5.0, using: :btree) %>
63
61
  end
64
-
65
- <%= add_index :employees, :last_name, name: :last_name, using: :btree %>
66
62
  EOS
67
63
  }
68
64
 
69
65
  let(:expected_dsl) {
70
66
  erbh(<<-EOS)
71
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
72
- t.date "birth_date", null: false
67
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
68
+ t.date "birth_date", null: false
73
69
  t.string "first_name", limit: 14, null: false
74
- t.string "last_name", limit: 16, null: false
75
- t.string "gender", limit: 1, null: false
76
- t.date "hire_date2", null: false
70
+ t.string "last_name", limit: 16, null: false
71
+ t.string "gender", limit: 1, null: false
72
+ t.date "hire_date2", null: false
73
+ t.index ["last_name"], name: "last_name", <%= i cond(5.0, using: :btree) %>
77
74
  end
78
-
79
- <%= add_index "employees", ["last_name"], name: "last_name", using: :btree %>
80
75
  EOS
81
76
  }
82
77
 
@@ -3,13 +3,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
3
3
  let(:actual_dsl) {
4
4
  <<-EOS
5
5
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
6
- t.date "birth_date", null: false
6
+ t.date "birth_date", null: false
7
7
  t.string "first_name", limit: 14, null: false
8
- t.string "last_name", limit: 16, null: false
9
- t.string "gender", limit: 1, null: false
10
- t.date "hire_date", null: false
11
- t.datetime "created_at", null: false
12
- t.datetime "updated_at", null: false
8
+ t.string "last_name", limit: 16, null: false
9
+ t.string "gender", limit: 1, null: false
10
+ t.date "hire_date", null: false
11
+ t.datetime "created_at", null: false
12
+ t.datetime "updated_at", null: false
13
13
  end
14
14
  EOS
15
15
  }
@@ -17,11 +17,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
17
17
  let(:expected_dsl) {
18
18
  <<-EOS
19
19
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
20
- t.date "birth_date", null: false
20
+ t.date "birth_date", null: false
21
21
  t.string "first_name", limit: 14, null: false
22
- t.string "last_name", limit: 16, null: false
23
- t.string "gender", limit: 1, null: false
24
- t.date "hire_date", null: false
22
+ t.string "last_name", limit: 16, null: false
23
+ t.string "gender", limit: 1, null: false
24
+ t.date "hire_date", null: false
25
25
  t.timestamps
26
26
  end
27
27
  EOS
@@ -39,12 +39,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
39
39
  context 'when use timestamps (change)' do
40
40
  let(:actual_dsl) {
41
41
  erbh(<<-EOS)
42
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
43
- t.date "birth_date", null: false
42
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
43
+ t.date "birth_date", null: false
44
44
  t.string "first_name", limit: 14, null: false
45
- t.string "last_name", limit: 16, null: false
46
- t.string "gender", limit: 1, null: false
47
- t.date "hire_date", null: false
45
+ t.string "last_name", limit: 16, null: false
46
+ t.string "gender", limit: 1, null: false
47
+ t.date "hire_date", null: false
48
48
  end
49
49
  EOS
50
50
  }
@@ -52,11 +52,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
52
52
  let(:dsl) {
53
53
  <<-EOS
54
54
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
55
- t.date "birth_date", null: false
55
+ t.date "birth_date", null: false
56
56
  t.string "first_name", limit: 14, null: false
57
- t.string "last_name", limit: 16, null: false
58
- t.string "gender", limit: 1, null: false
59
- t.date "hire_date", null: false
57
+ t.string "last_name", limit: 16, null: false
58
+ t.string "gender", limit: 1, null: false
59
+ t.date "hire_date", null: false
60
60
  t.timestamps
61
61
  end
62
62
  EOS
@@ -64,14 +64,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
64
64
 
65
65
  let(:expected_dsl) {
66
66
  erbh(<<-EOS)
67
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
68
- t.date "birth_date", null: false
67
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
68
+ t.date "birth_date", null: false
69
69
  t.string "first_name", limit: 14, null: false
70
- t.string "last_name", limit: 16, null: false
71
- t.string "gender", limit: 1, null: false
72
- t.date "hire_date", null: false
73
- t.datetime "created_at", null: false
74
- t.datetime "updated_at", null: false
70
+ t.string "last_name", limit: 16, null: false
71
+ t.string "gender", limit: 1, null: false
72
+ t.date "hire_date", null: false
73
+ t.datetime "created_at", null: false
74
+ t.datetime "updated_at", null: false
75
75
  end
76
76
  EOS
77
77
  }
@@ -92,11 +92,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
92
92
  let(:actual_dsl) {
93
93
  <<-EOS
94
94
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
95
- t.date "birth_date", null: false
95
+ t.date "birth_date", null: false
96
96
  t.string "first_name", limit: 14, null: false
97
- t.string "last_name", limit: 16, null: false
98
- t.string "gender", limit: 1, null: false
99
- t.date "hire_date", null: false
97
+ t.string "last_name", limit: 16, null: false
98
+ t.string "gender", limit: 1, null: false
99
+ t.date "hire_date", null: false
100
100
  t.integer "products_id"
101
101
  t.integer "user_id"
102
102
  end
@@ -106,11 +106,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
106
106
  let(:expected_dsl) {
107
107
  <<-EOS
108
108
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
109
- t.date "birth_date", null: false
109
+ t.date "birth_date", null: false
110
110
  t.string "first_name", limit: 14, null: false
111
- t.string "last_name", limit: 16, null: false
112
- t.string "gender", limit: 1, null: false
113
- t.date "hire_date", null: false
111
+ t.string "last_name", limit: 16, null: false
112
+ t.string "gender", limit: 1, null: false
113
+ t.date "hire_date", null: false
114
114
  t.references :products, :user
115
115
  end
116
116
  EOS
@@ -129,11 +129,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
129
129
  let(:actual_dsl) {
130
130
  <<-EOS
131
131
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
132
- t.date "birth_date", null: false
132
+ t.date "birth_date", null: false
133
133
  t.string "first_name", limit: 14, null: false
134
- t.string "last_name", limit: 16, null: false
135
- t.string "gender", limit: 1, null: false
136
- t.date "hire_date", null: false
134
+ t.string "last_name", limit: 16, null: false
135
+ t.string "gender", limit: 1, null: false
136
+ t.date "hire_date", null: false
137
137
  t.integer "products_id"
138
138
  t.string "products_type"
139
139
  t.integer "user_id"
@@ -145,11 +145,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
145
145
  let(:expected_dsl) {
146
146
  <<-EOS
147
147
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
148
- t.date "birth_date", null: false
148
+ t.date "birth_date", null: false
149
149
  t.string "first_name", limit: 14, null: false
150
- t.string "last_name", limit: 16, null: false
151
- t.string "gender", limit: 1, null: false
152
- t.date "hire_date", null: false
150
+ t.string "last_name", limit: 16, null: false
151
+ t.string "gender", limit: 1, null: false
152
+ t.date "hire_date", null: false
153
153
  t.references :products, :user, polymorphic: true
154
154
  end
155
155
  EOS
@@ -167,12 +167,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
167
167
  context 'when use references (change)' do
168
168
  let(:actual_dsl) {
169
169
  erbh(<<-EOS)
170
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
171
- t.date "birth_date", null: false
170
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
171
+ t.date "birth_date", null: false
172
172
  t.string "first_name", limit: 14, null: false
173
- t.string "last_name", limit: 16, null: false
174
- t.string "gender", limit: 1, null: false
175
- t.date "hire_date", null: false
173
+ t.string "last_name", limit: 16, null: false
174
+ t.string "gender", limit: 1, null: false
175
+ t.date "hire_date", null: false
176
176
  end
177
177
  EOS
178
178
  }
@@ -180,11 +180,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
180
180
  let(:dsl) {
181
181
  <<-EOS
182
182
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
183
- t.date "birth_date", null: false
183
+ t.date "birth_date", null: false
184
184
  t.string "first_name", limit: 14, null: false
185
- t.string "last_name", limit: 16, null: false
186
- t.string "gender", limit: 1, null: false
187
- t.date "hire_date", null: false
185
+ t.string "last_name", limit: 16, null: false
186
+ t.string "gender", limit: 1, null: false
187
+ t.date "hire_date", null: false
188
188
  t.references :products, :user
189
189
  end
190
190
  EOS
@@ -192,14 +192,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
192
192
 
193
193
  let(:expected_dsl) {
194
194
  erbh(<<-EOS)
195
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
196
- t.date "birth_date", null: false
197
- t.string "first_name", limit: 14, null: false
198
- t.string "last_name", limit: 16, null: false
199
- t.string "gender", limit: 1, null: false
200
- t.date "hire_date", null: false
201
- t.integer "products_id", <%= i limit(4) %>
202
- t.integer "user_id", <%= i limit(4) %>
195
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
196
+ t.date "birth_date", null: false
197
+ t.string "first_name", limit: 14, null: false
198
+ t.string "last_name", limit: 16, null: false
199
+ t.string "gender", limit: 1, null: false
200
+ t.date "hire_date", null: false
201
+ t.integer "products_id"
202
+ t.integer "user_id"
203
203
  end
204
204
  EOS
205
205
  }
@@ -219,12 +219,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
219
219
  context 'when use references with polymorphic (change)' do
220
220
  let(:actual_dsl) {
221
221
  erbh(<<-EOS)
222
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
223
- t.date "birth_date", null: false
222
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
223
+ t.date "birth_date", null: false
224
224
  t.string "first_name", limit: 14, null: false
225
- t.string "last_name", limit: 16, null: false
226
- t.string "gender", limit: 1, null: false
227
- t.date "hire_date", null: false
225
+ t.string "last_name", limit: 16, null: false
226
+ t.string "gender", limit: 1, null: false
227
+ t.date "hire_date", null: false
228
228
  end
229
229
  EOS
230
230
  }
@@ -232,11 +232,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
232
232
  let(:dsl) {
233
233
  <<-EOS
234
234
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
235
- t.date "birth_date", null: false
235
+ t.date "birth_date", null: false
236
236
  t.string "first_name", limit: 14, null: false
237
- t.string "last_name", limit: 16, null: false
238
- t.string "gender", limit: 1, null: false
239
- t.date "hire_date", null: false
237
+ t.string "last_name", limit: 16, null: false
238
+ t.string "gender", limit: 1, null: false
239
+ t.date "hire_date", null: false
240
240
  t.references :products, :user, polymorphic: true
241
241
  end
242
242
  EOS
@@ -244,16 +244,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
244
244
 
245
245
  let(:expected_dsl) {
246
246
  erbh(<<-EOS)
247
- create_table "employees", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
248
- t.date "birth_date", null: false
249
- t.string "first_name", limit: 14, null: false
250
- t.string "last_name", limit: 16, null: false
251
- t.string "gender", limit: 1, null: false
252
- t.date "hire_date", null: false
253
- t.integer "products_id", <%= i limit(4) %>
254
- t.string "products_type", <%= i limit(255) %>
255
- t.integer "user_id", <%= i limit(4) %>
256
- t.string "user_type", <%= i limit(255) %>
247
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
248
+ t.date "birth_date", null: false
249
+ t.string "first_name", limit: 14, null: false
250
+ t.string "last_name", limit: 16, null: false
251
+ t.string "gender", limit: 1, null: false
252
+ t.date "hire_date", null: false
253
+ t.integer "products_id"
254
+ t.string "products_type"
255
+ t.integer "user_id"
256
+ t.string "user_type"
257
257
  end
258
258
  EOS
259
259
  }
@@ -3,13 +3,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
3
3
  let(:actual_dsl) {
4
4
  <<-EOS
5
5
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
6
- t.date "birth_date", null: false
6
+ t.date "birth_date", null: false
7
7
  t.string "first_name", limit: 14, null: false
8
- t.string "last_name", limit: 16, null: false
9
- t.string "gender", limit: 1, null: false
10
- t.date "hire_date", null: false
11
- t.datetime "created_at", null: false
12
- t.datetime "updated_at", null: false
8
+ t.string "last_name", limit: 16, null: false
9
+ t.string "gender", limit: 1, null: false
10
+ t.date "hire_date", null: false
11
+ t.datetime "created_at", null: false
12
+ t.datetime "updated_at", null: false
13
13
  t.boolean "registered"
14
14
  end
15
15
  EOS
@@ -18,13 +18,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
18
18
  let(:expected_dsl) {
19
19
  <<-EOS
20
20
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
21
- t.date "birth_date", null: false
21
+ t.date "birth_date", null: false
22
22
  t.string "first_name", limit: 14, null: false
23
- t.string "last_name", limit: 16, null: false
24
- t.string "gender", limit: 1, null: false
25
- t.date "hire_date", null: false
26
- t.datetime "created_at", null: false
27
- t.datetime "updated_at", null: false
23
+ t.string "last_name", limit: 16, null: false
24
+ t.string "gender", limit: 1, null: false
25
+ t.date "hire_date", null: false
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
28
  t.boolean "registered"
29
29
  end
30
30
  EOS
@@ -43,13 +43,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
43
43
  let(:actual_dsl) {
44
44
  <<-EOS
45
45
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
46
- t.date "birth_date", null: false
46
+ t.date "birth_date", null: false
47
47
  t.string "first_name", limit: 14, null: false
48
- t.string "last_name", limit: 16, null: false
49
- t.string "gender", limit: 1, null: false
50
- t.date "hire_date", null: false
51
- t.datetime "created_at", null: false
52
- t.datetime "updated_at", null: false
48
+ t.string "last_name", limit: 16, null: false
49
+ t.string "gender", limit: 1, null: false
50
+ t.date "hire_date", null: false
51
+ t.datetime "created_at", null: false
52
+ t.datetime "updated_at", null: false
53
53
  t.boolean "registered"
54
54
  end
55
55
  EOS
@@ -58,13 +58,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
58
58
  let(:expected_dsl) {
59
59
  <<-EOS
60
60
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
61
- t.date "birth_date", null: false
61
+ t.date "birth_date", null: false
62
62
  t.string "first_name", limit: 14, null: false
63
- t.string "last_name", limit: 16, null: false
64
- t.string "gender", limit: 1, null: false
65
- t.date "hire_date", null: false
66
- t.datetime "created_at", null: false
67
- t.datetime "updated_at", null: false
63
+ t.string "last_name", limit: 16, null: false
64
+ t.string "gender", limit: 1, null: false
65
+ t.date "hire_date", null: false
66
+ t.datetime "created_at", null: false
67
+ t.datetime "updated_at", null: false
68
68
  t.boolean "registered", limit: 1
69
69
  end
70
70
  EOS
@@ -3,13 +3,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
3
3
  let(:actual_dsl) {
4
4
  erbh(<<-EOS)
5
5
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
6
- t.date "birth_date", null: false
7
- t.string "first_name", limit: 14, null: false
8
- t.string "last_name", limit: 16, null: false
9
- t.string "gender", limit: 1, null: false
10
- t.date "hire_date", null: false
11
- t.datetime "created_at", null: false
12
- t.datetime "updated_at", null: false
6
+ t.date "birth_date", null: false
7
+ t.string "first_name", limit: 14, null: false
8
+ t.string "last_name", limit: 16, null: false
9
+ t.string "gender", limit: 1, null: false
10
+ t.date "hire_date", null: false
11
+ t.datetime "created_at", null: false
12
+ t.datetime "updated_at", null: false
13
13
  t.binary "registered_name", <%= i cond(5.0, limit: 65535) %>
14
14
  end
15
15
  EOS
@@ -18,13 +18,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
18
18
  let(:expected_dsl) {
19
19
  erbh(<<-EOS)
20
20
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
21
- t.date "birth_date", null: false
22
- t.string "first_name", limit: 14, null: false
23
- t.string "last_name", limit: 16, null: false
24
- t.string "gender", limit: 1, null: false
25
- t.date "hire_date", null: false
26
- t.datetime "created_at", null: false
27
- t.datetime "updated_at", null: false
21
+ t.date "birth_date", null: false
22
+ t.string "first_name", limit: 14, null: false
23
+ t.string "last_name", limit: 16, null: false
24
+ t.string "gender", limit: 1, null: false
25
+ t.date "hire_date", null: false
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
28
  t.binary "registered_name", limit: 255
29
29
  end
30
30
  EOS
@@ -46,13 +46,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
46
46
  let(:actual_dsl) {
47
47
  erbh(<<-EOS)
48
48
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
49
- t.date "birth_date", null: false
50
- t.string "first_name", limit: 14, null: false
51
- t.string "last_name", limit: 16, null: false
52
- t.string "gender", limit: 1, null: false
53
- t.date "hire_date", null: false
54
- t.datetime "created_at", null: false
55
- t.datetime "updated_at", null: false
49
+ t.date "birth_date", null: false
50
+ t.string "first_name", limit: 14, null: false
51
+ t.string "last_name", limit: 16, null: false
52
+ t.string "gender", limit: 1, null: false
53
+ t.date "hire_date", null: false
54
+ t.datetime "created_at", null: false
55
+ t.datetime "updated_at", null: false
56
56
  t.binary "registered_name", limit: 255
57
57
  end
58
58
  EOS
@@ -61,13 +61,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
61
61
  let(:expected_dsl) {
62
62
  erbh(<<-EOS)
63
63
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
64
- t.date "birth_date", null: false
65
- t.string "first_name", limit: 14, null: false
66
- t.string "last_name", limit: 16, null: false
67
- t.string "gender", limit: 1, null: false
68
- t.date "hire_date", null: false
69
- t.datetime "created_at", null: false
70
- t.datetime "updated_at", null: false
64
+ t.date "birth_date", null: false
65
+ t.string "first_name", limit: 14, null: false
66
+ t.string "last_name", limit: 16, null: false
67
+ t.string "gender", limit: 1, null: false
68
+ t.date "hire_date", null: false
69
+ t.datetime "created_at", null: false
70
+ t.datetime "updated_at", null: false
71
71
  t.binary "registered_name", <%= i cond(5.0, limit: 65535) %>
72
72
  end
73
73
  EOS
@@ -89,13 +89,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
89
89
  let(:actual_dsl) {
90
90
  erbh(<<-EOS)
91
91
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
92
- t.date "birth_date", null: false
93
- t.string "first_name", limit: 14, null: false
94
- t.string "last_name", limit: 16, null: false
95
- t.string "gender", limit: 1, null: false
96
- t.date "hire_date", null: false
97
- t.datetime "created_at", null: false
98
- t.datetime "updated_at", null: false
92
+ t.date "birth_date", null: false
93
+ t.string "first_name", limit: 14, null: false
94
+ t.string "last_name", limit: 16, null: false
95
+ t.string "gender", limit: 1, null: false
96
+ t.date "hire_date", null: false
97
+ t.datetime "created_at", null: false
98
+ t.datetime "updated_at", null: false
99
99
  t.binary "registered_name", <%= i cond(5.0, limit: 65535) %>
100
100
  end
101
101
  EOS
@@ -104,13 +104,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
104
104
  let(:expected_dsl) {
105
105
  <<-EOS
106
106
  create_table "employees", primary_key: "emp_no", force: :cascade do |t|
107
- t.date "birth_date", null: false
108
- t.string "first_name", limit: 14, null: false
109
- t.string "last_name", limit: 16, null: false
110
- t.string "gender", limit: 1, null: false
111
- t.date "hire_date", null: false
112
- t.datetime "created_at", null: false
113
- t.datetime "updated_at", null: false
107
+ t.date "birth_date", null: false
108
+ t.string "first_name", limit: 14, null: false
109
+ t.string "last_name", limit: 16, null: false
110
+ t.string "gender", limit: 1, null: false
111
+ t.date "hire_date", null: false
112
+ t.datetime "created_at", null: false
113
+ t.datetime "updated_at", null: false
114
114
  t.binary "registered_name"
115
115
  end
116
116
  EOS