Skip to content

Commit

Permalink
Add DB PRAGMAs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkay committed Sep 9, 2011
1 parent 24ea0e3 commit bae1dca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Makefile
@@ -1,4 +1,8 @@
.PHONY: schema run
.PHONY: db run schema

db:
rm -f db/muspy.db
sqlite3 db/muspy.db < db/muspy.sql

run:
./manage.py runserver
Expand Down
9 changes: 8 additions & 1 deletion db/muspy.sql
@@ -1,3 +1,9 @@
PRAGMA user_version=1;

PRAGMA encoding="UTF-8";
PRAGMA foreign_keys=1;
PRAGMA journal_mode=WAL;

CREATE TABLE "auth_user" (
"id" integer NOT NULL PRIMARY KEY,
"username" varchar(30) NOT NULL UNIQUE,
Expand All @@ -11,9 +17,10 @@ CREATE TABLE "auth_user" (
"last_login" datetime NOT NULL,
"date_joined" datetime NOT NULL
);

CREATE TABLE "django_session" (
"session_key" varchar(40) NOT NULL PRIMARY KEY,
"session_data" text NOT NULL,
"expire_date" datetime NOT NULL
);
CREATE INDEX "django_session_c25c2c28" ON "django_session" ("expire_date");
CREATE INDEX "django_session_expire_date" ON "django_session" ("expire_date");

0 comments on commit bae1dca

Please sign in to comment.