diff --git a/migrator/migrations/1534475443-DOWN-update-companies.sql b/migrator/migrations/1534475443-DOWN-update-companies.sql new file mode 100644 index 00000000..5a30112a --- /dev/null +++ b/migrator/migrations/1534475443-DOWN-update-companies.sql @@ -0,0 +1 @@ +-- 1534475443 DOWN update-companies \ No newline at end of file diff --git a/migrator/migrations/1534475443-UP-update-companies.sql b/migrator/migrations/1534475443-UP-update-companies.sql new file mode 100644 index 00000000..c2528c3f --- /dev/null +++ b/migrator/migrations/1534475443-UP-update-companies.sql @@ -0,0 +1,24 @@ +-- 1534475443 UP update-companies +DELETE FROM companies where code in +('BES', 'BSA', 'HM', 'FCF', 'INT', 'JS', 'MV', 'ORA', 'SK', 'SLO', 'WE'); + +INSERT INTO companies (code, name, data) +VALUES +('BES', 'Brian & Erin Skarbek', '{:locations ["CB"] }'), +('BSA', 'Be Steak A', '{:locations ["CB"] }'), +('HM', 'Hiro Mura', '{:locations ["SV"] }'), +('FCF', 'Frost Cupcake Factory', '{:locations ["CB"] }'), +('INT', 'Integreat', '{:locations ["CB"] }'), +('JS', 'Jason Skarbek', '{:locations ["CB"] }'), +('MV', 'Mio Vicino - Santa Clara', '{:locations ["SC"] }'), +('ORA', 'Orale''s', '{:locations ["CB"] }'), +('SK', 'Savory Kitchen', '{:locations ["AL"] }'), +('SLO', 'Skarbek Law Offices', '{:locations ["CB"] }'), +('WE', 'Warm Elements', '{:locations ["CB"] }'); + +DELETE FROM invoices_expense_accounts where invoice_id in (select id from invoices where company_id in (select id from companies where name in ('Knock Out Grill & Bar', 'Nasch Bistro', 'Naschmarkt', 'The Socialight'))); +DELETE FROM invoices_checks where invoice_id in (select id from invoices where company_id in (select id from companies where name in ('Knock Out Grill & Bar', 'Nasch Bistro', 'Naschmarkt', 'The Socialight'))); + +DELETE FROM invoices where company_id in (select id from companies where name in ('Knock Out Grill & Bar', 'Nasch Bistro', 'Naschmarkt', 'The Socialight')); +DELETE FROM checks where company_id in (select id from companies where name in ('Knock Out Grill & Bar', 'Nasch Bistro', 'Naschmarkt', 'The Socialight')); +DELETE FROM companies where name in ('Knock Out Grill & Bar', 'Nasch Bistro', 'Naschmarkt', 'The Socialight');