Skip to content

Commit

Permalink
Merge sql schema files
Browse files Browse the repository at this point in the history
When populating a database we'll create all tables regardless of what
is actually required for the current use case.
  • Loading branch information
Johannes Meyer committed Oct 7, 2014
1 parent d54bfdd commit efffe10
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 56 deletions.
24 changes: 0 additions & 24 deletions etc/schema/accounts.mysql.sql

This file was deleted.

14 changes: 14 additions & 0 deletions etc/schema/mysql.sql
@@ -0,0 +1,14 @@
create table account (
`username` varchar(255) COLLATE latin1_general_ci NOT NULL,
`salt` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`active` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

create table `preference`(
`username` VARCHAR(255) COLLATE latin1_general_ci NOT NULL,
`key` VARCHAR(100) COLLATE latin1_general_ci NOT NULL,
`value` VARCHAR(255) NOT NULL,
PRIMARY KEY (`username`, `key`)
) ENGINE=InnoDB;
26 changes: 10 additions & 16 deletions etc/schema/accounts.pgsql.sql → etc/schema/pgsql.sql
Expand Up @@ -10,19 +10,13 @@ ALTER TABLE ONLY "account"

CREATE UNIQUE INDEX username_lower_unique_idx ON "account" USING btree (lower((username)::text));

/*
* user: icingaadmin
* password: icinga
*/
INSERT INTO "account" (
"username",
"salt",
"password",
"active"
)
VALUES (
'icingaadmin',
'57cfd5746224be4f60c25d4e8514bec35ad2d01810723a138756b285898e71b2',
'43f8e0588eb39f1a41383b48def0b1fdc45e79b8f67194cccee4453eb3f4ea13',
true
);
create table "preference"(
"username" VARCHAR(255) NOT NULL,
"key" VARCHAR(100) NOT NULL,
"value" VARCHAR(255) NOT NULL
);

ALTER TABLE ONLY "preference"
ADD CONSTRAINT preference_pkey PRIMARY KEY ("username", "key");

CREATE UNIQUE INDEX username_and_key_lower_unique_idx ON "preference" USING btree (lower((username)::text), lower((key)::text));
6 changes: 0 additions & 6 deletions etc/schema/preferences.mysql.sql

This file was deleted.

10 changes: 0 additions & 10 deletions etc/schema/preferences.pgsql.sql

This file was deleted.

0 comments on commit efffe10

Please sign in to comment.