activerecord-spanner-adapter 1.8.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/acceptance-tests-on-emulator.yaml +4 -6
  3. data/.github/workflows/ci.yaml +4 -6
  4. data/.github/workflows/nightly-acceptance-tests-on-emulator.yaml +4 -6
  5. data/.github/workflows/nightly-unit-tests.yaml +4 -6
  6. data/.github/workflows/rubocop.yaml +1 -1
  7. data/.github/workflows/samples.yaml +30 -0
  8. data/.kokoro/release.cfg +2 -2
  9. data/.kokoro/release.sh +1 -4
  10. data/.release-please-manifest.json +1 -1
  11. data/.rubocop.yml +2 -2
  12. data/CHANGELOG.md +28 -0
  13. data/Gemfile +6 -5
  14. data/README.md +26 -22
  15. data/acceptance/cases/migration/command_recorder_test.rb +7 -38
  16. data/acceptance/cases/migration/references_index_test.rb +2 -11
  17. data/acceptance/cases/models/binary_identifiers.rb +97 -0
  18. data/acceptance/cases/models/default_value_test.rb +2 -2
  19. data/acceptance/cases/tasks/database_tasks_test.rb +71 -74
  20. data/acceptance/cases/transactions/read_write_transactions_test.rb +10 -4
  21. data/acceptance/models/binary_project.rb +20 -0
  22. data/acceptance/models/string_io.rb +28 -0
  23. data/acceptance/models/user.rb +20 -0
  24. data/acceptance/test_helper.rb +22 -8
  25. data/activerecord-spanner-adapter.gemspec +3 -3
  26. data/benchmarks/application.rb +3 -7
  27. data/examples/snippets/Rakefile +28 -5
  28. data/examples/snippets/array-data-type/application.rb +1 -5
  29. data/examples/snippets/array-data-type/config/database.yml +1 -0
  30. data/examples/snippets/auto-generated-primary-key/README.md +140 -0
  31. data/examples/snippets/auto-generated-primary-key/Rakefile +13 -0
  32. data/examples/snippets/auto-generated-primary-key/application.rb +86 -0
  33. data/examples/snippets/auto-generated-primary-key/config/database.yml +10 -0
  34. data/examples/snippets/auto-generated-primary-key/db/migrate/01_create_tables.rb +29 -0
  35. data/examples/snippets/auto-generated-primary-key/db/seeds.rb +31 -0
  36. data/examples/snippets/auto-generated-primary-key/models/album.rb +11 -0
  37. data/examples/snippets/auto-generated-primary-key/models/singer.rb +11 -0
  38. data/examples/snippets/bit-reversed-sequence/application.rb +0 -4
  39. data/examples/snippets/bit-reversed-sequence/config/database.yml +1 -0
  40. data/examples/snippets/bit-reversed-sequence/db/seeds.rb +2 -2
  41. data/examples/snippets/bulk-insert/application.rb +1 -5
  42. data/examples/snippets/bulk-insert/config/database.yml +1 -0
  43. data/examples/snippets/commit-timestamp/application.rb +0 -4
  44. data/examples/snippets/commit-timestamp/config/database.yml +1 -0
  45. data/examples/snippets/config/environment.rb +5 -0
  46. data/examples/snippets/create-records/application.rb +1 -5
  47. data/examples/snippets/create-records/config/database.yml +1 -0
  48. data/examples/snippets/date-data-type/application.rb +1 -5
  49. data/examples/snippets/date-data-type/config/database.yml +1 -0
  50. data/examples/snippets/date-data-type/db/seeds.rb +1 -1
  51. data/examples/snippets/generated-column/application.rb +0 -4
  52. data/examples/snippets/generated-column/config/database.yml +1 -0
  53. data/examples/snippets/generated-column/db/seeds.rb +1 -1
  54. data/examples/snippets/hints/application.rb +0 -4
  55. data/examples/snippets/hints/config/database.yml +1 -0
  56. data/examples/snippets/hints/db/seeds.rb +1 -1
  57. data/examples/snippets/interleaved-tables/application.rb +1 -5
  58. data/examples/snippets/interleaved-tables/config/database.yml +1 -0
  59. data/examples/snippets/interleaved-tables/db/seeds.rb +1 -1
  60. data/examples/snippets/interleaved-tables/models/album.rb +6 -2
  61. data/examples/snippets/interleaved-tables/models/track.rb +5 -1
  62. data/examples/snippets/interleaved-tables-before-7.1/application.rb +1 -5
  63. data/examples/snippets/interleaved-tables-before-7.1/config/database.yml +1 -0
  64. data/examples/snippets/interleaved-tables-before-7.1/db/seeds.rb +1 -1
  65. data/examples/snippets/migrations/application.rb +0 -4
  66. data/examples/snippets/migrations/config/database.yml +1 -0
  67. data/examples/snippets/mutations/application.rb +1 -5
  68. data/examples/snippets/mutations/config/database.yml +1 -0
  69. data/examples/snippets/mutations/db/seeds.rb +1 -1
  70. data/examples/snippets/optimistic-locking/application.rb +0 -4
  71. data/examples/snippets/optimistic-locking/config/database.yml +1 -0
  72. data/examples/snippets/optimistic-locking/db/seeds.rb +1 -1
  73. data/examples/snippets/partitioned-dml/application.rb +0 -4
  74. data/examples/snippets/partitioned-dml/config/database.yml +1 -0
  75. data/examples/snippets/partitioned-dml/db/seeds.rb +1 -1
  76. data/examples/snippets/query-logs/application.rb +15 -13
  77. data/examples/snippets/query-logs/config/database.yml +1 -0
  78. data/examples/snippets/query-logs/db/seeds.rb +1 -1
  79. data/examples/snippets/quickstart/application.rb +0 -4
  80. data/examples/snippets/quickstart/config/database.yml +1 -0
  81. data/examples/snippets/quickstart/db/seeds.rb +1 -1
  82. data/examples/snippets/read-only-transactions/application.rb +0 -4
  83. data/examples/snippets/read-only-transactions/config/database.yml +1 -0
  84. data/examples/snippets/read-only-transactions/db/seeds.rb +1 -1
  85. data/examples/snippets/read-write-transactions/application.rb +2 -6
  86. data/examples/snippets/read-write-transactions/config/database.yml +1 -0
  87. data/examples/snippets/read-write-transactions/db/seeds.rb +1 -1
  88. data/examples/snippets/stale-reads/application.rb +0 -4
  89. data/examples/snippets/stale-reads/config/database.yml +1 -0
  90. data/examples/snippets/stale-reads/db/seeds.rb +1 -1
  91. data/examples/snippets/tags/application.rb +0 -4
  92. data/examples/snippets/tags/config/database.yml +1 -0
  93. data/examples/snippets/tags/db/seeds.rb +1 -1
  94. data/examples/snippets/timestamp-data-type/application.rb +0 -4
  95. data/examples/snippets/timestamp-data-type/config/database.yml +1 -0
  96. data/lib/active_record/connection_adapters/spanner/column.rb +7 -3
  97. data/lib/active_record/connection_adapters/spanner/database_statements.rb +34 -22
  98. data/lib/active_record/connection_adapters/spanner/quoting.rb +2 -1
  99. data/lib/active_record/connection_adapters/spanner/schema_creation.rb +20 -11
  100. data/lib/active_record/connection_adapters/spanner/schema_definitions.rb +12 -2
  101. data/lib/active_record/connection_adapters/spanner/schema_statements.rb +22 -51
  102. data/lib/active_record/connection_adapters/spanner/type_metadata.rb +10 -8
  103. data/lib/active_record/connection_adapters/spanner_adapter.rb +42 -7
  104. data/lib/active_record/tasks/spanner_database_tasks.rb +4 -4
  105. data/lib/active_record/type/spanner/array.rb +4 -0
  106. data/lib/active_record/type/spanner/bytes.rb +10 -0
  107. data/lib/activerecord_spanner_adapter/base.rb +59 -32
  108. data/lib/activerecord_spanner_adapter/connection.rb +9 -5
  109. data/lib/activerecord_spanner_adapter/foreign_key.rb +9 -2
  110. data/lib/activerecord_spanner_adapter/index/column.rb +6 -1
  111. data/lib/activerecord_spanner_adapter/index.rb +10 -2
  112. data/lib/activerecord_spanner_adapter/information_schema.rb +5 -3
  113. data/lib/activerecord_spanner_adapter/primary_key.rb +2 -2
  114. data/lib/activerecord_spanner_adapter/table/column.rb +16 -4
  115. data/lib/activerecord_spanner_adapter/table.rb +8 -2
  116. data/lib/activerecord_spanner_adapter/transaction.rb +1 -1
  117. data/lib/activerecord_spanner_adapter/version.rb +1 -1
  118. data/lib/arel/visitors/spanner.rb +16 -11
  119. data/lib/spanner_client_ext.rb +4 -3
  120. metadata +23 -34
  121. data/examples/snippets/array-data-type/db/schema.rb +0 -31
  122. data/examples/snippets/bit-reversed-sequence/db/schema.rb +0 -31
  123. data/examples/snippets/bulk-insert/db/schema.rb +0 -31
  124. data/examples/snippets/commit-timestamp/db/schema.rb +0 -34
  125. data/examples/snippets/create-records/db/schema.rb +0 -31
  126. data/examples/snippets/date-data-type/db/schema.rb +0 -26
  127. data/examples/snippets/generated-column/db/schema.rb +0 -26
  128. data/examples/snippets/hints/db/schema.rb +0 -33
  129. data/examples/snippets/interleaved-tables/db/schema.rb +0 -39
  130. data/examples/snippets/interleaved-tables-before-7.1/db/schema.rb +0 -37
  131. data/examples/snippets/migrations/db/schema.rb +0 -38
  132. data/examples/snippets/mutations/db/schema.rb +0 -32
  133. data/examples/snippets/optimistic-locking/db/schema.rb +0 -34
  134. data/examples/snippets/partitioned-dml/db/schema.rb +0 -31
  135. data/examples/snippets/query-logs/db/schema.rb +0 -31
  136. data/examples/snippets/quickstart/db/schema.rb +0 -31
  137. data/examples/snippets/read-only-transactions/db/schema.rb +0 -31
  138. data/examples/snippets/read-write-transactions/db/schema.rb +0 -32
  139. data/examples/snippets/stale-reads/db/schema.rb +0 -31
  140. data/examples/snippets/tags/db/schema.rb +0 -31
  141. data/examples/snippets/timestamp-data-type/db/schema.rb +0 -26
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema[7.1].define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", primary_key: ["singerid", "albumid"], force: :cascade do |t|
17
- t.integer "singerid", limit: 8, null: false
18
- t.integer "albumid", limit: 8, null: false
19
- t.string "title"
20
- end
21
-
22
- create_table "singers", primary_key: "singerid", default: -> { "GET_NEXT_SEQUENCE_VALUE(SEQUENCE singer_sequence)" }, force: :cascade do |t|
23
- t.string "first_name"
24
- t.string "last_name"
25
- end
26
-
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,34 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.decimal "marketing_budget"
19
- t.integer "singer_id", limit: 8
20
- t.time "last_updated", allow_commit_timestamp: true
21
- end
22
-
23
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
24
- t.string "first_name"
25
- t.string "last_name"
26
- t.time "last_updated", allow_commit_timestamp: true
27
- end
28
-
29
- add_foreign_key "albums", "singers"
30
- connection.run_batch
31
- rescue
32
- abort_batch
33
- raise
34
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,26 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "first_name"
18
- t.string "last_name"
19
- t.date "birth_date"
20
- end
21
-
22
- connection.run_batch
23
- rescue
24
- abort_batch
25
- raise
26
- end
@@ -1,26 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "first_name", limit: 100
18
- t.string "last_name", limit: 200, null: false
19
- t.virtual "full_name", type: :string, limit: 300, null: false, as: "COALESCE(first_name || ' ', '') || last_name", stored: true
20
- end
21
-
22
- connection.run_batch
23
- rescue
24
- abort_batch
25
- raise
26
- end
@@ -1,33 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name", limit: 100
23
- t.string "last_name", limit: 200, null: false
24
- t.virtual "full_name", type: :string, limit: 300, null: false, as: "COALESCE(first_name || ' ', '') || last_name", stored: true
25
- t.index ["full_name"], name: "index_singers_on_full_name", order: { full_name: :asc }
26
- end
27
-
28
- add_foreign_key "albums", "singers"
29
- connection.run_batch
30
- rescue
31
- abort_batch
32
- raise
33
- end
@@ -1,39 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema[7.1].define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", primary_key: ["singerid", "albumid"], force: :cascade do |t|
17
- t.integer "singerid", limit: 8
18
- t.integer "albumid", limit: 8
19
- t.string "title"
20
- end
21
-
22
- create_table "singers", primary_key: "singerid", force: :cascade do |t|
23
- t.string "first_name"
24
- t.string "last_name"
25
- end
26
-
27
- create_table "tracks", primary_key: ["singerid", "albumid", "trackid"], force: :cascade do |t|
28
- t.integer "singerid", limit: 8
29
- t.integer "albumid", limit: 8
30
- t.integer "trackid", limit: 8
31
- t.string "title"
32
- t.decimal "duration"
33
- end
34
-
35
- connection.run_batch
36
- rescue
37
- abort_batch
38
- raise
39
- end
@@ -1,37 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", primary_key: "albumid", force: :cascade do |t|
17
- t.integer "singerid", limit: 8, null: false
18
- t.string "title"
19
- end
20
-
21
- create_table "singers", primary_key: "singerid", force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- create_table "tracks", primary_key: "trackid", force: :cascade do |t|
27
- t.integer "singerid", limit: 8, null: false
28
- t.integer "albumid", limit: 8, null: false
29
- t.string "title"
30
- t.decimal "duration"
31
- end
32
-
33
- connection.run_batch
34
- rescue
35
- abort_batch
36
- raise
37
- end
@@ -1,38 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singers_id", limit: 8
19
- t.index ["singers_id"], name: "index_albums_on_singers_id", order: { singers_id: :asc }
20
- end
21
-
22
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
23
- t.string "first_name"
24
- t.string "last_name"
25
- end
26
-
27
- create_table "tracks", id: { limit: 8 }, force: :cascade do |t|
28
- t.string "title"
29
- t.decimal "duration"
30
- t.integer "albums_id", limit: 8
31
- t.index ["albums_id"], name: "index_tracks_on_albums_id", order: { albums_id: :asc }
32
- end
33
-
34
- connection.run_batch
35
- rescue
36
- abort_batch
37
- raise
38
- end
@@ -1,32 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.decimal "marketing_budget"
19
- t.integer "singer_id", limit: 8
20
- end
21
-
22
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
23
- t.string "first_name"
24
- t.string "last_name"
25
- end
26
-
27
- add_foreign_key "albums", "singers"
28
- connection.run_batch
29
- rescue
30
- abort_batch
31
- raise
32
- end
@@ -1,34 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.decimal "marketing_budget"
19
- t.integer "singer_id", limit: 8
20
- t.integer "lock_version", limit: 8
21
- end
22
-
23
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
24
- t.string "first_name"
25
- t.string "last_name"
26
- t.integer "lock_version", limit: 8
27
- end
28
-
29
- add_foreign_key "albums", "singers"
30
- connection.run_batch
31
- rescue
32
- abort_batch
33
- raise
34
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name", limit: 100
23
- t.string "last_name", limit: 200, null: false
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema[7.1].define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,32 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.decimal "marketing_budget"
19
- t.integer "singer_id", limit: 8
20
- end
21
-
22
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
23
- t.string "first_name"
24
- t.string "last_name"
25
- end
26
-
27
- add_foreign_key "albums", "singers"
28
- connection.run_batch
29
- rescue
30
- abort_batch
31
- raise
32
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,31 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "albums", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.integer "singer_id", limit: 8
19
- end
20
-
21
- create_table "singers", id: { limit: 8 }, force: :cascade do |t|
22
- t.string "first_name"
23
- t.string "last_name"
24
- end
25
-
26
- add_foreign_key "albums", "singers"
27
- connection.run_batch
28
- rescue
29
- abort_batch
30
- raise
31
- end
@@ -1,26 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # This file is the source Rails uses to define your schema when running `bin/rails
6
- # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 1) do
14
- connection.start_batch_ddl
15
-
16
- create_table "meetings", id: { limit: 8 }, force: :cascade do |t|
17
- t.string "title"
18
- t.time "meeting_time"
19
- t.string "meeting_timezone"
20
- end
21
-
22
- connection.run_batch
23
- rescue
24
- abort_batch
25
- raise
26
- end