Modify migration and re-migrate
This commit is contained in:
parent
645a939e12
commit
8248b33d4b
3 changed files with 8 additions and 13 deletions
|
|
@ -1,13 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class CreateGranblueDataVersion < ActiveRecord::Migration[7.0]
|
class CreateDataVersions < ActiveRecord::Migration[7.0]
|
||||||
def change
|
def change
|
||||||
create_table :granblue_data_version do |t|
|
create_table :data_versions, id: :uuid, default: -> { 'gen_random_uuid()' } do |t|
|
||||||
t.string :filename, null: false
|
t.string :filename, null: false
|
||||||
t.datetime :imported_at, null: false
|
t.datetime :imported_at, null: false
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
|
|
||||||
t.index :filename, unique: true
|
t.index :filename, unique: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
14
db/schema.rb
14
db/schema.rb
|
|
@ -73,6 +73,12 @@ ActiveRecord::Schema[7.0].define(version: 2025_01_10_070255) do
|
||||||
create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t|
|
create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "data_versions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
|
t.string "filename", null: false
|
||||||
|
t.datetime "imported_at", null: false
|
||||||
|
t.index ["filename"], name: "index_data_versions_on_filename", unique: true
|
||||||
|
end
|
||||||
|
|
||||||
create_table "favorites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
create_table "favorites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
t.uuid "user_id"
|
t.uuid "user_id"
|
||||||
t.uuid "party_id"
|
t.uuid "party_id"
|
||||||
|
|
@ -105,14 +111,6 @@ ActiveRecord::Schema[7.0].define(version: 2025_01_10_070255) do
|
||||||
t.index ["gacha_id"], name: "index_gacha_rateups_on_gacha_id"
|
t.index ["gacha_id"], name: "index_gacha_rateups_on_gacha_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "granblue_data_version", force: :cascade do |t|
|
|
||||||
t.string "filename", null: false
|
|
||||||
t.datetime "imported_at", null: false
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.datetime "updated_at", null: false
|
|
||||||
t.index ["filename"], name: "index_granblue_data_version_on_filename", unique: true
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "grid_characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
create_table "grid_characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
t.uuid "party_id"
|
t.uuid "party_id"
|
||||||
t.uuid "character_id"
|
t.uuid "character_id"
|
||||||
|
|
|
||||||
0
lib/tasks/import_data.rake
Normal file
0
lib/tasks/import_data.rake
Normal file
Loading…
Reference in a new issue