From 438baa868bdf5f339d516784c054c766087f907f Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 27 Jul 2020 07:25:41 +0100 Subject: type in schema --- pkg/datamaps/db.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pkg/datamaps/db.go') diff --git a/pkg/datamaps/db.go b/pkg/datamaps/db.go index 4c3605c..ad388e2 100644 --- a/pkg/datamaps/db.go +++ b/pkg/datamaps/db.go @@ -18,8 +18,11 @@ func setupDB(path string) (*sql.DB, error) { DROP TABLE IF EXISTS datamap_line; DROP TABLE IF EXISTS return; DROP TABLE IF EXISTS return_data; - CREATE TABLE datamap(id INTEGER PRIMARY KEY, name TEXT, date_created TEXT); - DROP TABLE IF EXISTS datamap_line; + + CREATE TABLE datamap( + id INTEGER PRIMARY KEY, + name TEXT, + date_created TEXT); CREATE TABLE datamap_line( id INTEGER PRIMARY KEY, @@ -31,10 +34,11 @@ func setupDB(path string) (*sql.DB, error) { REFERENCES datamap(id) ON DELETE CASCADE ); + CREATE TABLE return( id INTEGER PRIMARY KEY, name TEXT, - data_created TEXT + date_created TEXT ); CREATE TABLE return_data( id INTEGER PRIMARY KEY, -- cgit v1.2.3