These columns are now populated and required during insert. This causes a large amount of fallout in the specs, as there were many places that inserted rows without having a related project. No changes outside the specs except for ApiKey#create_personal_access_token, which now requires a project keyword argument, since the method would fail without it now (the was previously optional).
22 lines
460 B
Ruby
22 lines
460 B
Ruby
# frozen_string_literal: true
|
|
|
|
Sequel.migration do
|
|
no_transaction
|
|
|
|
up do
|
|
%i[api_key firewall load_balancer minio_cluster private_subnet vm].each do |table|
|
|
alter_table(table) do
|
|
set_column_not_null :project_id
|
|
end
|
|
end
|
|
end
|
|
|
|
down do
|
|
%i[api_key firewall load_balancer minio_cluster private_subnet vm].reverse_each do |table|
|
|
alter_table(table) do
|
|
set_column_allow_null :project_id
|
|
end
|
|
end
|
|
end
|
|
end
|