Skip to content
Browse files

Add django-piston schema

  • Loading branch information...
1 parent cf8e59f commit 3e4b08f01aee42ac27ca2701152178f19fe4612a @alexkay committed
Showing with 69 additions and 0 deletions.
  1. +34 −0 db/20111121.sql
  2. +34 −0 db/muspy.sql
  3. +1 −0 settings.py
View
34 db/20111121.sql
@@ -0,0 +1,34 @@
+CREATE TABLE "piston_nonce" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "token_key" varchar(18) NOT NULL,
+ "consumer_key" varchar(18) NOT NULL,
+ "key" varchar(255) NOT NULL
+);
+CREATE TABLE "piston_resource" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "name" varchar(255) NOT NULL,
+ "url" text NOT NULL,
+ "is_readonly" bool NOT NULL
+);
+CREATE TABLE "piston_consumer" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "name" varchar(255) NOT NULL,
+ "description" text NOT NULL,
+ "key" varchar(18) NOT NULL,
+ "secret" varchar(32) NOT NULL,
+ "status" varchar(16) NOT NULL,
+ "user_id" integer REFERENCES "auth_user" ("id")
+);
+CREATE TABLE "piston_token" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "key" varchar(18) NOT NULL,
+ "secret" varchar(32) NOT NULL,
+ "token_type" integer NOT NULL,
+ "timestamp" integer NOT NULL,
+ "is_approved" bool NOT NULL,
+ "user_id" integer REFERENCES "auth_user" ("id"),
+ "consumer_id" integer NOT NULL REFERENCES "piston_consumer" ("id")
+);
+CREATE INDEX "piston_consumer_user_id" ON "piston_consumer" ("user_id");
+CREATE INDEX "piston_token_user_id" ON "piston_token" ("user_id");
+CREATE INDEX "piston_token_consumer_id" ON "piston_token" ("consumer_id");
View
34 db/muspy.sql
@@ -82,6 +82,37 @@ CREATE TABLE "django_session" (
"session_data" text NOT NULL,
"expire_date" datetime NOT NULL
);
+CREATE TABLE "piston_nonce" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "token_key" varchar(18) NOT NULL,
+ "consumer_key" varchar(18) NOT NULL,
+ "key" varchar(255) NOT NULL
+);
+CREATE TABLE "piston_resource" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "name" varchar(255) NOT NULL,
+ "url" text NOT NULL,
+ "is_readonly" bool NOT NULL
+);
+CREATE TABLE "piston_consumer" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "name" varchar(255) NOT NULL,
+ "description" text NOT NULL,
+ "key" varchar(18) NOT NULL,
+ "secret" varchar(32) NOT NULL,
+ "status" varchar(16) NOT NULL,
+ "user_id" integer REFERENCES "auth_user" ("id")
+);
+CREATE TABLE "piston_token" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "key" varchar(18) NOT NULL,
+ "secret" varchar(32) NOT NULL,
+ "token_type" integer NOT NULL,
+ "timestamp" integer NOT NULL,
+ "is_approved" bool NOT NULL,
+ "user_id" integer REFERENCES "auth_user" ("id"),
+ "consumer_id" integer NOT NULL REFERENCES "piston_consumer" ("id")
+);
CREATE INDEX "app_artist_sort_name" ON "app_artist" ("sort_name");
CREATE INDEX "app_job_user_id" ON "app_job" ("user_id");
CREATE INDEX "app_notification_release_group_id" ON "app_notification" ("release_group_id");
@@ -98,3 +129,6 @@ CREATE INDEX "app_userprofile_legacy_id" ON "app_userprofile" ("legacy_id");
CREATE INDEX "app_userprofile_reset_code" ON "app_userprofile" ("reset_code");
CREATE INDEX "app_usersearch_user_id" ON "app_usersearch" ("user_id");
CREATE INDEX "django_session_expire_date" ON "django_session" ("expire_date");
+CREATE INDEX "piston_consumer_user_id" ON "piston_consumer" ("user_id");
+CREATE INDEX "piston_token_user_id" ON "piston_token" ("user_id");
+CREATE INDEX "piston_token_consumer_id" ON "piston_token" ("consumer_id");
View
1 settings.py
@@ -69,6 +69,7 @@
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
+ 'piston',
'app',
)

0 comments on commit 3e4b08f

Please sign in to comment.
Something went wrong with that request. Please try again.