diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-14 20:11:02 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-14 20:11:02 -0700 |
commit | 0c3ac87be632d1142a5b1c5e6096330d4693bdaa (patch) | |
tree | b861f6fc2f2aedf200d464715a722d456f0abdcf /rust | |
parent | 06c7244ce74808a7bc1ad6940dcd877efa10527f (diff) | |
download | fatcat-0c3ac87be632d1142a5b1c5e6096330d4693bdaa.tar.gz fatcat-0c3ac87be632d1142a5b1c5e6096330d4693bdaa.zip |
disable base diesel setup (for cockroach)
Diffstat (limited to 'rust')
-rw-r--r-- | rust/migrations/00000000000000_diesel_initial_setup/down.sql | 5 | ||||
-rw-r--r-- | rust/migrations/00000000000000_diesel_initial_setup/up.sql | 36 |
2 files changed, 22 insertions, 19 deletions
diff --git a/rust/migrations/00000000000000_diesel_initial_setup/down.sql b/rust/migrations/00000000000000_diesel_initial_setup/down.sql index a9f52609..adfa4902 100644 --- a/rust/migrations/00000000000000_diesel_initial_setup/down.sql +++ b/rust/migrations/00000000000000_diesel_initial_setup/down.sql @@ -2,5 +2,6 @@ -- and other internal bookkeeping. This file is safe to edit, any future -- changes will be added to existing projects as new migrations. -DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass); -DROP FUNCTION IF EXISTS diesel_set_updated_at(); +SELECT 1; +-- DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass); +-- DROP FUNCTION IF EXISTS diesel_set_updated_at(); diff --git a/rust/migrations/00000000000000_diesel_initial_setup/up.sql b/rust/migrations/00000000000000_diesel_initial_setup/up.sql index 3400c7c5..f89156f7 100644 --- a/rust/migrations/00000000000000_diesel_initial_setup/up.sql +++ b/rust/migrations/00000000000000_diesel_initial_setup/up.sql @@ -16,22 +16,24 @@ -- -- SELECT diesel_manage_updated_at('users'); -- ``` -CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$ -BEGIN - EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s - FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl); -END; -$$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$ -BEGIN - IF ( - NEW IS DISTINCT FROM OLD AND - NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at - ) THEN - NEW.updated_at := current_timestamp; - END IF; - RETURN NEW; -END; -$$ LANGUAGE plpgsql; +-- CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$ +-- BEGIN +-- EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s +-- FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl); +-- END; +-- $$ LANGUAGE plpgsql; +-- CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$ +-- BEGIN +-- IF ( +-- NEW IS DISTINCT FROM OLD AND +-- NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at +-- ) THEN +-- NEW.updated_at := current_timestamp; +-- END IF; +-- RETURN NEW; +-- END; +-- $$ LANGUAGE plpgsql; + +SELECT 1 |