aliens localhost Documents MyPython Django marks python manage py sqla

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
aliens@localhost ~/Documents/MyPython/Django/marks $ python manage.py sqlall main
BEGIN;
CREATE TABLE `main_mark` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`title` varchar(32) NOT NULL,
`content` longtext NOT NULL,
`author_id` integer NOT NULL,
`review` integer NOT NULL,
`public` bool NOT NULL,
`date_add` datetime NOT NULL,
`tags` varchar(255) NOT NULL
)
;
CREATE TABLE `main_author` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`login` varchar(32) NOT NULL,
`date_first_mark` datetime NOT NULL,
`mark_count` integer NOT NULL
)
;
ALTER TABLE `main_mark` ADD CONSTRAINT author_id_refs_id_119bf5fb50bb4b1 FOREIGN KEY (`author_id`) REFERENCES `main_author` (`id`);
CREATE INDEX `main_mark_author_id` ON `main_mark` (`author_id`);
COMMIT;