From 6328c35c93de648d91992db3dc9e01907ad06aa0 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Tue, 13 Jan 2026 06:38:26 +0700 Subject: [PATCH] Basic data for metaprofile --- sql/metaprofile.sql | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sql/metaprofile.sql diff --git a/sql/metaprofile.sql b/sql/metaprofile.sql new file mode 100644 index 0000000..5fd1c0a --- /dev/null +++ b/sql/metaprofile.sql @@ -0,0 +1,54 @@ +-- README +-- Prefix idx_ = index +-- Prefix fk_ = foreign +-- Create an index for fast lookups +-- Defining constraints separately for better readability & maintainability +-- Prefix p_ = Procedure +-- Prefix i_ = Input(s) +-- Prefix v_ = Variable(s) +-- Prefix o_ = Output(s) + +-- Main table + +create table if not exists `metaprofile` ( + `id` int(11) not null auto_increment primary key, + `favicon` longtext default null, + `copyright` longtext default null +) engine=InnoDB default charset=utf8mb4; + +create table if not exists `metaprofile_baseurl` ( + `id` int(11) not null auto_increment primary key, + `metaprofile` int(11) not null, + `name` longtext not null, + `url` longtext not null, + key `idx_metaprofile` (`metaprofile`), + constraint `metaprofile_baseurl_fk_metaprofile` + foreign key (`metaprofile`) references `metaprofile` (`id`) + on update cascade + on delete cascade +) engine=InnoDB default charset=utf8mb4; + +create table if not exists `metaprofile_brand` ( + `id` int(11) not null auto_increment primary key, + `metaprofile` int(11) not null, + `name` longtext not null, + `tagline` longtext default null, + `description` longtext default null, + key `idx_metaprofile` (`metaprofile`), + constraint `metaprofile_brand_fk_metaprofile` + foreign key (`metaprofile`) references `metaprofile` (`id`) + on update cascade + on delete cascade +) engine=InnoDB default charset=utf8mb4; + +create table if not exists `metaprofile_brand_logo` ( + `id` int(11) not null auto_increment primary key, + `brand` int(11) not null, + `name` longtext not null, + `image` longtext not null, + key `idx_brand` (`brand`), + constraint `metaprofile_brand_logo_fk_brand` + foreign key (`brand`) references `metaprofile_brand` (`id`) + on update cascade + on delete cascade +) engine=InnoDB default charset=utf8mb4;