devops stuff
This commit is contained in:
parent
810845441c
commit
d68c6f1d4e
8 changed files with 69 additions and 9 deletions
16
srv/salt/postgres/init.sls
Normal file
16
srv/salt/postgres/init.sls
Normal file
|
@ -0,0 +1,16 @@
|
|||
postgresql:
|
||||
pkg.installed:
|
||||
- name: postgresql-9.3
|
||||
|
||||
|
||||
createdb:
|
||||
cmd.run:
|
||||
- name: createdb -T template1 realms
|
||||
- user: postgres
|
||||
- require:
|
||||
- pkg.installed: postgresql-9.3
|
||||
|
||||
initdb:
|
||||
cmd.run:
|
||||
- name: psql realms < /srv/salt/postgres/init.sql
|
||||
- user: postgres
|
26
srv/salt/postgres/init.sql
Normal file
26
srv/salt/postgres/init.sql
Normal file
|
@ -0,0 +1,26 @@
|
|||
DROP TABLE IF EXISTS users;
|
||||
CREATE TABLE users (
|
||||
id SERIAL,
|
||||
username VARCHAR(100),
|
||||
password VARCHAR(255),
|
||||
email VARCHAR(255),
|
||||
joined TIMESTAMP
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS sites;
|
||||
CREATE TABLE sites (
|
||||
name VARCHAR(255),
|
||||
pages INT,
|
||||
views INT,
|
||||
created TIMESTAMP
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS pages;
|
||||
CREATE TABLE pages (
|
||||
id VARCHAR(255), -- <site name>/<path>
|
||||
edits INT,
|
||||
views INT,
|
||||
author INT,
|
||||
created TIMESTAMP,
|
||||
modified TIMESTAMP
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue