Parcourir la source

small improvements

Maurits van der Schee il y a 4 ans
Parent
révision
d8b5784016
1 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. 5
    4
      tests/fixtures/blog_sqlite.sql

+ 5
- 4
tests/fixtures/blog_sqlite.sql Voir le fichier

@@ -17,7 +17,7 @@ DROP TABLE IF EXISTS "comments";
17 17
 CREATE TABLE "comments" (
18 18
   "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
19 19
   "post_id" integer NOT NULL,
20
-  "message" text NOT NULL,
20
+  "message" varchar(255) NOT NULL,
21 21
   "category_id" integer NOT NULL,
22 22
   FOREIGN KEY ("post_id") REFERENCES "posts" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
23 23
   FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
@@ -36,7 +36,7 @@ CREATE TABLE "posts" (
36 36
   "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
37 37
   "user_id" integer NOT NULL,
38 38
   "category_id" integer NOT NULL,
39
-  "content" text NOT NULL,
39
+  "content" varchar(255) NOT NULL,
40 40
   FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
41 41
   FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
42 42
 );
@@ -121,7 +121,7 @@ DROP TABLE IF EXISTS "products";
121 121
 CREATE TABLE "products" (
122 122
   "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
123 123
   "name" varchar(255) NOT NULL,
124
-  "price" varchar(12) NOT NULL,
124
+  "price" decimal(10,2) NOT NULL,
125 125
   "properties" clob NOT NULL,
126 126
   "created_at" datetime NOT NULL,
127 127
   "deleted_at" datetime NULL
@@ -136,7 +136,8 @@ CREATE TABLE "barcodes" (
136 136
   "product_id" integer NOT NULL,
137 137
   "hex" varchar(255) NOT NULL,
138 138
   "bin" blob NOT NULL,
139
-  "ip_address" varchar(15)
139
+  "ip_address" varchar(15),
140
+  FOREIGN KEY ("product_id") REFERENCES "products" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
140 141
 );
141 142
 
142 143
 INSERT INTO "barcodes" ("id", "product_id", "hex", "bin", "ip_address") VALUES (1, 1, '00ff01', 'AP8B', '127.0.0.1');

Loading…
Annuler
Enregistrer