Skip to content

Latest commit

 

History

History
117 lines (94 loc) · 4.18 KB

SQL.md

File metadata and controls

117 lines (94 loc) · 4.18 KB

Table: failed_jobs

DROP TABLE IF EXISTS failed_jobs;

CREATE TABLE failed_jobs ( id bigint unsigned NOT NULL AUTO_INCREMENT, uuid varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, connection text COLLATE utf8mb4_unicode_ci NOT NULL, queue text COLLATE utf8mb4_unicode_ci NOT NULL, payload longtext COLLATE utf8mb4_unicode_ci NOT NULL, exception longtext COLLATE utf8mb4_unicode_ci NOT NULL, failed_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY failed_jobs_uuid_unique (uuid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: migrations

DROP TABLE IF EXISTS migrations;

CREATE TABLE migrations ( id int unsigned NOT NULL AUTO_INCREMENT, migration varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, batch int NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: notes

DROP TABLE IF EXISTS notes;

CREATE TABLE notes ( id bigint unsigned NOT NULL AUTO_INCREMENT, title varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, description text COLLATE utf8mb4_unicode_ci NOT NULL, user_id bigint unsigned NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, PRIMARY KEY (id), KEY notes_user_id_foreign (user_id), CONSTRAINT notes_user_id_foreign FOREIGN KEY (user_id) REFERENCES users (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: password_reset_tokens

DROP TABLE IF EXISTS password_reset_tokens;

CREATE TABLE password_reset_tokens ( email varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, token varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, created_at timestamp NULL DEFAULT NULL, PRIMARY KEY (email) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: personal_access_tokens

DROP TABLE IF EXISTS personal_access_tokens;

CREATE TABLE personal_access_tokens ( id bigint unsigned NOT NULL AUTO_INCREMENT, tokenable_type varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, tokenable_id bigint unsigned NOT NULL, name varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, token varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, abilities text COLLATE utf8mb4_unicode_ci, last_used_at timestamp NULL DEFAULT NULL, expires_at timestamp NULL DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY personal_access_tokens_token_unique (token), KEY personal_access_tokens_tokenable_type_tokenable_id_index (tokenable_type,tokenable_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: role_user

DROP TABLE IF EXISTS role_user;

CREATE TABLE role_user ( user_id bigint unsigned NOT NULL, role_id bigint unsigned NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, KEY role_user_user_id_foreign (user_id), KEY role_user_role_id_foreign (role_id), CONSTRAINT role_user_role_id_foreign FOREIGN KEY (role_id) REFERENCES roles (id) ON DELETE CASCADE, CONSTRAINT role_user_user_id_foreign FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: roles

DROP TABLE IF EXISTS roles;

CREATE TABLE roles ( id bigint unsigned NOT NULL AUTO_INCREMENT, name varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: users

DROP TABLE IF EXISTS users;

CREATE TABLE users ( id bigint unsigned NOT NULL AUTO_INCREMENT, name varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, email varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, email_verified_at timestamp NULL DEFAULT NULL, password varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, remember_token varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY users_email_unique (email) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;