aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deploy/schema.sql7
-rw-r--r--revert/schema.sql7
-rw-r--r--sqitch.plan1
-rw-r--r--verify/schema.sql10
4 files changed, 25 insertions, 0 deletions
diff --git a/deploy/schema.sql b/deploy/schema.sql
new file mode 100644
index 0000000..0074317
--- /dev/null
+++ b/deploy/schema.sql
@@ -0,0 +1,7 @@
+-- Deploy diary:schema to pg
+
+BEGIN;
+
+CREATE SCHEMA diary;
+
+COMMIT;
diff --git a/revert/schema.sql b/revert/schema.sql
new file mode 100644
index 0000000..6308dd1
--- /dev/null
+++ b/revert/schema.sql
@@ -0,0 +1,7 @@
+-- Revert diary:schema from pg
+
+BEGIN;
+
+DROP SCHEMA diary;
+
+COMMIT;
diff --git a/sqitch.plan b/sqitch.plan
index 059cc93..eaacef8 100644
--- a/sqitch.plan
+++ b/sqitch.plan
@@ -2,3 +2,4 @@
%project=diary
%uri=https://git.tojo.tokyo/diary-schema.git/about/
+schema 2024-03-10T11:00:19Z Masaya Tojo <masaya@tojo.tokyo> # Add schema for diary objects.
diff --git a/verify/schema.sql b/verify/schema.sql
new file mode 100644
index 0000000..ba8c5d8
--- /dev/null
+++ b/verify/schema.sql
@@ -0,0 +1,10 @@
+-- Verify diary:schema on pg
+
+BEGIN;
+
+DO $$
+BEGIN
+ ASSERT (SELECT has_schema_privilege('diary', 'usage'));
+END $$;
+
+ROLLBACK;