#21: Tables created

Sorted out the migratus stuff so that it actually works, and added a bit to README to say how to get the database initialised; added a new migration to add the roles and teams table.
This commit is contained in:
simon 2017-03-15 20:13:22 +00:00
parent 3850753743
commit d83a7924e2
6 changed files with 574 additions and 158 deletions

View file

@ -22,7 +22,7 @@ I've put a [dummy site](http://www.journeyman.cc/~simon/tmp/yyy-dummy/index.html
## Prerequisites ## Prerequisites
You will need [Leiningen][1] 2.0 or above installed. The database required must be [Postgres][2]. You will need [Leiningen][1] 2.0 or above installed. The database required must be [Postgres][2] 9.3 or above.
[1]: https://github.com/technomancy/leiningen [1]: https://github.com/technomancy/leiningen
[2]: https://www.postgresql.org/ [2]: https://www.postgresql.org/
@ -38,12 +38,27 @@ You'll also need to create your own local copy of *profiles.clj*, which should c
Where *username* is the username required to access the database, and *thisisnotsecure* is the password which authenticates that username. Where *username* is the username required to access the database, and *thisisnotsecure* is the password which authenticates that username.
It will be helpful for you to have the [Zenhub](https://www.zenhub.com/) plugin in your browser, either Firefox or Chrome, as I'm using it for project planning.
## Further Reading ## Further Reading
If you're thinking of joining in development on this I'd strongly recommend you get hold of a copy of [Dmitry Sotnikov](https://github.com/yogthos)'s [Web Development with Clojure, Second Edition](https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition). If you're thinking of joining in development on this I'd strongly recommend you get hold of a copy of [Dmitry Sotnikov](https://github.com/yogthos)'s [Web Development with Clojure, Second Edition](https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition).
You should also read the [User-Oriented Specification](doc/specification/userspec.md) and any other documentation which appears under the *doc/specification* hierarchy. You should also read the [User-Oriented Specification](doc/specification/userspec.md) and any other documentation which appears under the *doc/specification* hierarchy.
## Getting the database up
Do get the database initialised, run
createdb youyesyet_dev
followed by
lein migratus migrate
**NOTE THAT** in the namespace *youyesyet.db.schema*, there are a series of functions *create-xxx-table!*. These are a snare and a delusion; they are how I originally bootstrapped the database, but are no longer used (and should probably be deleted). The database is now constructed using [migratus](https://github.com/yogthos/migratus).
## Running ## Running
To start a web server for the application, run: To start a web server for the application, run:

View file

@ -25,16 +25,16 @@
borderopacity="1.0" borderopacity="1.0"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="0.98994949" inkscape:zoom="1.979899"
inkscape:cx="473.75864" inkscape:cx="833.70674"
inkscape:cy="409.50744" inkscape:cy="324.89697"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="true" showgrid="true"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:window-height="996" inkscape:window-height="1058"
inkscape:window-x="0" inkscape:window-x="1920"
inkscape:window-y="28" inkscape:window-y="0"
inkscape:window-maximized="1"> inkscape:window-maximized="1">
<inkscape:grid <inkscape:grid
type="xygrid" type="xygrid"
@ -48,7 +48,7 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title> <dc:title />
</cc:Work> </cc:Work>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
@ -57,6 +57,13 @@
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer1" id="layer1"
transform="translate(0,-308.26772)"> transform="translate(0,-308.26772)">
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#060000;stroke-width:1.324;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.51906158"
id="rect4428"
width="1030"
height="730"
x="232.23355"
y="376.0018" />
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
@ -166,7 +173,7 @@
height="100" height="100"
x="20" x="20"
y="174.09448" /></flowRegion><flowPara y="174.09448" /></flowRegion><flowPara
id="flowPara4176"></flowPara></flowRoot> <rect id="flowPara4176" /></flowRoot> <rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4178" id="rect4178"
width="100" width="100"
@ -372,23 +379,26 @@
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g> </g>
<g <g
id="g4264" id="g4369">
transform="translate(170.18532,391.93918)"> <g
transform="translate(170.18532,391.93918)"
id="g4264">
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0"
d="m 100,442.3622 0,60"
id="path4266" id="path4266"
inkscape:connector-curvature="0" /> d="m 100,442.3622 0,60"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0"
d="m 90,452.3622 20,0"
id="path4268" id="path4268"
inkscape:connector-curvature="0" /> d="m 90,452.3622 20,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0"
d="m 90,502.3622 10,-10 10,10"
id="path4270" id="path4270"
inkscape:connector-curvature="0" /> d="m 90,502.3622 10,-10 10,10"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g> </g>
<g <g
id="g4278" id="g4278"
@ -410,23 +420,26 @@
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g> </g>
<g <g
id="g4283" id="g4402">
transform="translate(169.17517,152.53303)"> <g
transform="translate(169.17517,152.53303)"
id="g4283">
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0"
d="m 150,532.3622 70,0"
id="path4285" id="path4285"
inkscape:connector-curvature="0" /> d="m 150,532.3622 70,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0"
d="m 160,522.3622 0,20 0,0 0,0 0,0"
id="path4287" id="path4287"
inkscape:connector-curvature="0" /> d="m 160,522.3622 0,20 0,0 0,0 0,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0"
d="m 220,522.3622 -10,10 10,10"
id="path4289" id="path4289"
inkscape:connector-curvature="0" /> d="m 220,522.3622 -10,10 10,10"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g> </g>
<g <g
transform="translate(339.89095,152.53303)" transform="translate(339.89095,152.53303)"
@ -504,59 +517,38 @@
d="m 90,502.3622 10,-10 10,10" d="m 90,502.3622 10,-10 10,10"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g> </g>
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4323"
width="100"
height="60"
x="560.60675"
y="653.08313" />
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="570.60675"
y="683.08313"
id="text4325"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4327"
x="570.60675"
y="683.08313"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;font-family:Arial;-inkscape-font-specification:Arial">Option</tspan></text>
<g <g
transform="matrix(-1,0,0,1,709.23435,152.53303)" id="g4356"
id="g4329"> transform="translate(-170.71578,120.20815)">
<path <rect
inkscape:connector-curvature="0" y="653.08313"
id="path4331" x="560.60675"
d="m 150,532.3622 70,0" height="60"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> width="100"
<path id="rect4323"
inkscape:connector-curvature="0" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
id="path4333" <text
d="m 160,522.3622 0,20 0,0 0,0 0,0" sodipodi:linespacing="125%"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> id="text4325"
<path y="683.08313"
inkscape:connector-curvature="0" x="570.60675"
id="path4335" style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 220,522.3622 -10,10 10,10" xml:space="preserve"><tspan
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;font-family:Arial;-inkscape-font-specification:Arial"
y="683.08313"
x="570.60675"
id="tspan4327"
sodipodi:role="line">Option</tspan></text>
</g> </g>
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 490.18532,561.65662 200,0 0,110 40,0" d="m 470.48735,533.37235 -0.005,-30.30458 219.70308,0 0,159.4362 42.32143,0"
id="path4337" id="path4337"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" /> sodipodi:nodetypes="ccccc" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 720.18532,661.65662 0,20" d="m 460.43658,533.32159 10,-10 10,10"
id="path4339"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 490.18532,551.65662 10,10 -10,10"
id="path4341" id="path4341"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" /> sodipodi:nodetypes="ccc" />
@ -580,7 +572,7 @@
sodipodi:nodetypes="cccc" /> sodipodi:nodetypes="cccc" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 320,791.65662 120,0 0,130 290,0" d="m 320,791.65662 30.09642,0 0,130 379.90358,0"
id="path4349" id="path4349"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" /> sodipodi:nodetypes="cccc" />
@ -598,16 +590,10 @@
sodipodi:nodetypes="ccc" /> sodipodi:nodetypes="ccc" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 270,961.65662 0,49.99998 620,0.1015 0,-330.10148 -60,0" d="m 270,961.65662 0,49.99998 590.70558,0.1015 1.01015,-269.49233 -42.12183,1.01016 0.30457,-31.31473"
id="path4355" id="path4355"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" /> sodipodi:nodetypes="cccccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 840,671.65662 0,20"
id="path4357"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 260,961.65662 10,10 10,-10" d="m 260,961.65662 10,10 10,-10"
@ -627,14 +613,14 @@
y="394.48404" y="394.48404"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;font-family:Arial;-inkscape-font-specification:Arial"><tspan style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;font-family:Arial;-inkscape-font-specification:Arial"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:'Arial Bold'" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:'Arial Bold'"
id="tspan4371">Version: </tspan>0.1</tspan><tspan id="tspan4371">Version: </tspan>0.2</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
x="472.0152" x="472.0152"
y="413.23404" y="413.23404"
id="tspan4365" id="tspan4365"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;font-family:Arial;-inkscape-font-specification:Arial"><tspan style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;font-family:Arial;-inkscape-font-specification:Arial"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:'Arial Bold'" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:'Arial Bold'"
id="tspan4373">Date: </tspan>20161014</tspan><tspan id="tspan4373">Date: </tspan>20170315</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
x="472.0152" x="472.0152"
y="431.98404" y="431.98404"
@ -651,12 +637,13 @@
id="tspan4377">Copyright:</tspan> (c) 2016 Simon Brooke for Radical Independence Campaign</tspan></text> id="tspan4377">Copyright:</tspan> (c) 2016 Simon Brooke for Radical Independence Campaign</tspan></text>
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 730,692.3622 -40,0 0,60 60,0 0,-40" d="m 731.60714,702.69832 -41.60714,0 0,49.66388 60,0 0,-40"
id="path4379" id="path4379"
inkscape:connector-curvature="0" /> inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 720,682.3622 0,20" d="m 720,692.46373 0,20"
id="path4381" id="path4381"
inkscape:connector-curvature="0" /> inkscape:connector-curvature="0" />
<path <path
@ -680,14 +667,14 @@
xml:space="preserve" xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="530" x="530"
y="552.36218" y="498.31903"
id="text4389" id="text4389"
sodipodi:linespacing="125%"><tspan sodipodi:linespacing="125%"><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan4391" id="tspan4391"
x="530" x="530"
y="552.36218" y="498.31903"
style="-inkscape-font-specification:'Arial, Normal';font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:10px;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%">Visited</tspan></text> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start">Visited</tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;text-anchor:start;text-align:start;writing-mode:lr;" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;text-anchor:start;text-align:start;writing-mode:lr;"
@ -820,18 +807,6 @@
x="280" x="280"
y="742.36218" y="742.36218"
style="-inkscape-font-specification:'Arial, Normal';font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:10px;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%">Requested</tspan></text> style="-inkscape-font-specification:'Arial, Normal';font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:10px;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%">Requested</tspan></text>
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="510"
y="702.36218"
id="text4437"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4439"
x="510"
y="702.36218"
style="-inkscape-font-specification:'Arial, Normal';font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:10px;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%">For</tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@ -856,5 +831,333 @@
x="340" x="340"
y="552.36218" y="552.36218"
style="-inkscape-font-specification:'Arial, Normal';font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:10px;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%">To</tspan></text> style="-inkscape-font-specification:'Arial, Normal';font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:10px;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%">To</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 810,722.36221 20,0"
id="path4281"
inkscape:connector-curvature="0" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4283"
width="100"
height="60"
x="902.03827"
y="653.08313" />
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="908.88831"
y="682.36218"
id="text4285"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4287"
x="908.88831"
y="682.36218"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:Arial;text-align:start;writing-mode:lr-tb;text-anchor:start">Team</tspan></text>
<rect
y="533.88513"
x="902.03827"
height="60"
width="100"
id="rect4298"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4300"
width="100"
height="60"
x="902.03827"
y="773.29126" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:Arial;-inkscape-font-specification:Arial;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
x="920"
y="562.36218"
id="text4302"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4304"
x="920"
y="562.36218" /></text>
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:15px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="908.88831"
y="802.36218"
id="text4306"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4308"
x="908.88831"
y="802.36218"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">Organiser-</tspan><tspan
sodipodi:role="line"
x="908.88831"
y="821.11218"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
id="tspan4310">ship</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="908.88831"
y="562.36218"
id="text4312"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4314"
x="908.88831"
y="562.36218">Team</tspan><tspan
sodipodi:role="line"
x="908.88831"
y="581.11218"
id="tspan4385">Membership</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 830,672.36221 40,0 0,-110 30,0"
id="path4316"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 830,692.36221 40,0 0,110 30,0"
id="path4318"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 950,592.36221 0,60"
id="path4320"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 950,712.36221 0,60"
id="path4322"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 840,662.36221 0,40"
id="path4324"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 940,642.36221 20,0"
id="path4328"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 940,722.36221 20,0"
id="path4330"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 940,772.36221 10,-10 10,10"
id="path4334"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 940,592.36221 10,10 10,-10"
id="path4336"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 900,552.36221 -10,10 10,10"
id="path4338"
inkscape:connector-curvature="0" />
<text
sodipodi:linespacing="125%"
id="text4340"
y="743.37231"
x="879.90356"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start"
y="743.37231"
x="879.90356"
id="tspan4342"
sodipodi:role="line">Has</tspan></text>
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:20px;line-height:125%;font-family:'URW Chancery L';-inkscape-font-specification:'URW Chancery L Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="879.90356"
y="621.14386"
id="text4344"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4346"
x="879.90356"
y="621.14386"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start">Has</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="960"
y="622.36218"
id="text4348"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4350"
x="960"
y="622.36218"
style="font-size:10px">of</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="960"
y="742.36218"
id="text4352"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4354"
x="960"
y="742.36218"
style="font-size:10px">of</tspan></text>
<g
id="g4375"
transform="matrix(1,0,0,-1,171.72593,1606.7279)">
<g
id="g4377"
transform="translate(170.18532,391.93918)">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 100,442.3622 0,60"
id="path4380"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 90,452.3622 20,0"
id="path4382"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 90,502.3622 10,-10 10,10"
id="path4384"
inkscape:connector-curvature="0" />
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="450"
y="742.36218"
id="text4386"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4388"
x="450"
y="742.36218"
style="font-size:10px">For</tspan></text>
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4390"
width="100"
height="60"
x="561.61688"
y="653.08313" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="570"
y="682.36218"
id="text4394"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4396"
x="570"
y="682.36218">Role</tspan><tspan
sodipodi:role="line"
x="570"
y="701.11218"
id="tspan4383">Membership</tspan></text>
<g
id="g4354"
transform="translate(0,-241.93154)">
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4392"
width="100"
height="60"
x="561.61688"
y="774.30139" />
<text
sodipodi:linespacing="125%"
id="text4398"
y="802.36218"
x="570"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="802.36218"
x="570"
id="tspan4400"
sodipodi:role="line">Role</tspan></text>
</g>
<g
id="g4338">
<path
inkscape:connector-curvature="0"
id="path4412"
d="m 731.79186,682.5738 -70,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4414"
d="m 719.82757,672.5738 0,20 0,0 0,0 0,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4416"
d="m 661.79186,672.5738 10,10 -10,10"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<path
inkscape:connector-curvature="0"
id="path4344"
d="m 720,652.46373 0,20"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="690"
y="677.36218"
id="text4346"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4348"
x="690"
y="677.36218"
style="font-size:10px">Is</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="619.09393"
y="631.24536"
id="text4350"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4352"
x="619.09393"
y="631.24536"
style="font-size:10px">Includes</tspan></text>
<g
id="g4359"
transform="translate(341.43156,-241.93151)">
<g
id="g4361"
transform="translate(170.18532,391.93918)">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 100,442.3622 0,60"
id="path4363"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 90,452.3622 20,0"
id="path4365"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 90,502.3622 10,-10 10,10"
id="path4367"
inkscape:connector-curvature="0" />
</g>
</g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View file

@ -68,7 +68,7 @@ SET default_with_oids = false;
-- Name: addresses; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: addresses; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE addresses ( CREATE TABLE IF NOT EXISTS addresses (
id integer NOT NULL, id integer NOT NULL,
address character varying(256) NOT NULL, address character varying(256) NOT NULL,
postcode character varying(16), postcode character varying(16),
@ -106,7 +106,7 @@ ALTER SEQUENCE addresses_id_seq OWNED BY addresses.id;
-- Name: authorities; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: authorities; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE authorities ( CREATE TABLE IF NOT EXISTS authorities (
id character varying(32) NOT NULL id character varying(32) NOT NULL
); );
--;; --;;
@ -117,8 +117,9 @@ ALTER TABLE public.authorities OWNER TO youyesyet;
-- Name: canvassers; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: canvassers; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE canvassers ( CREATE TABLE IF NOT EXISTS canvassers (
id character varying(32) NOT NULL, id serial,
username character varying(32) NOT NULL,
fullname character varying(64) NOT NULL, fullname character varying(64) NOT NULL,
elector_id integer, elector_id integer,
address_id integer NOT NULL, address_id integer NOT NULL,
@ -135,7 +136,7 @@ ALTER TABLE public.canvassers OWNER TO youyesyet;
-- Name: districts; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: districts; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE districts ( CREATE TABLE IF NOT EXISTS districts (
id integer NOT NULL, id integer NOT NULL,
name character varying(64) NOT NULL name character varying(64) NOT NULL
); );
@ -147,7 +148,7 @@ ALTER TABLE public.districts OWNER TO youyesyet;
-- Name: electors; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: electors; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE electors ( CREATE TABLE IF NOT EXISTS electors (
id integer NOT NULL, id integer NOT NULL,
name character varying(64) NOT NULL, name character varying(64) NOT NULL,
address_id integer NOT NULL, address_id integer NOT NULL,
@ -162,10 +163,10 @@ ALTER TABLE public.electors OWNER TO youyesyet;
-- Name: followupactions; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: followupactions; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE followupactions ( CREATE TABLE IF NOT EXISTS followupactions (
id integer NOT NULL, id integer NOT NULL,
request_id integer NOT NULL, request_id integer NOT NULL,
actor character varying(32) NOT NULL, actor integer NOT NULL,
date timestamp with time zone DEFAULT now() NOT NULL, date timestamp with time zone DEFAULT now() NOT NULL,
notes text, notes text,
closed boolean closed boolean
@ -199,7 +200,7 @@ ALTER SEQUENCE followupactions_id_seq OWNED BY followupactions.id;
-- Name: followupmethods; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: followupmethods; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE followupmethods ( CREATE TABLE IF NOT EXISTS followupmethods (
id character varying(32) NOT NULL id character varying(32) NOT NULL
); );
--;; --;;
@ -218,7 +219,7 @@ insert into followupmethods values ('Post');
--;; --;;
CREATE TABLE followuprequests ( CREATE TABLE IF NOT EXISTS followuprequests (
id integer NOT NULL, id integer NOT NULL,
elector_id integer NOT NULL, elector_id integer NOT NULL,
visit_id integer NOT NULL, visit_id integer NOT NULL,
@ -258,8 +259,8 @@ ALTER SEQUENCE followuprequests_id_seq OWNED BY followuprequests.id;
-- Name: issueexpertise; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: issueexpertise; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE issueexpertise ( CREATE TABLE IF NOT EXISTS issueexpertise (
canvasser_id character varying(32) NOT NULL, canvasser_id integer NOT NULL,
issue_id character varying(32) NOT NULL, issue_id character varying(32) NOT NULL,
method_id character varying(32) NOT NULL method_id character varying(32) NOT NULL
); );
@ -273,7 +274,7 @@ ALTER TABLE public.issueexpertise OWNER TO youyesyet;
-- Name: issues; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: issues; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE issues ( CREATE TABLE IF NOT EXISTS issues (
id character varying(32) NOT NULL, id character varying(32) NOT NULL,
url character varying(256) url character varying(256)
); );
@ -287,7 +288,7 @@ ALTER TABLE public.issues OWNER TO youyesyet;
-- Name: options; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: options; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE options ( CREATE TABLE IF NOT EXISTS options (
id character varying(32) NOT NULL id character varying(32) NOT NULL
); );
--;; --;;
@ -300,7 +301,7 @@ ALTER TABLE public.options OWNER TO youyesyet;
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE schema_migrations ( CREATE TABLE IF NOT EXISTS schema_migrations (
id bigint NOT NULL id bigint NOT NULL
); );
--;; --;;
@ -313,10 +314,10 @@ ALTER TABLE public.schema_migrations OWNER TO youyesyet;
-- Name: visits; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- Name: visits; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
-- --
CREATE TABLE visits ( CREATE TABLE IF NOT EXISTS visits (
id integer NOT NULL, id integer NOT NULL,
address_id integer NOT NULL, address_id integer NOT NULL,
canvasser_id character varying(32) NOT NULL, canvasser_id integer NOT NULL,
date timestamp with time zone DEFAULT now() NOT NULL date timestamp with time zone DEFAULT now() NOT NULL
); );
--;; --;;
@ -484,8 +485,8 @@ ALTER TABLE ONLY options
-- Name: schema_migrations_id_key; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace: -- Name: schema_migrations_id_key; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
-- --
ALTER TABLE ONLY schema_migrations --ALTER TABLE ONLY schema_migrations
ADD CONSTRAINT schema_migrations_id_key UNIQUE (id); -- ADD CONSTRAINT schema_migrations_id_key UNIQUE (id);
--;; --;;

View file

@ -0,0 +1,11 @@
drop table teammemberships;
drop index ix_teams_name;
drop table teams;
drop table rolememberships;
drop index ix_roles_name;
drop table roles;

View file

@ -0,0 +1,35 @@
create table if not exists roles (
id serial primary key,
name varchar(64) not null
);
create unique index ix_roles_name on roles(name);
create table if not exists rolememberships (
role_id integer not null references roles(id),
canvasser_id integer not null references canvassers(id)
);
create table if not exists teams (
id serial primary key,
name varchar(64) not null,
district_id integer not null references districts(id),
latitude real,
longitude real
);
create unique index ix_teams_name on teams(name);
create table if not exists teammemberships (
team_id integer not null references teams(id),
canvasser_id integer not null references canvassers(id)
);
alter table roles owner to youyesyet;
alter table rolememberships owner to youyesyet;
alter table teams owner to youyesyet;
alter table teammemberships owner to youyesyet;

View file

@ -34,26 +34,6 @@
;;; redundant, and if they are the namespace probably needs to be renamed to 'entities'. ;;; redundant, and if they are the namespace probably needs to be renamed to 'entities'.
;;; See also resources/migrations/20161014170335-basic-setup.up.sql ;;; See also resources/migrations/20161014170335-basic-setup.up.sql
(defn create-districts-table!
"Create a table to hold the electoral districts in which electors are registered.
Note that, as this app is being developed for the independence referendum in which
polling is across the whole of Scotland, this part of the design isn't fully thought
through; if later adapted to general or local elections, some breakdown or hierarchy
of polling districts into constituencies will be required."
[]
(sql/db-do-commands
yyydb/*db*
(sql/create-table-ddl
:districts
;; it may be necessary to have a serial abstract primary key but I suspect
;; polling districts already have numbers assigned by the Electoral Commission and
;; it would be sensible to use those. TODO: check.
[:id "integer not null primary key"]
[:name "varchar(64) not null"]
;; TODO: it would make sense to hold polygon data for polling districts so we can reflect
;; them on the map, but I haven't thought through how to do that yet.
)))
(kc/defentity district (kc/defentity district
(kc/pk :id) (kc/pk :id)
@ -186,7 +166,7 @@
(kc/entity-fields :id :fullname :phone :email :is_admin :authorised) (kc/entity-fields :id :fullname :phone :email :is_admin :authorised)
(kc/has-one elector) (kc/has-one elector)
(kc/has-one address) (kc/has-one address)
(kc/has-one canvasser {:fk :introduced_by}) ;; (kc/has-one canvasser {:fk :introduced_by})
(kc/has-one authority)) (kc/has-one authority))
@ -395,6 +375,73 @@
(kc/has-one canvasser {:fk :actor})) (kc/has-one canvasser {:fk :actor}))
(defn create-role-table!
"Create a table to record roles. I'm not even yet certain that this is strictly necessary,
but it allows us to record the fact that different users (canvassers) have different roles
in the system."
[]
(sql/db-do-commands
yyydb/*db*
(sql/create-table-ddl
:roles
[:id "serial primary key"]
[:name "varchar(64) not null"])))
(defn create-role-membership-table!
"Create a link table to record membership of roles."
[]
(sql/db-do-commands
yyydb/*db*
(sql/create-table-ddl
:rolememberships
[:role_id "integer not null references role(id)"]
[:canvasser_id "integer not null references canvasser(id)"])))
(kc/defentity role
(kc/table :roles)
(kc/database yyydb/*db*)
(kc/entity-fields :id :name)
(kc/many-to-many canvasser :rolememberships))
(defn create-team-table!
"Create a table to record teams."
[]
(sql/db-do-commands
yyydb/*db*
(sql/create-table-ddl
:teams
[:id "serial primary key"]
[:name "varchar(64) not null"]
;; the electoral district within which this address exists
[:district_id "integer references districts(id)"]
;; nominal home location of this team
[:latitude :real]
[:longitude :real])))
(defn create-team-membership-table!
"Create a link table to record membership of team."
[]
(sql/db-do-commands
yyydb/*db*
(sql/create-table-ddl
:teammemberships
[:team_id "integer not null references team(id)"]
[:canvasser_id "integer not null references canvasser(id)"])))
(kc/defentity team
(kc/table :teams)
(kc/database yyydb/*db*)
(kc/entity-fields :id :name :latitude :longitude)
(kc/has-one district)
(kc/many-to-many canvasser :teammemberships))
(defn init-db! [] (defn init-db! []
"Initialised the whole database." "Initialised the whole database."
(create-districts-table!) (create-districts-table!)
@ -409,4 +456,8 @@
(create-issue-expertise-table!) (create-issue-expertise-table!)
(create-followup-requests-table!) (create-followup-requests-table!)
(create-followup-actions-table!) (create-followup-actions-table!)
(create-role-table!)
(create-role-membership-table!)
(create-team-table!)
(create-team-membership-table!)
) )