Skip to content

Commit

Permalink
#37 add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
prayerslayer committed Jan 12, 2016
1 parent e0c87eb commit 5f6b635
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions resources/db/migration/V8__Require urls.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# add documentation url placeholder where necessary

UPDATE zk_data.application
SET a_scm_url = 'UNKNOWN'
WHERE a_scm_url IS NULL OR a_scm_url = '';

UPDATE zk_data.application
SET a_documentation_url = 'UNKNOWN'
WHERE a_documentation_url IS NULL OR a_scm_url = '';

UPDATE zk_data.application
SET a_specification_url = 'UNKNOWN'
WHERE a_specification_url IS NULL OR a_scm_url = '';

# make columns not null

ALTER TABLE zk_data.application
ALTER COLUMN a_scm_url SET NOT NULL,
ALTER COLUMN a_documentation_url SET NOT NULL,
ALTER COLUMN a_specification_url SET NOT NULL;

0 comments on commit 5f6b635

Please sign in to comment.