Skip to content

Instantly share code, notes, and snippets.

@sadaf2605
Created October 1, 2015 08:27
Show Gist options
  • Save sadaf2605/e15c3b9ef045c671a65f to your computer and use it in GitHub Desktop.
Save sadaf2605/e15c3b9ef045c671a65f to your computer and use it in GitHub Desktop.

Revisions

  1. sadaf2605 created this gist Oct 1, 2015.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    # $ python manage.py sqlall items
    BEGIN;
    CREATE TABLE "items_category" (
    "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
    "name" varchar(200) NOT NULL
    )
    ;
    CREATE TABLE "items_item" (
    "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
    "name" varchar(200) NOT NULL,
    "description" text,
    "image" varchar(100) NOT NULL,
    "category_id" integer NOT NULL REFERENCES "items_category" ("id"),
    "show_in_front_page" bool NOT NULL,
    "always_show_in_front_page" bool NOT NULL,
    "is_trending" bool NOT NULL
    )
    ;
    CREATE INDEX "items_item_6f33f001" ON "items_item" ("category_id");

    COMMIT;