IntegerMigrator doesn't allow duplicate migrations (1_foo, 1_bar). Requires manual renaming for simultaneous migrations. Here's comparison in detail: https://sequel.jeremyevans.net/rdoc/files/doc/migration_rdoc.html#label-Two+separate+migrators The TimestampMigrator will be used if any filename in the migrations directory has a version greater than 20000101. IntegerMigrator keeps version information at scheme_info table with an integer. But TimestampMigrator keeps version information at scheme_migrations tables with all filenames. It's not backward compatible. You need to reset your database or create and fill scheme_migrations table manually, then drop scheme_info table.
20 lines
558 B
Ruby
20 lines
558 B
Ruby
# frozen_string_literal: true
|
|
|
|
Sequel.migration do
|
|
change do
|
|
create_table(:vm_storage_volume) do
|
|
column :id, :uuid, primary_key: true, default: Sequel.lit("gen_random_uuid()")
|
|
foreign_key :vm_id, :vm, type: :uuid, null: false
|
|
column :boot, :bool, null: false
|
|
column :size_gib, :bigint, null: false
|
|
column :disk_index, :int, null: false
|
|
|
|
unique [:vm_id, :disk_index]
|
|
end
|
|
|
|
alter_table(:vm_host) do
|
|
add_constraint(:hugepages_allocation_limit) { used_hugepages_1g <= total_hugepages_1g }
|
|
end
|
|
end
|
|
end
|