-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlite_dump.sql
More file actions
41 lines (41 loc) · 8.75 KB
/
sqlite_dump.sql
File metadata and controls
41 lines (41 loc) · 8.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "migrations" ("id" integer primary key autoincrement not null, "migration" varchar not null, "batch" integer not null);
INSERT INTO migrations VALUES(1,'2014_10_12_000000_create_users_table',1);
INSERT INTO migrations VALUES(2,'2014_10_12_100000_create_password_reset_tokens_table',1);
INSERT INTO migrations VALUES(3,'2019_08_19_000000_create_failed_jobs_table',1);
INSERT INTO migrations VALUES(4,'2019_12_14_000001_create_personal_access_tokens_table',1);
INSERT INTO migrations VALUES(5,'2023_07_15_183739_create_posts_table',1);
INSERT INTO migrations VALUES(6,'2023_07_15_192708_create_categories_table',1);
INSERT INTO migrations VALUES(7,'2023_07_15_200858_create_post_categories_table',1);
INSERT INTO migrations VALUES(8,'2023_08_07_171915_add_reactions_to_posts',2);
CREATE TABLE IF NOT EXISTS "users" ("id" integer primary key autoincrement not null, "name" varchar not null, "email" varchar not null, "email_verified_at" datetime, "password" varchar not null, "remember_token" varchar, "created_at" datetime, "updated_at" datetime);
INSERT INTO users VALUES(1,'admin','admin@admin.com',NULL,'$2y$10$Ww5f41itYFL1wbvY/tC5Y.FLkd2tct1Hupg48br82iHsEYx5Lovx6',NULL,'2023-07-16 16:46:23','2023-07-16 16:46:23');
INSERT INTO users VALUES(2,'John Doe','john@doe.com',NULL,'$2y$10$d3bBruVecQAJHG3fcSSlT.IVZtSIhG16temJmw1Ot/Z7V9E6JldX.',NULL,'2023-07-16 16:52:49','2023-07-16 16:52:49');
CREATE TABLE IF NOT EXISTS "password_reset_tokens" ("email" varchar not null, "token" varchar not null, "created_at" datetime, primary key ("email"));
CREATE TABLE IF NOT EXISTS "failed_jobs" ("id" integer primary key autoincrement not null, "uuid" varchar not null, "connection" text not null, "queue" text not null, "payload" text not null, "exception" text not null, "failed_at" datetime not null default CURRENT_TIMESTAMP);
CREATE TABLE IF NOT EXISTS "personal_access_tokens" ("id" integer primary key autoincrement not null, "tokenable_type" varchar not null, "tokenable_id" integer not null, "name" varchar not null, "token" varchar not null, "abilities" text, "last_used_at" datetime, "expires_at" datetime, "created_at" datetime, "updated_at" datetime);
CREATE TABLE IF NOT EXISTS "posts" ("id" integer primary key autoincrement not null, "title" varchar not null, "body" text not null, "image" varchar, "user_id" integer not null, "created_at" datetime, "updated_at" datetime, "reactions" text, foreign key("user_id") references "users"("id") on delete Cascade);
INSERT INTO posts VALUES(1,'One Good Turn','One Good Turn they say deserves another',NULL,1,'2023-07-16 16:54:36','2023-07-16 16:54:36',NULL);
CREATE TABLE IF NOT EXISTS "categories" ("id" integer primary key autoincrement not null, "title" varchar not null, "image" varchar, "created_at" datetime, "updated_at" datetime);
INSERT INTO categories VALUES(1,'Politics/Religion',NULL,'2023-07-16 16:50:16','2023-07-16 16:50:16');
INSERT INTO categories VALUES(2,'Sports',NULL,'2023-07-16 16:50:32','2023-07-16 16:50:32');
INSERT INTO categories VALUES(3,'Movies',NULL,'2023-07-16 16:50:50','2023-07-16 16:50:50');
INSERT INTO categories VALUES(4,'News',NULL,'2023-07-16 16:51:18','2023-07-16 16:51:18');
INSERT INTO categories VALUES(5,'Games',NULL,'2023-07-16 16:51:33','2023-07-16 16:51:33');
CREATE TABLE IF NOT EXISTS "category_post" ("post_id" integer not null, "category_id" integer not null, foreign key("post_id") references "posts"("id") on delete cascade, foreign key("category_id") references "categories"("id") on delete cascade);
INSERT INTO category_post VALUES(1,1);
INSERT INTO category_post VALUES(1,3);
INSERT INTO category_post VALUES(1,2);
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('migrations',8);
INSERT INTO sqlite_sequence VALUES('users',2);
INSERT INTO sqlite_sequence VALUES('categories',5);
INSERT INTO sqlite_sequence VALUES('posts',1);
CREATE UNIQUE INDEX "users_email_unique" on "users" ("email");
CREATE UNIQUE INDEX "failed_jobs_uuid_unique" on "failed_jobs" ("uuid");
CREATE INDEX "personal_access_tokens_tokenable_type_tokenable_id_index" on "personal_access_tokens" ("tokenable_type", "tokenable_id");
CREATE UNIQUE INDEX "personal_access_tokens_token_unique" on "personal_access_tokens" ("token");
CREATE UNIQUE INDEX "categories_title_unique" on "categories" ("title");
CREATE UNIQUE INDEX "posts_reactions_unique" on "posts" ("reactions");
COMMIT;