diff --git a/DB/import.sh b/DB/import.sh index f7f6800..a2b976a 100755 --- a/DB/import.sh +++ b/DB/import.sh @@ -25,15 +25,9 @@ docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --en docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy inventories(id, kot_id, product_id, sort_order, quantity, price, is_happy_hour, tax_rate, tax_id, discount) from /mnt/r-Inventories.csv"' docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy inventory_modifiers(id, inventory_id, modifier_id, price) from /mnt/s-InventoryModifiers.csv"' docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy overview(id, voucher_id, food_table_id, status) from /mnt/t-Overview.csv"' -echo u -docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy product_group_modifiers(id, product_group_id, modifier_id, show_automatically) from /mnt/u-ProductGroupModifiers.csv"' -echo v -docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy reprints(id, user_id, date, voucher_id) from /mnt/v-Reprints.csv"' -echo w -docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy settings(id, name, data) from /mnt/w-Settings.csv"' -echo x -docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy settlements(id, voucher_id, settled, amount) from /mnt/x-VoucherSettlements.csv"' -echo z +docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy reprints(id, user_id, date, voucher_id) from /mnt/u-Reprints.csv"' +docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy settings(id, name, data) from /mnt/v-Settings.csv"' +docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy settlements(id, voucher_id, settled, amount) from /mnt/w-VoucherSettlements.csv"' docker run -it -v /home/tanshu/Programming/barker/DB:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty < /mnt/z-RenamePermissions.sql' # Show the file in code to see the hidden chars diff --git a/DB/migrate.cmd b/DB/migrate.cmd index bb29d00..f619d7b 100644 --- a/DB/migrate.cmd +++ b/DB/migrate.cmd @@ -19,10 +19,9 @@ call:copyQuery q-Kots "SELECT KotID, VoucherID, Code, TableID, Date, UserID FRO call:copyQuery r-Inventories "SELECT InventoryID, KotID, ProductID, SortOrder, Quantity, Price, CASE WHEN IsHappyHour = 1 THEN 't' ELSE 'f' END, VatRate, VatID, Discount FROM Test.dbo.Inventories;" call:copyQuery s-InventoryModifiers "SELECT InventoryModifierID, InventoryID, ModifierID, 0 FROM Test.dbo.InventoryModifiers;" call:copyQuery t-Overview "SELECT newid(), VoucherID, FoodTableID, Status FROM Test.dbo.FoodTables WHERE VoucherID IS NOT NULL;" -call:copyQuery u-ProductGroupModifiers "SELECT ProductGroupModifierID, COALESCE(CAST(ProductGroupID AS Nvarchar(36)),'\N'), ModifierID, CASE WHEN ShowAutomatically = 1 THEN 't' ELSE 'f' END FROM Test.dbo.ProductGroupModifiers;" -call:copyQuery v-Reprints "SELECT ReprintID, UserID, Date, VoucherID FROM Test.dbo.Reprints;" -call:copyQuery w-Settings "SELECT SettingID, Name, Details FROM Test.dbo.Settings;" -call:copyQuery x-VoucherSettlements "SELECT VoucherSettlementID, VoucherID, Settled, Amount FROM Test.dbo.VoucherSettlements;" +call:copyQuery u-Reprints "SELECT ReprintID, UserID, Date, VoucherID FROM Test.dbo.Reprints;" +call:copyQuery v-Settings "SELECT SettingID, Name, Details FROM Test.dbo.Settings;" +call:copyQuery w-VoucherSettlements "SELECT VoucherSettlementID, VoucherID, Settled, Amount FROM Test.dbo.VoucherSettlements;" goto:eof :copyQuery - here starts my function identified by it's label