Much base work started
This commit is contained in:
16
db/migrate/20251029120428_update_works_from_architecture.rb
Normal file
16
db/migrate/20251029120428_update_works_from_architecture.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class UpdateWorksFromArchitecture < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
change_table :works do |t|
|
||||
# Add defaults for boolean fields
|
||||
t.change_default :organized, false
|
||||
|
||||
# Make title required
|
||||
t.change_null :title, false
|
||||
end
|
||||
|
||||
# Add indexes as specified in architecture
|
||||
add_index :works, :title
|
||||
add_index :works, [:title, :year], unique: true
|
||||
add_index :works, :organized
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user