mirror of
https://github.com/moebooru/moebooru
synced 2025-08-22 01:47:48 +00:00
24 lines
680 B
Ruby
24 lines
680 B
Ruby
class CreateArtists < ActiveRecord::Migration[5.1]
|
|
def self.up
|
|
execute(<<-EOS)
|
|
CREATE TABLE artists (
|
|
id SERIAL,
|
|
japanese_name TEXT,
|
|
personal_name TEXT,
|
|
handle_name TEXT,
|
|
circle_name TEXT,
|
|
site_name TEXT,
|
|
site_url TEXT,
|
|
image_url TEXT
|
|
)
|
|
EOS
|
|
execute("CREATE INDEX idx_artists__image_url ON artists (image_url)")
|
|
execute("CREATE INDEX idx_artists__personal_name ON artists (personal_name) WHERE personal_name IS NOT NULL")
|
|
execute("CREATE INDEX idx_artists__handle_name ON artists (handle_name) WHERE handle_name IS NOT NULL")
|
|
end
|
|
|
|
def self.down
|
|
execute("DROP TABLE artists")
|
|
end
|
|
end
|