Skip to content

Commit 74a0ffc

Browse files
committed
update fixtures
1 parent db4be43 commit 74a0ffc

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

tests/fixtures/blog.sqlite

-104 KB
Binary file not shown.

tests/fixtures/blog_pgsql.sql

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SET default_with_oids = false;
2121
DROP TABLE IF EXISTS categories CASCADE;
2222
DROP TABLE IF EXISTS comments CASCADE;
2323
DROP TABLE IF EXISTS post_tags CASCADE;
24-
DROP TABLE IF EXISTS posts CASCADE;
24+
DROP TABLE IF EXISTS abc_posts CASCADE;
2525
DROP TABLE IF EXISTS tags CASCADE;
2626
DROP TABLE IF EXISTS users CASCADE;
2727
DROP TABLE IF EXISTS countries CASCADE;
@@ -72,11 +72,11 @@ CREATE TABLE post_tags (
7272
-- Name: posts; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
7373
--
7474

75-
CREATE TABLE posts (
76-
id serial NOT NULL,
77-
user_id integer NOT NULL,
78-
category_id integer NOT NULL,
79-
content character varying(255) NOT NULL
75+
CREATE TABLE abc_posts (
76+
abc_id serial NOT NULL,
77+
abc_user_id integer NOT NULL,
78+
abc_category_id integer NOT NULL,
79+
abc_content character varying(255) NOT NULL
8080
);
8181

8282

@@ -213,10 +213,10 @@ INSERT INTO "post_tags" ("post_id", "tag_id") VALUES
213213
(2, 2);
214214

215215
--
216-
-- Data for Name: posts; Type: TABLE DATA; Schema: public; Owner: postgres
216+
-- Data for Name: abc_posts; Type: TABLE DATA; Schema: public; Owner: postgres
217217
--
218218

219-
INSERT INTO "posts" ("user_id", "category_id", "content") VALUES
219+
INSERT INTO "abc_posts" ("abc_user_id", "abc_category_id", "abc_content") VALUES
220220
(1, 1, 'blog started'),
221221
(1, 2, 'It works!');
222222

@@ -332,8 +332,8 @@ ALTER TABLE ONLY post_tags
332332
-- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
333333
--
334334

335-
ALTER TABLE ONLY posts
336-
ADD CONSTRAINT posts_pkey PRIMARY KEY (id);
335+
ALTER TABLE ONLY abc_posts
336+
ADD CONSTRAINT abc_posts_pkey PRIMARY KEY (abc_id);
337337

338338

339339
--
@@ -427,14 +427,14 @@ CREATE INDEX post_tags_tag_id_idx ON post_tags USING btree (tag_id);
427427
-- Name: posts_category_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
428428
--
429429

430-
CREATE INDEX posts_category_id_idx ON posts USING btree (category_id);
430+
CREATE INDEX abc_posts_category_id_idx ON abc_posts USING btree (abc_category_id);
431431

432432

433433
--
434434
-- Name: posts_user_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
435435
--
436436

437-
CREATE INDEX posts_user_id_idx ON posts USING btree (user_id);
437+
CREATE INDEX abc_posts_user_id_idx ON abc_posts USING btree (abc_user_id);
438438

439439

440440
--
@@ -470,7 +470,7 @@ CREATE INDEX "kunsthåndværk_invisible_id_idx" ON "kunsthåndværk" USING btree
470470
--
471471

472472
ALTER TABLE ONLY comments
473-
ADD CONSTRAINT comments_post_id_fkey FOREIGN KEY (post_id) REFERENCES posts(id);
473+
ADD CONSTRAINT comments_post_id_fkey FOREIGN KEY (post_id) REFERENCES abc_posts(abc_id);
474474

475475

476476
--
@@ -486,7 +486,7 @@ ALTER TABLE ONLY comments
486486
--
487487

488488
ALTER TABLE ONLY post_tags
489-
ADD CONSTRAINT post_tags_post_id_fkey FOREIGN KEY (post_id) REFERENCES posts(id);
489+
ADD CONSTRAINT post_tags_post_id_fkey FOREIGN KEY (post_id) REFERENCES abc_posts(abc_id);
490490

491491

492492
--
@@ -501,16 +501,16 @@ ALTER TABLE ONLY post_tags
501501
-- Name: posts_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
502502
--
503503

504-
ALTER TABLE ONLY posts
505-
ADD CONSTRAINT posts_category_id_fkey FOREIGN KEY (category_id) REFERENCES categories(id);
504+
ALTER TABLE ONLY abc_posts
505+
ADD CONSTRAINT abc_posts_category_id_fkey FOREIGN KEY (abc_category_id) REFERENCES categories(id);
506506

507507

508508
--
509509
-- Name: posts_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
510510
--
511511

512-
ALTER TABLE ONLY posts
513-
ADD CONSTRAINT posts_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
512+
ALTER TABLE ONLY abc_posts
513+
ADD CONSTRAINT abc_posts_user_id_fkey FOREIGN KEY (abc_user_id) REFERENCES users(id);
514514

515515

516516
--

tests/fixtures/blog_sqlite.sql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CREATE TABLE "comments" (
1919
"post_id" integer NOT NULL,
2020
"message" VARCHAR(255) NOT NULL,
2121
"category_id" integer NOT NULL,
22-
FOREIGN KEY ("post_id") REFERENCES "posts" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
22+
FOREIGN KEY ("post_id") REFERENCES "abc_posts" ("abc_id") ON DELETE RESTRICT ON UPDATE RESTRICT,
2323
FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
2424
);
2525

@@ -31,30 +31,30 @@ INSERT INTO "comments" ("id", "post_id", "message", "category_id") VALUES (2, 1,
3131
INSERT INTO "comments" ("id", "post_id", "message", "category_id") VALUES (3, 2, 'thank you', 3);
3232
INSERT INTO "comments" ("id", "post_id", "message", "category_id") VALUES (4, 2, 'awesome', 3);
3333

34-
DROP TABLE IF EXISTS "posts";
35-
CREATE TABLE "posts" (
36-
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
37-
"user_id" integer NOT NULL,
38-
"category_id" integer NOT NULL,
39-
"content" varchar(255) NOT NULL,
40-
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
41-
FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
34+
DROP TABLE IF EXISTS "abc_posts";
35+
CREATE TABLE "abc_posts" (
36+
"abc_id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
37+
"abc_user_id" integer NOT NULL,
38+
"abc_category_id" integer NOT NULL,
39+
"abc_content" varchar(255) NOT NULL,
40+
FOREIGN KEY ("abc_user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
41+
FOREIGN KEY ("abc_category_id") REFERENCES "categories" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
4242
);
4343

44-
CREATE INDEX "posts_user_id" ON "posts" ("user_id");
44+
CREATE INDEX "posts_user_id" ON "abc_posts" ("abc_user_id");
4545

46-
CREATE INDEX "posts_category_id" ON "posts" ("category_id");
46+
CREATE INDEX "posts_category_id" ON "abc_posts" ("abc_category_id");
4747

48-
INSERT INTO "posts" ("id", "user_id", "category_id", "content") VALUES (1, 1, 1, 'blog started');
49-
INSERT INTO "posts" ("id", "user_id", "category_id", "content") VALUES (2, 1, 2, 'It works!');
48+
INSERT INTO "abc_posts" ("abc_id", "abc_user_id", "abc_category_id", "abc_content") VALUES (1, 1, 1, 'blog started');
49+
INSERT INTO "abc_posts" ("abc_id", "abc_user_id", "abc_category_id", "abc_content") VALUES (2, 1, 2, 'It works!');
5050

5151
DROP TABLE IF EXISTS "post_tags";
5252
CREATE TABLE "post_tags" (
5353
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
5454
"post_id" integer NOT NULL,
5555
"tag_id" integer NOT NULL,
5656
FOREIGN KEY ("tag_id") REFERENCES "tags" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT,
57-
FOREIGN KEY ("post_id") REFERENCES "posts" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT
57+
FOREIGN KEY ("post_id") REFERENCES "abc_posts" ("abc_id") ON DELETE RESTRICT ON UPDATE RESTRICT
5858
);
5959

6060
CREATE UNIQUE INDEX "post_tags_post_id_tag_id" ON "post_tags" ("post_id", "tag_id");

tests/fixtures/blog_sqlsrv.sql

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ GO
1212

1313
IF (OBJECT_ID('posts_user_id_fkey', 'F') IS NOT NULL)
1414
BEGIN
15-
ALTER TABLE [posts] DROP CONSTRAINT [posts_user_id_fkey]
15+
ALTER TABLE [abc_posts] DROP CONSTRAINT [abc_posts_user_id_fkey]
1616
END
1717
GO
1818

1919
IF (OBJECT_ID('posts_category_id_fkey', 'F') IS NOT NULL)
2020
BEGIN
21-
ALTER TABLE [posts] DROP CONSTRAINT [posts_category_id_fkey]
21+
ALTER TABLE [abc_posts] DROP CONSTRAINT [abc_posts_category_id_fkey]
2222
END
2323
GO
2424

@@ -90,7 +90,7 @@ GO
9090

9191
IF (OBJECT_ID('posts', 'U') IS NOT NULL)
9292
BEGIN
93-
DROP TABLE [posts]
93+
DROP TABLE [abc_posts]
9494
END
9595
GO
9696

@@ -176,17 +176,17 @@ CREATE TABLE [post_tags](
176176
)
177177
GO
178178

179-
DROP SEQUENCE IF EXISTS [posts_id_seq]
179+
DROP SEQUENCE IF EXISTS [abc_posts_id_seq]
180180
GO
181-
CREATE SEQUENCE [posts_id_seq] AS int START WITH 1 INCREMENT BY 1 NO CACHE
181+
CREATE SEQUENCE [abc_posts_id_seq] AS int START WITH 1 INCREMENT BY 1 NO CACHE
182182
GO
183183

184-
CREATE TABLE [posts](
185-
[id] [int] NOT NULL CONSTRAINT [posts_id_def] DEFAULT NEXT VALUE FOR [posts_id_seq],
186-
[user_id] [int] NOT NULL,
187-
[category_id] [int] NOT NULL,
188-
[content] [nvarchar](255) NOT NULL,
189-
CONSTRAINT [posts_pkey] PRIMARY KEY CLUSTERED([id] ASC)
184+
CREATE TABLE [abc_posts](
185+
[abc_id] [int] NOT NULL CONSTRAINT [abc_posts_id_def] DEFAULT NEXT VALUE FOR [abc_posts_id_seq],
186+
[abc_user_id] [int] NOT NULL,
187+
[abc_category_id] [int] NOT NULL,
188+
[abc_content] [nvarchar](255) NOT NULL,
189+
CONSTRAINT [abc_posts_pkey] PRIMARY KEY CLUSTERED([abc_id] ASC)
190190
)
191191
GO
192192

@@ -327,9 +327,9 @@ GO
327327
INSERT [post_tags] ([post_id], [tag_id]) VALUES (2, 2)
328328
GO
329329

330-
INSERT [posts] ([user_id], [category_id], [content]) VALUES (1, 1, N'blog started')
330+
INSERT [abc_posts] ([abc_user_id], [abc_category_id], [abc_content]) VALUES (1, 1, N'blog started')
331331
GO
332-
INSERT [posts] ([user_id], [category_id], [content]) VALUES (1, 2, N'It works!')
332+
INSERT [abc_posts] ([abc_user_id], [abc_category_id], [abc_content]) VALUES (1, 2, N'It works!')
333333
GO
334334

335335
INSERT [tags] ([name], [is_important]) VALUES (N'funny', 0)
@@ -386,7 +386,7 @@ INSERT [nopk] ([id]) VALUES ('e42c77c6-06a4-4502-816c-d112c7142e6d')
386386
GO
387387

388388
ALTER TABLE [comments] WITH CHECK ADD CONSTRAINT [comments_post_id_fkey] FOREIGN KEY([post_id])
389-
REFERENCES [posts] ([id])
389+
REFERENCES [abc_posts] ([abc_id])
390390
GO
391391
ALTER TABLE [comments] CHECK CONSTRAINT [comments_post_id_fkey]
392392
GO
@@ -398,7 +398,7 @@ ALTER TABLE [comments] CHECK CONSTRAINT [comments_category_id_fkey]
398398
GO
399399

400400
ALTER TABLE [post_tags] WITH CHECK ADD CONSTRAINT [post_tags_post_id_fkey] FOREIGN KEY([post_id])
401-
REFERENCES [posts] ([id])
401+
REFERENCES [abc_posts] ([abc_id])
402402
GO
403403
ALTER TABLE [post_tags] CHECK CONSTRAINT [post_tags_post_id_fkey]
404404
GO
@@ -409,16 +409,16 @@ GO
409409
ALTER TABLE [post_tags] CHECK CONSTRAINT [post_tags_tag_id_fkey]
410410
GO
411411

412-
ALTER TABLE [posts] WITH CHECK ADD CONSTRAINT [posts_category_id_fkey] FOREIGN KEY([category_id])
412+
ALTER TABLE [abc_posts] WITH CHECK ADD CONSTRAINT [abc_posts_category_id_fkey] FOREIGN KEY([abc_category_id])
413413
REFERENCES [categories] ([id])
414414
GO
415-
ALTER TABLE [posts] CHECK CONSTRAINT [posts_category_id_fkey]
415+
ALTER TABLE [abc_posts] CHECK CONSTRAINT [abc_posts_category_id_fkey]
416416
GO
417417

418-
ALTER TABLE [posts] WITH CHECK ADD CONSTRAINT [posts_user_id_fkey] FOREIGN KEY([user_id])
418+
ALTER TABLE [abc_posts] WITH CHECK ADD CONSTRAINT [abc_posts_user_id_fkey] FOREIGN KEY([abc_user_id])
419419
REFERENCES [users] ([id])
420420
GO
421-
ALTER TABLE [posts] CHECK CONSTRAINT [posts_user_id_fkey]
421+
ALTER TABLE [abc_posts] CHECK CONSTRAINT [abc_posts_user_id_fkey]
422422
GO
423423

424424
ALTER TABLE [barcodes] WITH CHECK ADD CONSTRAINT [barcodes_product_id_fkey] FOREIGN KEY([product_id])

0 commit comments

Comments
 (0)