77 lines
2.9 KiB
Ruby
77 lines
2.9 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateE621ExportTables < ActiveRecord::Migration[7.1]
|
|
def change
|
|
reversible do |r|
|
|
r.up { execute("CREATE SCHEMA e621") }
|
|
r.down { execute("DROP SCHEMA e621 CASCADE") }
|
|
end
|
|
create_table(:"e621.pools", id: :integer) do |t|
|
|
t.string(:name, null: false)
|
|
t.datetime(:created_at, null: false)
|
|
t.datetime(:updated_at, null: false)
|
|
t.integer(:creator_id, null: false)
|
|
t.string(:description)
|
|
t.boolean(:is_active, null: false, default: true)
|
|
t.string(:category, null: false, default: "series")
|
|
t.integer(:post_ids, array: [], null: false)
|
|
end
|
|
create_table(:"e621.posts", id: :integer) do |t|
|
|
t.integer(:uploader_id, null: false)
|
|
t.datetime(:created_at, null: false)
|
|
t.string(:md5, null: false)
|
|
t.string(:source, null: false)
|
|
t.string(:rating, null: false)
|
|
t.integer(:image_width, null: false)
|
|
t.integer(:image_height, null: false)
|
|
t.string(:tag_string, null: false)
|
|
t.string(:locked_tags)
|
|
t.integer(:fav_count, null: false)
|
|
t.string(:file_ext, null: false)
|
|
t.integer(:parent_id)
|
|
t.integer(:change_seq, null: false)
|
|
t.integer(:approver_id)
|
|
t.integer(:file_size, null: false)
|
|
t.integer(:comment_count, null: false)
|
|
t.string(:description, null: false)
|
|
t.numeric(:duration)
|
|
t.datetime(:updated_at)
|
|
t.boolean(:is_deleted, null: false, default: false)
|
|
t.boolean(:is_pending, null: false, default: false)
|
|
t.boolean(:is_flagged, null: false, default: false)
|
|
t.integer(:score, null: false)
|
|
t.integer(:up_score, null: false)
|
|
t.integer(:down_score, null: false)
|
|
t.boolean(:is_rating_locked, null: false, default: false)
|
|
t.boolean(:is_status_locked, null: false, default: false)
|
|
t.boolean(:is_note_locked, null: false, default: false)
|
|
end
|
|
create_table(:"e621.tag_aliases", id: :integer) do |t|
|
|
t.string(:antecedent_name, null: false)
|
|
t.string(:consequent_name, null: false)
|
|
t.datetime(:created_at)
|
|
t.string(:status, null: false)
|
|
end
|
|
create_table(:"e621.tag_implications", id: :integer) do |t|
|
|
t.string(:antecedent_name, null: false)
|
|
t.string(:consequent_name, null: false)
|
|
t.datetime(:created_at)
|
|
t.string(:status, null: false)
|
|
end
|
|
create_table(:"e621.tags", id: :integer) do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
|
t.string(:name, null: false)
|
|
t.string(:category, null: false)
|
|
t.integer(:post_count, null: false)
|
|
end
|
|
create_table(:"e621.wiki_pages", id: :integer) do |t|
|
|
t.datetime(:created_at, null: false)
|
|
t.datetime(:updated_at, null: false)
|
|
t.string(:title, null: false)
|
|
t.string(:body, null: false)
|
|
t.integer(:creator_id, null: false)
|
|
t.integer(:updater_id)
|
|
t.boolean(:is_locked, null: false, default: false)
|
|
end
|
|
end
|
|
end
|