declare_schema 0.8.0.pre.6 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/declare_schema_build.yml +1 -1
  3. data/CHANGELOG.md +28 -1
  4. data/Gemfile.lock +1 -1
  5. data/README.md +91 -13
  6. data/lib/declare_schema.rb +46 -0
  7. data/lib/declare_schema/dsl.rb +39 -0
  8. data/lib/declare_schema/extensions/active_record/fields_declaration.rb +23 -4
  9. data/lib/declare_schema/model.rb +51 -59
  10. data/lib/declare_schema/model/field_spec.rb +11 -8
  11. data/lib/declare_schema/model/foreign_key_definition.rb +4 -8
  12. data/lib/declare_schema/model/habtm_model_shim.rb +1 -1
  13. data/lib/declare_schema/model/index_definition.rb +0 -19
  14. data/lib/declare_schema/schema_change/all.rb +22 -0
  15. data/lib/declare_schema/schema_change/base.rb +45 -0
  16. data/lib/declare_schema/schema_change/column_add.rb +27 -0
  17. data/lib/declare_schema/schema_change/column_change.rb +32 -0
  18. data/lib/declare_schema/schema_change/column_remove.rb +20 -0
  19. data/lib/declare_schema/schema_change/column_rename.rb +23 -0
  20. data/lib/declare_schema/schema_change/foreign_key_add.rb +25 -0
  21. data/lib/declare_schema/schema_change/foreign_key_remove.rb +20 -0
  22. data/lib/declare_schema/schema_change/index_add.rb +33 -0
  23. data/lib/declare_schema/schema_change/index_remove.rb +20 -0
  24. data/lib/declare_schema/schema_change/primary_key_change.rb +33 -0
  25. data/lib/declare_schema/schema_change/table_add.rb +37 -0
  26. data/lib/declare_schema/schema_change/table_change.rb +36 -0
  27. data/lib/declare_schema/schema_change/table_remove.rb +22 -0
  28. data/lib/declare_schema/schema_change/table_rename.rb +22 -0
  29. data/lib/declare_schema/version.rb +1 -1
  30. data/lib/generators/declare_schema/migration/migrator.rb +189 -202
  31. data/lib/generators/declare_schema/support/model.rb +4 -4
  32. data/spec/lib/declare_schema/api_spec.rb +7 -7
  33. data/spec/lib/declare_schema/field_declaration_dsl_spec.rb +41 -15
  34. data/spec/lib/declare_schema/field_spec_spec.rb +50 -6
  35. data/spec/lib/declare_schema/generator_spec.rb +3 -3
  36. data/spec/lib/declare_schema/interactive_primary_key_spec.rb +116 -26
  37. data/spec/lib/declare_schema/migration_generator_spec.rb +1891 -845
  38. data/spec/lib/declare_schema/model/column_spec.rb +47 -17
  39. data/spec/lib/declare_schema/model/foreign_key_definition_spec.rb +134 -57
  40. data/spec/lib/declare_schema/model/habtm_model_shim_spec.rb +3 -3
  41. data/spec/lib/declare_schema/model/index_definition_spec.rb +188 -77
  42. data/spec/lib/declare_schema/model/table_options_definition_spec.rb +75 -11
  43. data/spec/lib/declare_schema/schema_change/base_spec.rb +75 -0
  44. data/spec/lib/declare_schema/schema_change/column_add_spec.rb +30 -0
  45. data/spec/lib/declare_schema/schema_change/column_change_spec.rb +33 -0
  46. data/spec/lib/declare_schema/schema_change/column_remove_spec.rb +30 -0
  47. data/spec/lib/declare_schema/schema_change/column_rename_spec.rb +28 -0
  48. data/spec/lib/declare_schema/schema_change/foreign_key_add_spec.rb +29 -0
  49. data/spec/lib/declare_schema/schema_change/foreign_key_remove_spec.rb +29 -0
  50. data/spec/lib/declare_schema/schema_change/index_add_spec.rb +56 -0
  51. data/spec/lib/declare_schema/schema_change/index_remove_spec.rb +29 -0
  52. data/spec/lib/declare_schema/schema_change/primary_key_change_spec.rb +69 -0
  53. data/spec/lib/declare_schema/schema_change/table_add_spec.rb +50 -0
  54. data/spec/lib/declare_schema/schema_change/table_change_spec.rb +30 -0
  55. data/spec/lib/declare_schema/schema_change/table_remove_spec.rb +27 -0
  56. data/spec/lib/declare_schema/schema_change/table_rename_spec.rb +27 -0
  57. data/spec/lib/declare_schema_spec.rb +101 -0
  58. data/spec/lib/generators/declare_schema/migration/migrator_spec.rb +71 -13
  59. data/spec/support/acceptance_spec_helpers.rb +2 -2
  60. metadata +33 -3
  61. data/test_responses.txt +0 -2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declare_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre.6
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development adapted from hobo_fields by Tom Locke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-19 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -57,6 +57,7 @@ files:
57
57
  - gemfiles/rails_6_sqlite.gemfile
