Skip to content

Commit d8b5784

Browse files
committed
small improvements
1 parent 273ca1f commit d8b5784

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/fixtures/blog_sqlite.sql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DROP TABLE IF EXISTS "comments";
1717
CREATE TABLE "comments" (
1818
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
1919
"post_id" integer NOT NULL,
20-
"message" text NOT NULL,
20+
"message" varchar(255) NOT NULL,
2121
"category_id" integer NOT NULL,
2222
FOREIGN KEY ("post_id") REFERENCES "posts" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
2323
FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
@@ -36,7 +36,7 @@ CREATE TABLE "posts" (
3636
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
3737
"user_id" integer NOT NULL,
3838
"category_id" integer NOT NULL,
39-
"content" text NOT NULL,
39+
"content" varchar(255) NOT NULL,
4040
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
4141
FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
4242
);
@@ -121,7 +121,7 @@ DROP TABLE IF EXISTS "products";
121121
CREATE TABLE "products" (
122122
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
123123
"name" varchar(255) NOT NULL,
124-
"price" varchar(12) NOT NULL,
124+
"price" decimal(10,2) NOT NULL,
125125
"properties" clob NOT NULL,
126126
"created_at" datetime NOT NULL,
127127
"deleted_at" datetime NULL
@@ -136,7 +136,8 @@ CREATE TABLE "barcodes" (
136136
"product_id" integer NOT NULL,
137137
"hex" varchar(255) NOT NULL,
138138
"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
140141
);
141142

142143
INSERT INTO "barcodes" ("id", "product_id", "hex", "bin", "ip_address") VALUES (1, 1, '00ff01', 'AP8B', '127.0.0.1');

0 commit comments

Comments
 (0)