- Also noted agreed standard for file naming extensions to migrations 
file
This commit is contained in:
Dominic H 2019-09-27 16:05:35 +01:00
parent b4cbe77ea2
commit 83ce6423d1
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,13 @@
-- Remove community fields
-- Ownership type, enumerate type from:
ALTER TABLE buildings DROP COLUMN IF EXISTS ownership_type;
-- Ownerhsip perception, would you describe this as a community asset?
-- Boolean yes / no
ALTER TABLE buildings DROP COLUMN IF EXISTS ownership_perception;
-- Historic ownership type / perception
-- Has this building ever been used for community or public services activities?
-- Boolean yes / no
ALTER TABLE buildings DROP COLUMN IF EXISTS ownership_historic;

View File

@ -0,0 +1,28 @@
-- Remove community fields
-- Ownership type, enumerate type from:
--
CREATE TYPE ownership_type
AS ENUM ('Private individual',
'Private company',
'Private offshore ownership',
'Publicly owned',
'Institutionally owned');
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS ownership_type ownership_type DEFAULT 'Private individual';
-- Ownerhsip perception, would you describe this as a community asset?
-- Boolean yes / no
-- Below accepts t/f, yes/no, y/n, 0/1 as valid inputs all of which
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS ownership_perception boolean DEFAULT null;
-- Historic ownership type / perception
-- Has this building ever been used for community or public services activities?
-- Boolean yes / no
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS ownership_historic boolean DEFAULT null;

View File

@ -53,3 +53,7 @@ Set or update passwords:
```bash ```bash
psql -c "ALTER USER appusername WITH PASSWORD 'longsecurerandompassword';" psql -c "ALTER USER appusername WITH PASSWORD 'longsecurerandompassword';"
``` ```
Syntax for adding to existing migration:
`0##.filename-extension-#.up.sql`