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,'0001_01_01_000000_create_users_table',1);
INSERT INTO migrations VALUES(2,'0001_01_01_000001_create_cache_table',1);
INSERT INTO migrations VALUES(3,'0001_01_01_000002_create_jobs_table',1);
INSERT INTO migrations VALUES(4,'2025_11_03_134002_create_notifications_table',1);
INSERT INTO migrations VALUES(5,'2025_11_03_134002_create_requests_table',1);
INSERT INTO migrations VALUES(6,'2025_11_03_134002_create_trips_table',1);
INSERT INTO migrations VALUES(7,'2025_11_03_134002_create_vehicles_table',1);
INSERT INTO migrations VALUES(8,'2025_11_03_150215_create_personal_access_tokens_table',2);
CREATE TABLE IF NOT EXISTS "users" ("id" integer primary key autoincrement not null, "userName" varchar not null, "email" varchar not null, "password" varchar not null, "mobile1" varchar not null, "mobile2" varchar, "aadhar" varchar, "driving_license" varchar, "role" varchar check ("role" in ('Admin', 'Driver', 'FacilityOwner', 'LoginMaster')) not null default 'FacilityOwner', "photo" varchar, "is_verified" tinyint(1) not null default '0', "is_active" tinyint(1) not null default '1', "otp" varchar, "otp_expires_at" datetime, "remember_token" varchar, "created_at" datetime, "updated_at" datetime);
INSERT INTO users VALUES(1,'Admin User','admin@wastemanagement.com','$2y$12$4hfwxXW6txgJN8qIZePvfuvFAot.47tU6ulJzu/kDSmDwTSZpldSy','1234567890',NULL,NULL,NULL,'Admin',NULL,1,1,NULL,NULL,NULL,'2025-11-03 13:45:55','2025-11-03 15:04:21');
INSERT INTO users VALUES(2,'Login Master','loginmaster@wastemanagement.com','$2y$12$ktl4Yf8jwkPM05hBOKnHpupPQXyBleJiutfVaa7J5e75oJPsGpFsS','1234567891',NULL,NULL,NULL,'LoginMaster',NULL,1,1,NULL,NULL,NULL,'2025-11-03 13:45:56','2025-11-03 13:45:56');
INSERT INTO users VALUES(3,'Driver One','driver@wastemanagement.com','$2y$12$4P65X3h7Ax5hmf.gU1WT5.f65zQaC1c32UMcGl24WlIV1oTySHbCm','1234567892',NULL,'123456789012','DL1234567890','Driver',NULL,1,1,NULL,NULL,NULL,'2025-11-03 13:45:56','2025-11-03 15:06:32');
INSERT INTO users VALUES(4,'Facility Owner','owner@wastemanagement.com','$2y$12$4eX2T7zDVw0RYUP6aVpM7OrH1SmrvQO9jHRdAXE1IYDZOXtLN65Qe','1234567893',NULL,NULL,NULL,'FacilityOwner',NULL,1,1,NULL,NULL,NULL,'2025-11-03 13:45:56','2025-11-03 13:45:56');
INSERT INTO users VALUES(5,'Test User','test@example.com','$2y$12$6wXAjMiQ4xE3GYA6NhGTJ.ZMEqFlbzMkDEDxDA7YpBT92M9ytqSZa','9876543210',NULL,NULL,NULL,'FacilityOwner','default.png',0,1,'778772','2025-11-03 13:58:07',NULL,'2025-11-03 13:48:07','2025-11-03 13:48:07');
INSERT INTO users VALUES(6,'driver','d@gmail.com','$2y$12$vrdsVE4DrJZ.PqDgQNBL..togsxGAy5udM13jUeb56Lo9TQI6ljsi','9879879870',NULL,NULL,NULL,'FacilityOwner','null',0,1,'311232','2025-11-03 14:06:47',NULL,'2025-11-03 13:55:24','2025-11-03 13:56:47');
INSERT INTO users VALUES(7,'demo','reddysai296@gmail.com','$2y$12$6wdsT2WXLTsNVDNbRBp2W.9gZ31c5wxFNt3eHSs45gJu8/neEQNjy','9879879870',NULL,NULL,NULL,'FacilityOwner','null',0,1,NULL,NULL,NULL,'2025-11-03 15:08:28','2025-11-03 15:52:36');
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 "sessions" ("id" varchar not null, "user_id" integer, "ip_address" varchar, "user_agent" text, "payload" text not null, "last_activity" integer not null, primary key ("id"));
INSERT INTO sessions VALUES('uK4D8gzFh5X6cZNsHRNlBkA2ds7vpg295jUzf6JG',NULL,'127.0.0.1','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36','YTozOntzOjY6Il90b2tlbiI7czo0MDoiSkk1MHRCZklIaEM4U0l3ZnFWcFFVZVRtWTI5NUVjR3NtRUxMTURPcyI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MTk6Imh0dHA6Ly8wLjAuMC4wOjgwMDAiO3M6NToicm91dGUiO047fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=',1762181324);
INSERT INTO sessions VALUES('qtMPXJOtAwktjaUmDqutn9QUDGgC0MiUzpviaozF',NULL,'127.0.0.1','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36','YTozOntzOjY6Il90b2tlbiI7czo0MDoiSzJHYWZqNGYwN2c0QUVVczZNVXdQSDFoV1lqOE1iTmE5d2NBNHFBOSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMCI7czo1OiJyb3V0ZSI7Tjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==',1762177994);
CREATE TABLE IF NOT EXISTS "cache" ("key" varchar not null, "value" text not null, "expiration" integer not null, primary key ("key"));
CREATE TABLE IF NOT EXISTS "cache_locks" ("key" varchar not null, "owner" varchar not null, "expiration" integer not null, primary key ("key"));
CREATE TABLE IF NOT EXISTS "jobs" ("id" integer primary key autoincrement not null, "queue" varchar not null, "payload" text not null, "attempts" integer not null, "reserved_at" integer, "available_at" integer not null, "created_at" integer not null);
CREATE TABLE IF NOT EXISTS "job_batches" ("id" varchar not null, "name" varchar not null, "total_jobs" integer not null, "pending_jobs" integer not null, "failed_jobs" integer not null, "failed_job_ids" text not null, "options" text, "cancelled_at" integer, "created_at" integer not null, "finished_at" integer, primary key ("id"));
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 "notifications" ("id" integer primary key autoincrement not null, "user_id" integer not null, "title" varchar not null, "message" text not null, "type" varchar check ("type" in ('info', 'warning', 'success', 'error')) not null default 'info', "is_read" tinyint(1) not null default '0', "created_at" datetime, "updated_at" datetime, foreign key("user_id") references "users"("id") on delete cascade);
CREATE TABLE IF NOT EXISTS "requests" ("id" integer primary key autoincrement not null, "facility_owner_id" integer not null, "waste_type" varchar not null, "quantity" numeric not null, "pickup_address" varchar not null, "pickup_lat" varchar, "pickup_lng" varchar, "preferred_pickup_time" datetime not null, "status" varchar check ("status" in ('pending', 'assigned', 'in_progress', 'completed', 'cancelled')) not null default 'pending', "special_instructions" text, "created_at" datetime, "updated_at" datetime, foreign key("facility_owner_id") references "users"("id") on delete cascade);
CREATE TABLE IF NOT EXISTS "trips" ("id" integer primary key autoincrement not null, "request_id" integer not null, "driver_id" integer not null, "vehicle_id" integer not null, "status" varchar check ("status" in ('pending', 'in_progress', 'completed', 'cancelled')) not null default 'pending', "distance" numeric, "fuel_used" numeric, "earnings" numeric, "started_at" datetime, "completed_at" datetime, "notes" text, "created_at" datetime, "updated_at" datetime, foreign key("request_id") references "requests"("id") on delete cascade, foreign key("driver_id") references "users"("id") on delete cascade, foreign key("vehicle_id") references "vehicles"("id") on delete cascade);
CREATE TABLE IF NOT EXISTS "vehicles" ("id" integer primary key autoincrement not null, "vehicle_number" varchar not null, "vehicle_type" varchar not null, "model" varchar not null, "capacity" integer not null, "status" varchar check ("status" in ('active', 'inactive', 'maintenance')) not null default 'active', "assigned_driver_id" integer, "created_at" datetime, "updated_at" datetime, foreign key("assigned_driver_id") references "users"("id") on delete set null);
INSERT INTO vehicles VALUES(1,'WM-001','Truck','Tata LPT 1109',5000,'active',NULL,'2025-11-03 13:45:56','2025-11-03 13:45:56');
INSERT INTO vehicles VALUES(2,'WM-002','Van','Mahindra Supro',1000,'active',NULL,'2025-11-03 13:45:56','2025-11-03 13:45:56');
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" text not null, "token" varchar not null, "abilities" text, "last_used_at" datetime, "expires_at" datetime, "created_at" datetime, "updated_at" datetime);
INSERT INTO personal_access_tokens VALUES(1,'App\Models\User',1,'auth_token','d8e0b96e6483053336878496f68e94f9d822f7ae7d27dce49092d62675487d47','["*"]',NULL,NULL,'2025-11-03 15:02:43','2025-11-03 15:02:43');
INSERT INTO personal_access_tokens VALUES(2,'App\Models\User',1,'auth_token','79574545105d06d288bee7a6a967bb843a510e1ecf20de33d2d38ceaf108320e','["*"]','2025-11-03 15:05:10',NULL,'2025-11-03 15:04:21','2025-11-03 15:05:10');
INSERT INTO personal_access_tokens VALUES(3,'App\Models\User',3,'auth_token','ebeaa1325b47df9b3dc64a00d229a87a5d3668fd2138f0d01755ceb7ede450d1','["*"]',NULL,NULL,'2025-11-03 15:06:32','2025-11-03 15:06:32');
INSERT INTO personal_access_tokens VALUES(4,'App\Models\User',7,'auth_token','3c986a3ef052616fe4d23fb29237ec3f08148420a6cd5a445bf3d5788d83c702','["*"]',NULL,NULL,'2025-11-03 15:09:36','2025-11-03 15:09:36');
INSERT INTO personal_access_tokens VALUES(5,'App\Models\User',7,'auth_token','132d8fe58a82e33027c14147e292a892609055116a316905525d23fd7f3b3900','["*"]',NULL,NULL,'2025-11-03 15:32:24','2025-11-03 15:32:24');
INSERT INTO personal_access_tokens VALUES(6,'App\Models\User',7,'auth_token','3195e10d0622b1e63beea3d5363c3dde9894727d735cae8efc47d19a3c0784a2','["*"]',NULL,NULL,'2025-11-03 15:52:36','2025-11-03 15:52:36');
INSERT INTO sqlite_sequence VALUES('migrations',8);
INSERT INTO sqlite_sequence VALUES('users',7);
INSERT INTO sqlite_sequence VALUES('vehicles',2);
INSERT INTO sqlite_sequence VALUES('personal_access_tokens',6);
CREATE UNIQUE INDEX "users_email_unique" on "users" ("email");
CREATE INDEX "sessions_user_id_index" on "sessions" ("user_id");
CREATE INDEX "sessions_last_activity_index" on "sessions" ("last_activity");
CREATE INDEX "jobs_queue_index" on "jobs" ("queue");
CREATE UNIQUE INDEX "failed_jobs_uuid_unique" on "failed_jobs" ("uuid");
CREATE UNIQUE INDEX "vehicles_vehicle_number_unique" on "vehicles" ("vehicle_number");
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 INDEX "personal_access_tokens_expires_at_index" on "personal_access_tokens" ("expires_at");
COMMIT;
