Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes Vagrant, which previously required a checkout of the last valid version of `etc/schema.sql`. Django now drives table creation and we fix it up for Flourish afterwards. As we have `USE_TZ = True`, Django will create DateTime columns as `timestamp with time zone`. We just need to make sure we only use UTC until all Flourish code is removed.
- Loading branch information
1 parent
c120da2
commit 6f3acf4
Showing
11 changed files
with
267 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
begin; | ||
|
||
create table flourish_tables ( | ||
tablename name | ||
); | ||
insert into flourish_tables select tablename from pg_tables where tableowner = 'hackspace' order by tablename; | ||
|
||
copy flourish_tables (tablename) from stdin; | ||
aliases | ||
cards | ||
interests | ||
interests_categories | ||
learnings | ||
locations | ||
meeting_attendees | ||
password_resets | ||
perms | ||
project_states | ||
projects | ||
projects_logs | ||
proxy_votes | ||
subscriptions | ||
transactions | ||
userperms | ||
users | ||
users_aliases | ||
users_interests | ||
users_learnings | ||
users_profiles | ||
\. | ||
|
||
commit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- Restores defaults on columns for Flourish | ||
-- Django migrations can force defaults to be removed. | ||
-- This should be safe to run at any time to clean up. | ||
|
||
begin; | ||
|
||
alter table "users" | ||
alter subscribed set default false, | ||
alter hackney set default false, | ||
alter subscription_period set default 0, | ||
alter terminated set default false, | ||
alter admin set default false, | ||
alter has_profile set default false, | ||
alter disabled_profile set default false | ||
; | ||
|
||
alter table cards | ||
alter active set default true | ||
; | ||
|
||
alter table users_profiles | ||
alter allow_email set default false, | ||
alter allow_doorbot set default false | ||
; | ||
|
||
alter table aliases | ||
alter type set default 2 | ||
; | ||
|
||
alter table interests | ||
alter suggested set default false | ||
; | ||
|
||
commit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Restores multi-column primary keys for Flourish | ||
-- Django doesn't understand multi-column primary keys yet. | ||
-- This should only need to be run after initial migration. | ||
|
||
begin; | ||
|
||
alter table users_learnings drop column if exists id; | ||
alter table users_learnings add primary key (user_id, learning_id); | ||
|
||
alter table users_aliases drop column if exists id; | ||
alter table users_aliases add primary key (user_id, alias_id); | ||
|
||
alter table users_interests drop column if exists id; | ||
alter table users_interests add primary key (user_id, interest_id); | ||
|
||
commit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
- model: main.alias | ||
pk: Callsign | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Ello | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Facebook | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Flickr | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: GitHub | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Google+ | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Hackspace Wiki | ||
fields: {type: 1} | ||
- model: main.alias | ||
pk: IRC | ||
fields: {type: 1} | ||
- model: main.alias | ||
pk: LinkedIn | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Minecraft | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: RSS | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: Twitter | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: XMPP/Jabber | ||
fields: {type: 2} | ||
- model: main.alias | ||
pk: YouTube | ||
fields: {type: 2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
- model: main.interest | ||
pk: 1 | ||
fields: {category: Computing, suggested: true, name: Robotics, url: 'https://wiki.london.hackspace.org.uk/view/Robotics'} | ||
- model: main.interest | ||
pk: 2 | ||
fields: {category: Computing, suggested: true, name: Arduino, url: 'https://wiki.london.hackspace.org.uk/view/Not_Just_Arduino'} | ||
- model: main.interest | ||
pk: 3 | ||
fields: {category: Computing, suggested: true, name: Raspberry Pi, url: 'https://wiki.london.hackspace.org.uk/view/Not_Just_Arduino'} | ||
- model: main.interest | ||
pk: 4 | ||
fields: {category: Computing, suggested: true, name: Soldering, url: 'https://wiki.london.hackspace.org.uk/view/Electronics_Area'} | ||
- model: main.interest | ||
pk: 5 | ||
fields: {category: Computing, suggested: true, name: Hardware, url: 'https://wiki.london.hackspace.org.uk/view/Not_Just_Arduino'} | ||
- model: main.interest | ||
pk: 6 | ||
fields: {category: Computing, suggested: true, name: Software, url: 'https://wiki.london.hackspace.org.uk/w/index.php?title=Special%3ASearch&search=software'} | ||
- model: main.interest | ||
pk: 7 | ||
fields: {category: Computing, suggested: true, name: Programming, url: 'https://wiki.london.hackspace.org.uk/w/index.php?title=Special%3ASearch&search=programming&go=Go'} | ||
- model: main.interest | ||
pk: 8 | ||
fields: {category: Fabrication, suggested: true, name: 3D printing, url: 'https://wiki.london.hackspace.org.uk/view/Equipment/Lulzbot_a0_101'} | ||
- model: main.interest | ||
pk: 9 | ||
fields: {category: Fabrication, suggested: true, name: Laser cutting, url: 'https://wiki.london.hackspace.org.uk/view/Laser_Cutter'} | ||
- model: main.interest | ||
pk: 10 | ||
fields: {category: Fabrication, suggested: true, name: CNC routing, url: 'https://wiki.london.hackspace.org.uk/view/Pledge:_CNC_Mill'} | ||
- model: main.interest | ||
pk: 11 | ||
fields: {category: Fabrication, suggested: true, name: Woodworking, url: 'https://wiki.london.hackspace.org.uk/view/Dusty_Wood_Shop'} | ||
- model: main.interest | ||
pk: 12 | ||
fields: {category: Fabrication, suggested: true, name: Metalworking, url: 'https://wiki.london.hackspace.org.uk/view/Dirty_Metal_Shop'} | ||
- model: main.interest | ||
pk: 13 | ||
fields: {category: Fabrication, suggested: true, name: Welding, url: 'https://wiki.london.hackspace.org.uk/view/Welding_Training'} | ||
- model: main.interest | ||
pk: 14 | ||
fields: {category: Crafts, suggested: true, name: Sewing, url: 'https://wiki.london.hackspace.org.uk/view/Sewing_Machines'} | ||
- model: main.interest | ||
pk: 15 | ||
fields: {category: Crafts, suggested: true, name: Knitting, url: 'https://wiki.london.hackspace.org.uk/view/Equipment/Knitting_Machine'} | ||
- model: main.interest | ||
pk: 16 | ||
fields: {category: Crafts, suggested: true, name: Painting, url: 'https://wiki.london.hackspace.org.uk/view/Hackspace_Art'} | ||
- model: main.interest | ||
pk: 17 | ||
fields: {category: Crafts, suggested: true, name: Sculpting, url: 'https://wiki.london.hackspace.org.uk/view/Hackspace_Art'} | ||
- model: main.interest | ||
pk: 18 | ||
fields: {category: Crafts, suggested: true, name: Vinyl cutting, url: 'https://wiki.london.hackspace.org.uk/view/Vinyl_cutter'} | ||
- model: main.interest | ||
pk: 19 | ||
fields: {category: Special interests, suggested: true, name: Amateur radio, url: 'https://wiki.london.hackspace.org.uk/view/Amateur_Radio'} | ||
- model: main.interest | ||
pk: 20 | ||
fields: {category: Special interests, suggested: true, name: Lock picking, url: 'https://wiki.london.hackspace.org.uk/view/Project:Lockpicking'} | ||
- model: main.interest | ||
pk: 21 | ||
fields: {category: Special interests, suggested: true, name: Music hacking, url: 'https://wiki.london.hackspace.org.uk/view/Music_Hack_Space'} | ||
- model: main.interest | ||
pk: 22 | ||
fields: {category: Special interests, suggested: true, name: Photography, url: 'https://wiki.london.hackspace.org.uk/view/Project:Darkroom'} | ||
- model: main.interest | ||
pk: 23 | ||
fields: {category: Special interests, suggested: true, name: Biohacking, url: 'https://wiki.london.hackspace.org.uk/view/Biohacking'} | ||
- model: main.interest | ||
pk: 24 | ||
fields: {category: Special interests, suggested: true, name: LAN gaming, url: 'https://wiki.london.hackspace.org.uk/view/London_FRAGspace'} | ||
- model: main.interest | ||
pk: 25 | ||
fields: {category: Special interests, suggested: true, name: PL(A)YWOOD, url: 'https://wiki.london.hackspace.org.uk/view/Playwood'} | ||
- model: main.interest | ||
pk: 26 | ||
fields: {category: Special interests, suggested: true, name: Brewing, url: 'https://wiki.london.hackspace.org.uk/view/Brewing'} | ||
- model: main.interest | ||
pk: 27 | ||
fields: {category: Special interests, suggested: true, name: Gardening, url: 'https://wiki.london.hackspace.org.uk/view/Garden'} | ||
- model: main.interest | ||
pk: 28 | ||
fields: {category: Special interests, suggested: true, name: Cycling, url: 'https://wiki.london.hackspace.org.uk/w/index.php?title=Special%3ASearch&search=cycling&go=Go'} | ||
- model: main.interest | ||
pk: 29 | ||
fields: {category: Special interests, suggested: true, name: Aerospace, url: 'https://wiki.london.hackspace.org.uk/view/LondonAerospace'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- model: main.interestcategory | ||
pk: Computing | ||
fields: {} | ||
- model: main.interestcategory | ||
pk: Crafts | ||
fields: {} | ||
- model: main.interestcategory | ||
pk: Fabrication | ||
fields: {} | ||
- model: main.interestcategory | ||
pk: Other | ||
fields: {} | ||
- model: main.interestcategory | ||
pk: Special interests | ||
fields: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- model: main.learning | ||
pk: 1 | ||
fields: {name: Laser cutting, description: Laser cutter trained, url: 'https://wiki.london.hackspace.org.uk/view/Lasercutter_Training'} | ||
- model: main.learning | ||
pk: 2 | ||
fields: {name: Vinyl cutting, description: Vinyl cutter trained, url: 'https://wiki.london.hackspace.org.uk/view/Equipment/VinylCutter'} | ||
- model: main.learning | ||
pk: 3 | ||
fields: {name: 3D printing, description: 3D printer trained, url: 'https://wiki.london.hackspace.org.uk/view/3dprinter_training'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- model: main.location | ||
pk: 1 | ||
fields: {name: Ground floor} | ||
- model: main.location | ||
pk: 2 | ||
fields: {name: Basement} | ||
- model: main.location | ||
pk: 3 | ||
fields: {name: Yard} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
- model: main.projectstates | ||
pk: 1 | ||
fields: {name: Pending Approval} | ||
- model: main.projectstates | ||
pk: 2 | ||
fields: {name: Approved} | ||
- model: main.projectstates | ||
pk: 3 | ||
fields: {name: Unapproved} | ||
- model: main.projectstates | ||
pk: 4 | ||
fields: {name: Extended} | ||
- model: main.projectstates | ||
pk: 5 | ||
fields: {name: Passed Deadline} | ||
- model: main.projectstates | ||
pk: 6 | ||
fields: {name: Removed} | ||
- model: main.projectstates | ||
pk: 7 | ||
fields: {name: Archived} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ Django==1.11.3 | |
psycopg2==2.7.1 | ||
requests==2.18.1 | ||
msgpack-python==0.4.8 | ||
pytz==2017.2 | ||
PyYAML==3.12 |