fix errors in migration scripts

This commit is contained in:
Thomas Peetz
2025-06-28 18:19:14 +02:00
parent 1be2dcbdfc
commit eab74a62f7
12 changed files with 128 additions and 6 deletions
@@ -6,7 +6,7 @@ class CreatePublishers < ActiveRecord::Migration[8.0]
t.integer :version
t.string :name
t.string :weblink
t.belongs_to :publisher, optional: true
t.string :parent_publisher_id
end
change_column :publishers, :id, :string
end
@@ -8,7 +8,7 @@ class CreateComics < ActiveRecord::Migration[8.0]
t.boolean :current_order
t.boolean :completed
t.string :weblink
t.belongs_to :publisher, foreign_key: true
t.belongs_to :publisher
end
change_column :comics, :id, :string
end
@@ -9,9 +9,9 @@ class CreateIssues < ActiveRecord::Migration[8.0]
t.datetime :published_on
t.boolean :in_stock
t.boolean :is_read
t.belongs_to :comic, foreign_key: true
t.belongs_to :volume, foreign_key: true
t.belongs_to :story_arc, foreign_key: true
t.belongs_to :comic
t.belongs_to :volume
t.belongs_to :story_arc
end
change_column :issues, :id, :string
end
+95 -1
View File
@@ -10,5 +10,99 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 0) do
ActiveRecord::Schema[8.0].define(version: 2025_06_26_100213) do
create_table "artists", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "comic_works", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "comics", id: false, force: :cascade do |t|
t.string "id"
t.datetime "created_date"
t.datetime "last_modified_date"
t.integer "version"
t.string "title"
t.boolean "current_order"
t.boolean "completed"
t.string "weblink"
t.integer "publisher_id"
t.index ["publisher_id"], name: "index_comics_on_publisher_id"
end
create_table "issue_works", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "issues", id: false, force: :cascade do |t|
t.string "id"
t.datetime "created_date"
t.datetime "last_modified_date"
t.integer "version"
t.string "issueNumber"
t.string "title"
t.datetime "published_on"
t.boolean "in_stock"
t.boolean "is_read"
t.integer "comic_id"
t.integer "volume_id"
t.integer "story_arc_id"
t.index ["comic_id"], name: "index_issues_on_comic_id"
t.index ["story_arc_id"], name: "index_issues_on_story_arc_id"
t.index ["volume_id"], name: "index_issues_on_volume_id"
end
create_table "publishers", id: false, force: :cascade do |t|
t.string "id"
t.datetime "created_date"
t.datetime "last_modified_date"
t.integer "version"
t.string "name"
t.string "weblink"
t.string "parent_publisher_id"
end
create_table "story_arcs", id: false, force: :cascade do |t|
t.string "id"
t.datetime "created_date"
t.datetime "last_modified_date"
t.integer "version"
t.string "name"
t.integer "comic_id"
t.index ["comic_id"], name: "index_story_arcs_on_comic_id"
end
create_table "trade_paperbacks", id: false, force: :cascade do |t|
t.string "id"
t.datetime "created_date"
t.datetime "last_modified_date"
t.integer "version"
t.string "name"
t.integer "issue_start"
t.integer "issue_end"
t.integer "comic_id"
t.index ["comic_id"], name: "index_trade_paperbacks_on_comic_id"
end
create_table "volumes", id: false, force: :cascade do |t|
t.string "id"
t.datetime "created_date"
t.datetime "last_modified_date"
t.integer "version"
t.string "name"
t.integer "comic_id"
t.index ["comic_id"], name: "index_volumes_on_comic_id"
end
create_table "worktypes", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end