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.
- checksums.yaml +4 -4
- data/.github/workflows/acceptance-tests-on-emulator.yaml +4 -6
- data/.github/workflows/ci.yaml +4 -6
- data/.github/workflows/nightly-acceptance-tests-on-emulator.yaml +4 -6
- data/.github/workflows/nightly-unit-tests.yaml +4 -6
- data/.github/workflows/rubocop.yaml +1 -1
- data/.github/workflows/samples.yaml +30 -0
- data/.kokoro/release.cfg +2 -2
- data/.kokoro/release.sh +1 -4
- data/.release-please-manifest.json +1 -1
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +28 -0
- data/Gemfile +6 -5
- data/README.md +26 -22
- data/acceptance/cases/migration/command_recorder_test.rb +7 -38
- data/acceptance/cases/migration/references_index_test.rb +2 -11
- data/acceptance/cases/models/binary_identifiers.rb +97 -0
- data/acceptance/cases/models/default_value_test.rb +2 -2
- data/acceptance/cases/tasks/database_tasks_test.rb +71 -74
- data/acceptance/cases/transactions/read_write_transactions_test.rb +10 -4
- data/acceptance/models/binary_project.rb +20 -0
- data/acceptance/models/string_io.rb +28 -0
- data/acceptance/models/user.rb +20 -0
- data/acceptance/test_helper.rb +22 -8
- data/activerecord-spanner-adapter.gemspec +3 -3
- data/benchmarks/application.rb +3 -7
- data/examples/snippets/Rakefile +28 -5
- data/examples/snippets/array-data-type/application.rb +1 -5
- data/examples/snippets/array-data-type/config/database.yml +1 -0
- data/examples/snippets/auto-generated-primary-key/README.md +140 -0
- data/examples/snippets/auto-generated-primary-key/Rakefile +13 -0
- data/examples/snippets/auto-generated-primary-key/application.rb +86 -0
- data/examples/snippets/auto-generated-primary-key/config/database.yml +10 -0
- data/examples/snippets/auto-generated-primary-key/db/migrate/01_create_tables.rb +29 -0
- data/examples/snippets/auto-generated-primary-key/db/seeds.rb +31 -0
- data/examples/snippets/auto-generated-primary-key/models/album.rb +11 -0
- data/examples/snippets/auto-generated-primary-key/models/singer.rb +11 -0
- data/examples/snippets/bit-reversed-sequence/application.rb +0 -4
- data/examples/snippets/bit-reversed-sequence/config/database.yml +1 -0
- data/examples/snippets/bit-reversed-sequence/db/seeds.rb +2 -2
- data/examples/snippets/bulk-insert/application.rb +1 -5
- data/examples/snippets/bulk-insert/config/database.yml +1 -0
- data/examples/snippets/commit-timestamp/application.rb +0 -4
- data/examples/snippets/commit-timestamp/config/database.yml +1 -0
- data/examples/snippets/config/environment.rb +5 -0
- data/examples/snippets/create-records/application.rb +1 -5
- data/examples/snippets/create-records/config/database.yml +1 -0
- data/examples/snippets/date-data-type/application.rb +1 -5
- data/examples/snippets/date-data-type/config/database.yml +1 -0
- data/examples/snippets/date-data-type/db/seeds.rb +1 -1
- data/examples/snippets/generated-column/application.rb +0 -4
- data/examples/snippets/generated-column/config/database.yml +1 -0
- data/examples/snippets/generated-column/db/seeds.rb +1 -1
- data/examples/snippets/hints/application.rb +0 -4
- data/examples/snippets/hints/config/database.yml +1 -0
- data/examples/snippets/hints/db/seeds.rb +1 -1
- data/examples/snippets/interleaved-tables/application.rb +1 -5
- data/examples/snippets/interleaved-tables/config/database.yml +1 -0
- data/examples/snippets/interleaved-tables/db/seeds.rb +1 -1
- data/examples/snippets/interleaved-tables/models/album.rb +6 -2
- data/examples/snippets/interleaved-tables/models/track.rb +5 -1
- data/examples/snippets/interleaved-tables-before-7.1/application.rb +1 -5
- data/examples/snippets/interleaved-tables-before-7.1/config/database.yml +1 -0
- data/examples/snippets/interleaved-tables-before-7.1/db/seeds.rb +1 -1
- data/examples/snippets/migrations/application.rb +0 -4
- data/examples/snippets/migrations/config/database.yml +1 -0
- data/examples/snippets/mutations/application.rb +1 -5
- data/examples/snippets/mutations/config/database.yml +1 -0
- data/examples/snippets/mutations/db/seeds.rb +1 -1
- data/examples/snippets/optimistic-locking/application.rb +0 -4
- data/examples/snippets/optimistic-locking/config/database.yml +1 -0
- data/examples/snippets/optimistic-locking/db/seeds.rb +1 -1
- data/examples/snippets/partitioned-dml/application.rb +0 -4
- data/examples/snippets/partitioned-dml/config/database.yml +1 -0
- data/examples/snippets/partitioned-dml/db/seeds.rb +1 -1
- data/examples/snippets/query-logs/application.rb +15 -13
- data/examples/snippets/query-logs/config/database.yml +1 -0
- data/examples/snippets/query-logs/db/seeds.rb +1 -1
- data/examples/snippets/quickstart/application.rb +0 -4
- data/examples/snippets/quickstart/config/database.yml +1 -0
- data/examples/snippets/quickstart/db/seeds.rb +1 -1
- data/examples/snippets/read-only-transactions/application.rb +0 -4
- data/examples/snippets/read-only-transactions/config/database.yml +1 -0
- data/examples/snippets/read-only-transactions/db/seeds.rb +1 -1
- data/examples/snippets/read-write-transactions/application.rb +2 -6
- data/examples/snippets/read-write-transactions/config/database.yml +1 -0
- data/examples/snippets/read-write-transactions/db/seeds.rb +1 -1
- data/examples/snippets/stale-reads/application.rb +0 -4
- data/examples/snippets/stale-reads/config/database.yml +1 -0
- data/examples/snippets/stale-reads/db/seeds.rb +1 -1
- data/examples/snippets/tags/application.rb +0 -4
- data/examples/snippets/tags/config/database.yml +1 -0
- data/examples/snippets/tags/db/seeds.rb +1 -1
- data/examples/snippets/timestamp-data-type/application.rb +0 -4
- data/examples/snippets/timestamp-data-type/config/database.yml +1 -0
- data/lib/active_record/connection_adapters/spanner/column.rb +7 -3
- data/lib/active_record/connection_adapters/spanner/database_statements.rb +34 -22
- data/lib/active_record/connection_adapters/spanner/quoting.rb +2 -1
- data/lib/active_record/connection_adapters/spanner/schema_creation.rb +20 -11
- data/lib/active_record/connection_adapters/spanner/schema_definitions.rb +12 -2
- data/lib/active_record/connection_adapters/spanner/schema_statements.rb +22 -51
- data/lib/active_record/connection_adapters/spanner/type_metadata.rb +10 -8
- data/lib/active_record/connection_adapters/spanner_adapter.rb +42 -7
- data/lib/active_record/tasks/spanner_database_tasks.rb +4 -4
- data/lib/active_record/type/spanner/array.rb +4 -0
- data/lib/active_record/type/spanner/bytes.rb +10 -0
- data/lib/activerecord_spanner_adapter/base.rb +59 -32
- data/lib/activerecord_spanner_adapter/connection.rb +9 -5
- data/lib/activerecord_spanner_adapter/foreign_key.rb +9 -2
- data/lib/activerecord_spanner_adapter/index/column.rb +6 -1
- data/lib/activerecord_spanner_adapter/index.rb +10 -2
- data/lib/activerecord_spanner_adapter/information_schema.rb +5 -3
- data/lib/activerecord_spanner_adapter/primary_key.rb +2 -2
- data/lib/activerecord_spanner_adapter/table/column.rb +16 -4
- data/lib/activerecord_spanner_adapter/table.rb +8 -2
- data/lib/activerecord_spanner_adapter/transaction.rb +1 -1
- data/lib/activerecord_spanner_adapter/version.rb +1 -1
- data/lib/arel/visitors/spanner.rb +16 -11
- data/lib/spanner_client_ext.rb +4 -3
- metadata +23 -34
- data/examples/snippets/array-data-type/db/schema.rb +0 -31
- data/examples/snippets/bit-reversed-sequence/db/schema.rb +0 -31
- data/examples/snippets/bulk-insert/db/schema.rb +0 -31
- data/examples/snippets/commit-timestamp/db/schema.rb +0 -34
- data/examples/snippets/create-records/db/schema.rb +0 -31
- data/examples/snippets/date-data-type/db/schema.rb +0 -26
- data/examples/snippets/generated-column/db/schema.rb +0 -26
- data/examples/snippets/hints/db/schema.rb +0 -33
- data/examples/snippets/interleaved-tables/db/schema.rb +0 -39
- data/examples/snippets/interleaved-tables-before-7.1/db/schema.rb +0 -37
- data/examples/snippets/migrations/db/schema.rb +0 -38
- data/examples/snippets/mutations/db/schema.rb +0 -32
- data/examples/snippets/optimistic-locking/db/schema.rb +0 -34
- data/examples/snippets/partitioned-dml/db/schema.rb +0 -31
- data/examples/snippets/query-logs/db/schema.rb +0 -31
- data/examples/snippets/quickstart/db/schema.rb +0 -31
- data/examples/snippets/read-only-transactions/db/schema.rb +0 -31
- data/examples/snippets/read-write-transactions/db/schema.rb +0 -32
- data/examples/snippets/stale-reads/db/schema.rb +0 -31
- data/examples/snippets/tags/db/schema.rb +0 -31
- 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
|