Created
June 29, 2013 00:40
-
-
Save clayrichardson/5889146 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Manufacturer(models.Model): | |
uuid = models.CharField(max_length = 100) | |
name = models.CharField(max_length = 100) | |
class Car(models.Model): | |
uuid = models.CharField(max_length = 100) | |
manufacturer = models.ForeignKey(Manufacturer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
CREATE TABLE "api_manufacturer" ( | |
"id" integer NOT NULL PRIMARY KEY, | |
"uuid" varchar(100) NOT NULL, | |
"name" varchar(100) NOT NULL | |
) | |
; | |
CREATE TABLE "api_car" ( | |
"id" integer NOT NULL PRIMARY KEY, | |
"uuid" varchar(100) NOT NULL, | |
"manufacturer_id" integer NOT NULL REFERENCES "api_manufacturer" ("id") | |
) | |
; | |
CREATE INDEX "api_car_773c34af" ON "api_car" ("manufacturer_id"); | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment