playbooks/brewman/files/exp database migration

31 lines
1.9 KiB
Plaintext

ALTER TABLE accounts ADD CONSTRAINT accounts_name_key UNIQUE (name);
alter table accounts drop constraint uq_accounts_name;
alter table auth_clients drop constraint uq_auth_clients_code;
alter table auth_clients drop constraint uq_auth_clients_name;
ALTER TABLE auth_clients ADD CONSTRAINT "auth_clients_Code_key" UNIQUE (name);
ALTER TABLE auth_clients ADD CONSTRAINT "auth_clients_Name_key" UNIQUE (name);
alter table auth_login_history drop constraint uq_auth_login_history_user_id;
ALTER TABLE auth_login_history ADD CONSTRAINT "auth_login_history_user_id_client_id_date_key" UNIQUE (date);
ALTER TABLE auth_roles ADD CONSTRAINT "auth_roles_Name_key" UNIQUE ("Name");
ALTER TABLE auth_groups ADD CONSTRAINT "auth_groups_Name_key" UNIQUE ("Name");
ALTER TABLE auth_users ADD CONSTRAINT "auth_users_Name_key" UNIQUE ("Name");
ALTER TABLE cost_centres ADD CONSTRAINT "entities_costcenters_Name_key" UNIQUE ("Name");
ALTER TABLE fingerprints ADD CONSTRAINT "uq_employee_id_date" UNIQUE ("EmployeeID");
ALTER TABLE product_groups ADD CONSTRAINT "entities_productgroups_Name_key" UNIQUE ("Name");
ALTER TABLE products ADD CONSTRAINT "products_Code_key" UNIQUE ("Code");
ALTER TABLE products ADD CONSTRAINT "products_Name_Units_key" UNIQUE ("Code");
alter table recipe_items drop constraint uq_recipe_items_recipe_id;
ALTER TABLE recipe_items ADD CONSTRAINT "recipe_items_recipe_id_product_id_key" UNIQUE (product_id);
ALTER TABLE settings ADD CONSTRAINT "settings_Name_key" UNIQUE ("Name");
DROP INDEX ix_vouchers_date;
ALTER TABLE service_charges ADD CONSTRAINT "service_charges_journal_id_fkey" UNIQUE ("journal_id");
ALTER TABLE service_charges ADD CONSTRAINT "service_charges_voucher_id_fkey" UNIQUE ("journal_id");
ALTER TABLE salary_deductions ADD CONSTRAINT "entities_salarydeductions_JournalID_fkey" UNIQUE ("JournalID");
ALTER TABLE salary_deductions ADD CONSTRAINT "salary_deductions_VoucherID_fkey" UNIQUE ("VoucherID");