1 parent 9b43f27 commit dc6977bCopy full SHA for dc6977b
1 file changed
dd.sql
@@ -5,6 +5,16 @@
5
--
6
-- fmsg-webapi assumes fmsgd is the fmsg host implementation and uses the same
7
-- PostgreSQL database.
8
+--
9
+-- This script is IDEMPOTENT: every statement is safe to re-run (CREATE ... IF
10
+-- NOT EXISTS, ALTER TABLE ... ADD COLUMN IF NOT EXISTS, DROP CONSTRAINT IF
11
+-- EXISTS, guarded DO blocks). Migrating an existing database is therefore
12
+-- just re-running the whole script, e.g.:
13
14
+-- psql -d fmsgd -v ON_ERROR_STOP=1 -f dd.sql
15
16
+-- Keep it that way: add new objects and columns only with idempotent
17
+-- statements.
18
19
CREATE TABLE IF NOT EXISTS fmsg_api_sub_account (
20
owner_addr varchar(255) NOT NULL,
0 commit comments