58
58
  - lib/declare_schema.rb
59
59
  - lib/declare_schema/command.rb
60
+ - lib/declare_schema/dsl.rb
60
61
  - lib/declare_schema/extensions/active_record/fields_declaration.rb
61
62
  - lib/declare_schema/extensions/module.rb
62
63
  - lib/declare_schema/field_declaration_dsl.rb
@@ -68,6 +69,21 @@ files:
68
69
  - lib/declare_schema/model/index_definition.rb
69
70
  - lib/declare_schema/model/table_options_definition.rb
70
71
  - lib/declare_schema/railtie.rb
72
+ - lib/declare_schema/schema_change/all.rb
73
+ - lib/declare_schema/schema_change/base.rb
74
+ - lib/declare_schema/schema_change/column_add.rb
75
+ - lib/declare_schema/schema_change/column_change.rb
76
+ - lib/declare_schema/schema_change/column_remove.rb
77
+ - lib/declare_schema/schema_change/column_rename.rb
78
+ - lib/declare_schema/schema_change/foreign_key_add.rb
79
+ - lib/declare_schema/schema_change/foreign_key_remove.rb
80
+ - lib/declare_schema/schema_change/index_add.rb
81
+ - lib/declare_schema/schema_change/index_remove.rb
82
+ - lib/declare_schema/schema_change/primary_key_change.rb
83
+ - lib/declare_schema/schema_change/table_add.rb
84
+ - lib/declare_schema/schema_change/table_change.rb
85
+ - lib/declare_schema/schema_change/table_remove.rb
86
+ - lib/declare_schema/schema_change/table_rename.rb
71
87
  - lib/declare_schema/version.rb
72
88
  - lib/generators/declare_schema/migration/USAGE
73
89
  - lib/generators/declare_schema/migration/migration_generator.rb
@@ -90,10 +106,24 @@ files:
90
106
  - spec/lib/declare_schema/model/index_definition_spec.rb
91
107
  - spec/lib/declare_schema/model/table_options_definition_spec.rb
92
108
  - spec/lib/declare_schema/prepare_testapp.rb
109
+ - spec/lib/declare_schema/schema_change/base_spec.rb
110
+ - spec/lib/declare_schema/schema_change/column_add_spec.rb
111
+ - spec/lib/declare_schema/schema_change/column_change_spec.rb
112
+ - spec/lib/declare_schema/schema_change/column_remove_spec.rb
113
+ - spec/lib/declare_schema/schema_change/column_rename_spec.rb
114
+ - spec/lib/declare_schema/schema_change/foreign_key_add_spec.rb
115
+ - spec/lib/declare_schema/schema_change/foreign_key_remove_spec.rb
116
+ - spec/lib/declare_schema/schema_change/index_add_spec.rb
117
+ - spec/lib/declare_schema/schema_change/index_remove_spec.rb
118
+ - spec/lib/declare_schema/schema_change/primary_key_change_spec.rb
119
+ - spec/lib/declare_schema/schema_change/table_add_spec.rb
120
+ - spec/lib/declare_schema/schema_change/table_change_spec.rb
121
+ - spec/lib/declare_schema/schema_change/table_remove_spec.rb
122
+ - spec/lib/declare_schema/schema_change/table_rename_spec.rb
123
+ - spec/lib/declare_schema_spec.rb
93
124
  - spec/lib/generators/declare_schema/migration/migrator_spec.rb
94
125
  - spec/spec_helper.rb
95
126
  - spec/support/acceptance_spec_helpers.rb
96
- - test_responses.txt
97
127
  homepage: https://github.com/Invoca/declare_schema
98
128
  licenses: []
99
129
  metadata:
data/test_responses.txt DELETED
@@ -1,2 +0,0 @@
1
- id
2
- drop id