add postgres migration
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
-- sqlc queries target lowercase table names. Postgres migrations historically
|
||||
-- created quoted CamelCase tables, so expose lowercase compatibility views.
|
||||
CREATE OR REPLACE VIEW inventory AS
|
||||
SELECT * FROM "Inventory";
|
||||
|
||||
CREATE OR REPLACE VIEW updates AS
|
||||
SELECT * FROM "Updates";
|
||||
|
||||
CREATE OR REPLACE VIEW events AS
|
||||
SELECT * FROM "Events";
|
||||
|
||||
CREATE OR REPLACE VIEW inventory_history AS
|
||||
SELECT * FROM "InventoryHistory";
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
DROP VIEW IF EXISTS inventory_history;
|
||||
DROP VIEW IF EXISTS events;
|
||||
DROP VIEW IF EXISTS updates;
|
||||
DROP VIEW IF EXISTS inventory;
|
||||
-- +goose StatementEnd
|
||||
Reference in New Issue
Block a user