From 898e7ed11ab0958fcdaf65b99b33f7b04787630a Mon Sep 17 00:00:00 2001
From: Joris
Date: Sun, 24 Sep 2017 22:14:48 +0200
Subject: Bootstrap with GHCJS and reflex:

- setup login and logout,
- first draft of payment view.
---
 src/migrations/2.sql | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 src/migrations/2.sql

(limited to 'src/migrations/2.sql')

diff --git a/src/migrations/2.sql b/src/migrations/2.sql
new file mode 100644
index 0000000..ec0d1b0
--- /dev/null
+++ b/src/migrations/2.sql
@@ -0,0 +1,23 @@
+BEGIN TRANSACTION;
+
+ALTER TABLE payment RENAME TO tmp_payment;
+
+CREATE TABLE IF NOT EXISTS "payment"(
+  "id" INTEGER PRIMARY KEY,
+  "user" INTEGER NOT NULL REFERENCES "user",
+  "name" VARCHAR NOT NULL,
+  "cost" INTEGER NOT NULL,
+  "date" DATE NOT NULL,
+  "frequency" VARCHAR NOT NULL,
+  "created_at" TIMESTAMP NOT NULL,
+  "edited_at" TIMESTAMP NULL,
+  "deleted_at" TIMESTAMP NULL
+);
+
+INSERT INTO payment(id, user, name, cost, date, frequency, created_at, edited_at, deleted_at)
+SELECT id, user_id, name, cost, date, frequency, created_at, edited_at, deleted_at
+FROM tmp_payment;
+
+DROP TABLE tmp_payment;
+
+COMMIT;
-- 
cgit v1.2.3

