sql
stringlengths 6
1.05M
|
|---|
--
---- test partition for (null)
--
-- 1. test ordinary
-- 1.1 range partitioned table
-- 1.2 interval partitioned table
-- 2. test data column of partition key value
-- 2.1 text
-- 2.2 timestamp
-- 3. MAXVALUE
-- 3.1 MAXVALUE is first column
-- 3.2 MAXVALUE is second column
CREATE schema FVT_COMPRESS_QWER;
set search_path to FVT_COMPRESS_QWER;
-- 1. test ordinary
---- 1.1 range partitioned table
create table test_partition_for_null_list (a int, b int, c int, d int)
partition by list (a)
(
partition test_partition_for_null_list_p1 values(0),
partition test_partition_for_null_list_p2 values(1,2,3),
partition test_partition_for_null_list_p3 values(4,5,6)
);
insert into test_partition_for_null_list values (0, 0, 0, 0);
insert into test_partition_for_null_list values (1, 1, 1, 1);
insert into test_partition_for_null_list values (5, 5, 5, 5);
-- failed: inserted partition key does not map to any table partition
insert into test_partition_for_null_list values (null, null, null, null);
-- success
insert into test_partition_for_null_list values (0, null, null, null);
-- failed: The partition number is invalid or out-of-range
select * from test_partition_for_null_list partition for (null) order by 1, 2, 3, 4;
-- success
select * from test_partition_for_null_list partition for (0) order by 1, 2, 3, 4;
-- failed: The partition number is invalid or out-of-range
alter table test_partition_for_null_list rename partition for (null) to test_partition_for_null_list_part1;
-- success
alter table test_partition_for_null_list rename partition for (0) to test_partition_for_null_list_part1;
-- success
select * from test_partition_for_null_list partition (test_partition_for_null_list_part1) order by 1, 2, 3, 4;
-- failed: The partition number is invalid or out-of-range
alter table test_partition_for_null_list drop partition for (null);
-- success
alter table test_partition_for_null_list drop partition for (0);
-- failed
select * from test_partition_for_null_list partition (test_partition_for_null_list_part1) order by 1, 2, 3, 4;
CREATE TABLE select_list_partition_table_000_3(
C_CHAR_1 CHAR(1),
C_CHAR_2 CHAR(10),
C_CHAR_3 CHAR(102400),
C_VARCHAR_1 VARCHAR(1),
C_VARCHAR_2 VARCHAR(10),
C_VARCHAR_3 VARCHAR(1024),
C_INT INTEGER,
C_BIGINT BIGINT,
C_SMALLINT SMALLINT,
C_FLOAT FLOAT,
C_NUMERIC numeric(10,5),
C_DP double precision,
C_DATE DATE,
C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE,
C_TS_WITH TIMESTAMP WITH TIME ZONE )
partition by list (C_INT)
(
partition select_list_partition_000_3_1 values (111,222,333,444),
partition select_list_partition_000_3_2 values (555,666,777,888,999,1100,1600)
);
create index select_list_partition_table_index_000_3 ON select_list_partition_table_000_3(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(partition select_list_partition_000_3_1, partition select_list_partition_000_3_3);
create view select_list_partition_table_view_000_3 as select * from select_list_partition_table_000_3;
INSERT INTO select_list_partition_table_000_3 VALUES('A','ABC','ABCDEFG','a','abc','abcdefg',111,111111,11,1.1,1.11,1.111,'2000-01-01','2000-01-01 01:01:01','2000-01-01 01:01:01+01');
INSERT INTO select_list_partition_table_000_3 VALUES('B','BCD','BCDEFGH','b','bcd','bcdefgh',222,222222,22,2.2,2.22,2.222,'2000-02-02','2000-02-02 02:02:02','2000-02-02 02:02:02+02');
INSERT INTO select_list_partition_table_000_3 VALUES('C','CDE','CDEFGHI','c','cde','cdefghi',333,333333,33,3.3,3.33,3.333,'2000-03-03','2000-03-03 03:03:03','2000-03-03 03:03:03+03');
INSERT INTO select_list_partition_table_000_3 VALUES('D','DEF','DEFGHIJ','d','def','defghij',444,444444,44,4.4,4.44,4.444,'2000-04-04','2000-04-04 04:04:04','2000-04-04 04:04:04+04');
INSERT INTO select_list_partition_table_000_3 VALUES('E','EFG','EFGHIJK','e','efg','efghijk',555,555555,55,5.5,5.55,5.555,'2000-05-05','2000-05-05 05:05:05','2000-05-05 05:05:05+05');
INSERT INTO select_list_partition_table_000_3 VALUES('F','FGH','FGHIJKL','f','fgh','fghijkl',666,666666,66,6.6,6.66,6.666,'2000-06-06','2000-06-06 06:06:06','2000-06-06 06:06:06+06');
INSERT INTO select_list_partition_table_000_3 VALUES('G','GHI','GHIJKLM','g','ghi','ghijklm',777,777777,77,7.7,7.77,7.777,'2000-07-07','2000-07-07 07:07:07','2000-07-07 07:07:07+07');
INSERT INTO select_list_partition_table_000_3 VALUES('H','HIJ','HIJKLMN','h','hij','hijklmn',888,888888,88,8.8,8.88,8.888,'2000-08-08','2000-08-08 08:08:08','2000-08-08 08:08:08+08');
INSERT INTO select_list_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',999,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
INSERT INTO select_list_partition_table_000_3 VALUES('H','HIJ','HIJKLMN','h','hij','hijklmn',888,888888,88,8.8,8.88,8.888,'2000-08-08','2000-08-08 08:08:08','2000-08-08 08:08:08+08');
INSERT INTO select_list_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',999,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
INSERT INTO select_list_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1100,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
INSERT INTO select_list_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1600,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
select * from select_list_partition_table_000_3 partition for (NULL) order by C_INT;
alter table select_list_partition_table_000_3 rename partition for (NULL) to select_list_partition_table_000_3_p1;
alter table select_list_partition_table_000_3 drop partition for (NULL);
CREATE TABLE partition_wise_join_table_001_1 (ID INT NOT NULL,NAME VARCHAR(50) NOT NULL,SCORE NUMERIC(4,1),BIRTHDAY TIMESTAMP WITHOUT TIME ZONE,ADDRESS TEXT,SALARY double precision,RANK SMALLINT)
partition by list(ID)
(
partition partition_wise_join_table_001_1_1 values (1,42,3,44,5,46,7,48,9),
partition partition_wise_join_table_001_1_2 values (41,2,43,4,45,6,47,8,49)
) ;
INSERT INTO partition_wise_join_table_001_1 VALUES (generate_series(1,9),'PARTITION WIASE JOIN 1-1-' || generate_series(1,10),90 + random() * 10,'1990-8-8',$$No.88# Science 6 Street of Xi'an of China $$,10000,13 );
INSERT INTO partition_wise_join_table_001_1 VALUES (generate_series(41,49),'PARTITION WIASE JOIN 1-3-' || generate_series(40,60),90 + random() * 10,'1990-8-8',$$No.88# Science 6 Street of Xi'an of China $$,15000,15 );
create index idx_partition_wise_join_table_001_1_1 on partition_wise_join_table_001_1(ID) LOCAL;
create index idx_partition_wise_join_table_001_1_2 on partition_wise_join_table_001_1(ID,NAME) LOCAL;
create index idx_partition_wise_join_table_001_1_3 on partition_wise_join_table_001_1(RANK) LOCAL;
create index idx_partition_wise_join_table_001_1_4 on partition_wise_join_table_001_1(RANK,SALARY,NAME) LOCAL;
CREATE TABLE partition_wise_join_table_001_2 (ID INT NOT NULL,NAME VARCHAR(50) NOT NULL,SCORE NUMERIC(4,1),BIRTHDAY TIMESTAMP WITHOUT TIME ZONE,ADDRESS TEXT,SALARY double precision )
partition by list(ID)
(
partition partition_wise_join_table_001_1_1 values (71,2,73,4,75,6,77,8,79),
partition partition_wise_join_table_001_1_2 values (1,72,3,74,5,76,7,78,9)
);
INSERT INTO partition_wise_join_table_001_2 VALUES (generate_series(1,9),'PARTITION WIASE JOIN 2-1-' || generate_series(1,10),90 + random() * 10,'1990-8-8',$$No 66# Science 4 Street of Xi'an of China $$,10000);
INSERT INTO partition_wise_join_table_001_2 VALUES (generate_series(71,79),'PARTITION WIASE JOIN 2-3-' || generate_series(70,80),90 + random() * 10,'1990-8-8',$$No 77# Science 4 Street of Xi'an of China $$,15000);
CREATE INDEX IDX_PARTITION_WISE_JOIN_TABLE_001_2_1 ON PARTITION_WISE_JOIN_TABLE_001_2(ID) LOCAL;
CREATE INDEX IDX_PARTITION_WISE_JOIN_TABLE_001_2_2 ON PARTITION_WISE_JOIN_TABLE_001_2(ID,NAME) LOCAL;
CREATE INDEX IDX_PARTITION_WISE_JOIN_TABLE_001_2_3 ON PARTITION_WISE_JOIN_TABLE_001_2(SALARY,NAME) LOCAL;
SELECT A.ID,B.ID, A.RANK,B.SALARY,A.SALARY,A.ADDRESS,B.BIRTHDAY FROM PARTITION_WISE_JOIN_TABLE_001_1 A,PARTITION_WISE_JOIN_TABLE_001_2 B WHERE A.ID = B.ID AND A.ID < 100 OR A.ID >400 order by 1, 2;
ANALYZE PARTITION_WISE_JOIN_TABLE_001_1;
ANALYZE PARTITION_WISE_JOIN_TABLE_001_2;
SELECT A.ID,B.ID, A.RANK,B.SALARY,A.SALARY,A.ADDRESS,B.BIRTHDAY FROM PARTITION_WISE_JOIN_TABLE_001_1 A,PARTITION_WISE_JOIN_TABLE_001_2 B WHERE A.ID = B.ID AND A.ID < 100 OR A.ID >400 order by 1, 2;
CREATE TABLE HW_PARTITION_SELECT_RT (A INT, B INT)
PARTITION BY list (A)
(
PARTITION HW_PARTITION_SELECT_RT_P1 VALUES (0),
PARTITION HW_PARTITION_SELECT_RT_P2 VALUES (1,2,3),
PARTITION HW_PARTITION_SELECT_RT_P3 VALUES (4,5,6)
);
EXPLAIN (COSTS OFF) SELECT B FROM (SELECT B FROM HW_PARTITION_SELECT_RT LIMIT 100) ORDER BY B;
CREATE TABLE DTS2013112504143_TEST1(A INT) PARTITION BY LIST (A)(PARTITION DTS2013112504143_TEST1_P1 VALUES (1,2,3,4,5,6,7,8,9));
CREATE TABLE DTS2013112504143_TEST2(A INT);
SELECT * FROM DTS2013112504143_TEST1 UNION ALL SELECT * FROM DTS2013112504143_TEST2 order by 1;
CREATE TABLE select_partition_table_000_3(
C_CHAR_1 CHAR(1),
C_CHAR_2 CHAR(10),
C_CHAR_3 CHAR(102400),
C_VARCHAR_1 VARCHAR(1),
C_VARCHAR_2 VARCHAR(10),
C_VARCHAR_3 VARCHAR(1024),
C_INT INTEGER,
C_BIGINT BIGINT,
C_SMALLINT SMALLINT,
C_FLOAT FLOAT,
C_NUMERIC numeric(10,5),
C_DP double precision,
C_DATE DATE,
C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE,
C_TS_WITH TIMESTAMP WITH TIME ZONE )
partition by list (C_INT)
(
partition select_partition_000_3_1 values (111,222,333,444),
partition select_partition_000_3_3 values (555,666,777,888,999,1100,1600)
);
create index select_partition_table_index_000_3 ON select_partition_table_000_3(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(partition select_partition_000_3_1, partition select_partition_000_3_3);
create view select_partition_table_view_000_3 as select * from select_partition_table_000_3;
INSERT INTO select_partition_table_000_3 VALUES('A','ABC','ABCDEFG','a','abc','abcdefg',111,111111,11,1.1,1.11,1.111,'2000-01-01','2000-01-01 01:01:01','2000-01-01 01:01:01+01');
INSERT INTO select_partition_table_000_3 VALUES('B','BCD','BCDEFGH','b','bcd','bcdefgh',222,222222,22,2.2,2.22,2.222,'2000-02-02','2000-02-02 02:02:02','2000-02-02 02:02:02+02');
INSERT INTO select_partition_table_000_3 VALUES('C','CDE','CDEFGHI','c','cde','cdefghi',333,333333,33,3.3,3.33,3.333,'2000-03-03','2000-03-03 03:03:03','2000-03-03 03:03:03+03');
INSERT INTO select_partition_table_000_3 VALUES('D','DEF','DEFGHIJ','d','def','defghij',444,444444,44,4.4,4.44,4.444,'2000-04-04','2000-04-04 04:04:04','2000-04-04 04:04:04+04');
INSERT INTO select_partition_table_000_3 VALUES('E','EFG','EFGHIJK','e','efg','efghijk',555,555555,55,5.5,5.55,5.555,'2000-05-05','2000-05-05 05:05:05','2000-05-05 05:05:05+05');
INSERT INTO select_partition_table_000_3 VALUES('F','FGH','FGHIJKL','f','fgh','fghijkl',666,666666,66,6.6,6.66,6.666,'2000-06-06','2000-06-06 06:06:06','2000-06-06 06:06:06+06');
INSERT INTO select_partition_table_000_3 VALUES('G','GHI','GHIJKLM','g','ghi','ghijklm',777,777777,77,7.7,7.77,7.777,'2000-07-07','2000-07-07 07:07:07','2000-07-07 07:07:07+07');
INSERT INTO select_partition_table_000_3 VALUES('H','HIJ','HIJKLMN','h','hij','hijklmn',888,888888,88,8.8,8.88,8.888,'2000-08-08','2000-08-08 08:08:08','2000-08-08 08:08:08+08');
INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',999,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
INSERT INTO select_partition_table_000_3 VALUES('H','HIJ','HIJKLMN','h','hij','hijklmn',888,888888,88,8.8,8.88,8.888,'2000-08-08','2000-08-08 08:08:08','2000-08-08 08:08:08+08');
INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',999,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1100,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1600,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09');
explain (costs off, verbose on) select lower(C_CHAR_3), initcap(C_VARCHAR_3), sqrt(C_INT), C_NUMERIC- 1 + 2*6/3, rank() over w from select_partition_table_000_3 where C_INT > 600 or C_BIGINT < 444444 window w as (partition by C_TS_WITHOUT) order by 1,2,3,4,5;
select lower(C_CHAR_3), initcap(C_VARCHAR_3), sqrt(C_INT), C_NUMERIC- 1 + 2*6/3, rank() over w from select_partition_table_000_3 where C_INT > 600 or C_BIGINT < 444444 window w as (partition by C_TS_WITHOUT) order by 1,2,3,4,5;
create table hw_partition_select_rt5 (a int, b int, c int)
partition by list(c)
(
partition hw_partition_select_rt5_p1 values (0,1)
);
alter table hw_partition_select_rt5 drop column b;
update hw_partition_select_rt5 set c=0 where c=-1;
drop schema FVT_COMPRESS_QWER cascade;
--begin: these test are related to explain output change about partition table.
-- major change is as below
--1.
--Selected Partitions: 1 2 6 7 8 9
-- \|/
--Selected Partitions: 1..2,6..9
--2.
--Selected Partitions: 1 3 5 7 9
-- \|/
--Selected Partitions: 1,3,5,7,9
CREATE schema FVT_COMPRESS;
set search_path to FVT_COMPRESS;
create table test_explain_format_on_part_table (id int)
partition by list(id)
(
partition p1 values (1,2,3,4,5,6,7,8,9),
partition p2 values (11,12,13,14,15,16,17,18,19),
partition p3 values (21,22,23,24,25,26,27,28,29),
partition p4 values (31,32,33,34,35,36,37,38,39),
partition p5 values (41,42,43,44,45,46,47,48,49),
partition p6 values (51,52,53,54,55,56,57,58,59),
partition p7 values (61,62,63,64,65,66,67,68,69),
partition p8 values (71,72,73,74,75,76,77,78,79),
partition p9 values (81,82,83,84,85,86,87,88,89)
);
-- two continous segments, text formast
explain (verbose on, costs off)
select * from test_explain_format_on_part_table where id <15 or id >51;
-- no continous segment, text formast
explain (verbose on, costs off)
select * from test_explain_format_on_part_table where id =5 or id =25 or id=45 or id = 65 or id = 85;
-- two continous segments, non-text formast
explain (verbose on, costs off, FORMAT JSON)
select * from test_explain_format_on_part_table where id <15 or id >51;
-- no continous segment, non-text formast
explain (verbose on, costs off, FORMAT JSON)
select * from test_explain_format_on_part_table where id =5 or id =25 or id=45 or id = 65 or id = 85;
drop table test_explain_format_on_part_table;
--end: these test are related to explain output change about partition table.
create table hw_partition_select_parttable (
c1 int,
c2 int,
c3 text)
partition by list(c1)
(partition hw_partition_select_parttable_p1 values (10,20,30,40),
partition hw_partition_select_parttable_p2 values (50,60,70,80,90,100,110,120,130,140),
partition hw_partition_select_parttable_p3 values (150,200,250,300,350));
insert into hw_partition_select_parttable values (10,40,'abc');
insert into hw_partition_select_parttable(c1,c2) values (100,20);
insert into hw_partition_select_parttable values(300,200);
select * from hw_partition_select_parttable order by 1, 2, 3;
select c1 from hw_partition_select_parttable order by 1;
select c1,c2 from hw_partition_select_parttable order by 1, 2;
select c2 from hw_partition_select_parttable order by 1;
select c1,c2,c3 from hw_partition_select_parttable order by 1, 2, 3;
select c1 from hw_partition_select_parttable where c1>50 and c1<300 order by 1;
select * from hw_partition_select_parttable where c2>100 order by 1, 2, 3;
create table t_select_datatype_int32(c1 int,c2 int,c3 int,c4 text)
partition by list(c1)
(partition t_select_datatype_int32_p1 values(-100, -50, 0, 50),
partition t_select_datatype_int32_p2 values(100, 150, 200, 250),
partition t_select_datatype_int32_p3 values(300, 350),
partition t_select_datatype_int32_p4 values(400, 450, 500));
insert into t_select_datatype_int32 values(-100,20,20,'a'), (100,300,300,'bb'), (150,75,500,NULL), (200,500,50,'ccc'), (250,50,50,NULL), (300,700,125,''), (450,35,150,'dddd');
--partition select for int32
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1=50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1=250 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1=500 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1=550 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<=50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<150 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<200 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<=200 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<500 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<=500 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<700 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<=700 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>150 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=150 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>200 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=200 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>500 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=500 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 AND t_select_datatype_int32.c1<250 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 AND t_select_datatype_int32.c1>0 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 AND t_select_datatype_int32.c1>100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>50 AND t_select_datatype_int32.c1>=150 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>100 AND t_select_datatype_int32.c1>=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=100 AND t_select_datatype_int32.c1=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=100 AND t_select_datatype_int32.c1<300 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=100 AND t_select_datatype_int32.c1<550 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>100 AND t_select_datatype_int32.c1<=500 AND t_select_datatype_int32.c1>=100 AND t_select_datatype_int32.c1<500 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>250 AND t_select_datatype_int32.c1<50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>50 AND t_select_datatype_int32.c1>100 AND t_select_datatype_int32.c1>=100 AND t_select_datatype_int32.c1<250 AND t_select_datatype_int32.c1<=250 AND t_select_datatype_int32.c1=200 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 OR t_select_datatype_int32.c1<250 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 OR t_select_datatype_int32.c1>0 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 OR t_select_datatype_int32.c1>100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>50 OR t_select_datatype_int32.c1>=150 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>100 OR t_select_datatype_int32.c1>=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=100 OR t_select_datatype_int32.c1=100 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=100 OR t_select_datatype_int32.c1<200 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>100 OR t_select_datatype_int32.c1<=300 OR t_select_datatype_int32.c1>=100 OR t_select_datatype_int32.c1<300 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>250 OR t_select_datatype_int32.c1<50 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<170 AND ( t_select_datatype_int32.c1>600 OR t_select_datatype_int32.c1<150) order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where (t_select_datatype_int32.c1<170 OR t_select_datatype_int32.c1<250) AND ( t_select_datatype_int32.c1>600 OR t_select_datatype_int32.c1<150) order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1<50 OR t_select_datatype_int32.c1>250 AND t_select_datatype_int32.c1<400 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=-100 AND t_select_datatype_int32.c1<50 OR t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<700 order by 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where t_select_datatype_int32.c1>=-100 AND t_select_datatype_int32.c1<=100 OR t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<700 order by 1, 2, 3, 4;
--IS NULL
--success
select * from t_select_datatype_int32 where
(t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250) AND
(t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<t_select_datatype_int32.c2) AND
(t_select_datatype_int32.c2<t_select_datatype_int32.c3 OR t_select_datatype_int32.c2>100) OR
t_select_datatype_int32.c4 IS NULL
ORDER BY 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where
(t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250) AND
(t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<t_select_datatype_int32.c2) AND
(t_select_datatype_int32.c2<t_select_datatype_int32.c3 OR t_select_datatype_int32.c2>100) AND
t_select_datatype_int32.c4 IS NULL
ORDER BY 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where
t_select_datatype_int32.c4 IS NULL AND
(t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250) AND
(t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<t_select_datatype_int32.c2) AND
(t_select_datatype_int32.c2<t_select_datatype_int32.c3 OR t_select_datatype_int32.c2>100)
ORDER BY 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where
t_select_datatype_int32.c4 IS NULL OR
(t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250) AND
(t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<t_select_datatype_int32.c2) AND
(t_select_datatype_int32.c2<t_select_datatype_int32.c3 OR t_select_datatype_int32.c2>100)
ORDER BY 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where
(t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250) AND
(t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c4 IS NULL) AND
(t_select_datatype_int32.c2<t_select_datatype_int32.c3 OR t_select_datatype_int32.c2>100)
ORDER BY 1, 2, 3, 4;
--success
select * from t_select_datatype_int32 where
(t_select_datatype_int32.c1>500 OR t_select_datatype_int32.c1<250) AND
(t_select_datatype_int32.c1>300 AND t_select_datatype_int32.c1<t_select_datatype_int32.c2) AND
(t_select_datatype_int32.c4 IS NULL OR t_select_datatype_int32.c2>100)
ORDER BY 1, 2, 3, 4;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- check select contarins partition
--
---- check select from range partition
--
create table hw_partition_select_ordinary_table (a int, b int);
create table test_select_list_partition (a int, b int)
partition by list(a)
(
partition test_select_list_partition_p1 values (0),
partition test_select_list_partition_p2 values (1,2,3),
partition test_select_list_partition_p3 values (4,5,6)
);
insert into test_select_list_partition values(2);
--success
select * from test_select_list_partition partition (test_select_list_partition_p1) order by 1, 2;
--success
select * from test_select_list_partition partition (test_select_list_partition_p2) order by 1, 2;
--success
select * from test_select_list_partition partition (test_select_list_partition_p3) order by 1, 2;
--success
select * from test_select_list_partition partition (test_select_list_partition_p4) order by 1, 2;
--success
select a from test_select_list_partition partition (test_select_list_partition_p2) order by 1;
--success
select a from test_select_list_partition partition for (0) order by 1;
--success
select a from test_select_list_partition partition for (1) order by 1;
--success
select a from test_select_list_partition partition for (2) order by 1;
--success
select a from test_select_list_partition partition for (5) order by 1;
--success
select a from test_select_list_partition partition for (8) order by 1;
-- fail: table is not partitioned table
select a from hw_partition_select_ordinary_table partition (test_select_list_partition_p2);
-- fail: table is not partitioned table
select a from hw_partition_select_ordinary_table partition for (2);
--
--
CREATE TABLE hw_partition_select_test(C_INT INTEGER)
partition by list (C_INT)
(
partition hw_partition_select_test_part_1 values (111,222,333),
partition hw_partition_select_test_part_2 values (444,555,666),
partition hw_partition_select_test_part_3 values (777,888,999)
);
insert into hw_partition_select_test values(111);
insert into hw_partition_select_test values(555);
insert into hw_partition_select_test values(888);
select a.* from hw_partition_select_test partition(hw_partition_select_test_part_1) a;
create table list_partitioned_table (a int)
partition by list(a)
(
partition list_partitioned_table_p1 values (0),
partition list_partitioned_table_p2 values (1,2,3),
partition list_partitioned_table_p3 values (4,5,6)
);
insert into list_partitioned_table values (1);
insert into list_partitioned_table values (2);
insert into list_partitioned_table values (5);
insert into list_partitioned_table values (6);
with tmp1 as (select a from list_partitioned_table partition for (2)) select a from tmp1 order by 1;
--
---- select union select
--
create table UNION_TABLE_043_1(C_CHAR CHAR(103500), C_VARCHAR VARCHAR(1035), C_INT INTEGER not null, C_DP double precision, C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE)
partition by list (C_INT)
(
partition UNION_TABLE_043_1_1 values (111,222,333),
partition UNION_TABLE_043_1_2 values (444,555)
);
insert into UNION_TABLE_043_1 values('ABCDEFG','abcdefg',111,1.111,'2000-01-01 01:01:01');
insert into UNION_TABLE_043_1 values('BCDEFGH','bcdefgh',222,2.222,'2000-02-02 02:02:02');
insert into UNION_TABLE_043_1 values('CDEFGHI','cdefghi',333,3.333,'2000-03-03 03:03:03');
insert into UNION_TABLE_043_1 values('DEFGHIJ','defghij',444,4.444,'2000-04-04 04:04:04');
insert into UNION_TABLE_043_1 values('EFGHIJK','efghijk',555,5.555,'2000-05-05 05:05:05');
create table UNION_TABLE_043_2(C_CHAR CHAR(103500), C_VARCHAR VARCHAR(1035), C_INT INTEGER not null, C_DP double precision, C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE)
partition by list (C_INT)
(
partition UNION_TABLE_043_2_1 values (111,222,333),
partition UNION_TABLE_043_2_2 values (444,555)
);
insert into UNION_TABLE_043_2 values('ABCDEFG','abcdefg',111,1.111,'2000-01-01 01:01:01');
insert into UNION_TABLE_043_2 values('BCDEFGH','bcdefgh',222,2.222,'2010-02-02 02:02:02');
insert into UNION_TABLE_043_2 values('CDEFGHI','cdefghi',333,3.333,'2000-03-03 03:03:03');
insert into UNION_TABLE_043_2 values('DEFGHIJ','defghij',444,4.444,'2010-04-04 04:04:04');
insert into UNION_TABLE_043_2 values('EFGHIJK','efghijk',555,5.555,'2020-05-05 05:05:05');
select C_INT,C_DP,C_TS_WITHOUT from UNION_TABLE_043_1 union select C_INT,C_DP,C_TS_WITHOUT from UNION_TABLE_043_2 order by 1,2,3;
select C_INT,C_DP,C_TS_WITHOUT from UNION_TABLE_043_1 partition (UNION_TABLE_043_1_1) union select C_INT,C_DP,C_TS_WITHOUT from UNION_TABLE_043_2 partition (UNION_TABLE_043_2_1) order by 1,2,3;
drop table UNION_TABLE_043_1;
drop table UNION_TABLE_043_2;
drop schema FVT_COMPRESS cascade;
|
<reponame>charanhu1/DLithe_DotnetFSD_JanFeb2022-1<filename>Charana_H_U/Back_End/SQL/TASK_2_DLithe_BC_NFS_T_Task34_SQLSERVER/SQLQuery4.sql
--STORED PROCEDURE
--INSIDE PROGRAMABILITY FOLDER
use DLithe;
--STORED PREOCEDURE
CREATE PROCEDURE PROC_DT2
AS
BEGIN
SELECT * FROM DLITHE_TRAINEES WHERE TID<100;
END
INSERT INTO DLITHE_TRAINEES VALUES(10, 'CHARAN', 1000000,'SHIVAMOGGA','DIT01');
INSERT INTO DLITHE_TRAINEES VALUES(20, 'KIRAN', 7000000,'PUNE','DIT01');
INSERT INTO DLITHE_TRAINEES(TID, TNAME, TADDRESS, TDEPT) VALUES(30, 'VENKATESH','HYDERABHAD','DIT02');
SELECT * FROM DLITHE_TRAINEES;
exec PROC_DT2;
--===========================================================
--ALTER STORED PROCEDURE
ALTER PROCEDURE PROC_DT2
AS
BEGIN
SELECT * FROM DLITHE_TRAINEES WHERE TID<100 AND TADDRESS='PUNE';
END
EXEC PROC_DT2
--====================================================================
--DROP STORED PROCEDURE
DROP PROCEDURE PROC_DT2;
--=====================================================
--SP WITH INPUT PARAMETER
CREATE PROCEDURE PROC_DT(@TADDRESS VARCHAR(50))
AS
BEGIN
SELECT * FROM DLITHE_TRAINEES WHERE TADDRESS=@TADDRESS
END
EXEC PROC_DT @TADDRESS='Pune';
--================================
--SP WITH OUTPUT PARAMETER
CREATE PROCEDURE PROC_DT2(@TID INT OUTPUT)
AS
BEGIN
SELECT @TID=MAX(TID) FROM DLITHE_TRAINEES
END
DECLARE @TID INT
EXEC PROC_DT2 @TID OUTPUT
PRINT @TID
|
CREATE TABLE [dbo].[sqlwatch_logger_dm_exec_requests_stats]
(
[type] bit not null, -- 1 user, 0 system
snapshot_time datetime2(0) not null,
snapshot_type_id tinyint not null,
sql_instance varchar(32) not null,
background real not null,
running real not null,
runnable real not null,
sleeping real not null,
suspended real not null,
wait_time real null,
cpu_time real null,
waiting_tasks real null,
waiting_tasks_wait_duration_ms real null,
backups_in_progress smallint,
constraint pk_sqlwatch_logger_dm_exec_requests
primary key clustered ([type], snapshot_time, sql_instance, snapshot_type_id),
constraint fk_sqlwatch_logger_dm_exec_requests_snapshot_header
foreign key ([snapshot_time], [sql_instance], [snapshot_type_id])
references [dbo].[sqlwatch_logger_snapshot_header]([snapshot_time], [sql_instance], [snapshot_type_id])
on delete cascade on update cascade
);
|
<reponame>programayaprende/LiteMES
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MariaDB
Source Server Version : 100414
Source Host : localhost:3306
Source Schema : litemes
Target Server Type : MariaDB
Target Server Version : 100414
File Encoding : 65001
Date: 01/11/2020 21:11:28
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for lnk_roles_permissions
-- ----------------------------
DROP TABLE IF EXISTS `lnk_roles_permissions`;
CREATE TABLE `lnk_roles_permissions` (
`id_role` int(11) NOT NULL,
`id_permission` int(11) NOT NULL,
`type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`created_at` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id_role`, `id_permission`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of lnk_roles_permissions
-- ----------------------------
INSERT INTO `lnk_roles_permissions` VALUES (1, 10001, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10002, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10003, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10004, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10005, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10006, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10007, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10010, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10011, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10012, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10013, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10014, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10015, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10016, 'ALLOW', '2020-10-03 18:39:17');
INSERT INTO `lnk_roles_permissions` VALUES (1, 10017, 'ALLOW', '2020-10-03 18:39:16');
INSERT INTO `lnk_roles_permissions` VALUES (2, 10001, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (2, 10002, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (2, 10003, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (2, 10004, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (2, 10005, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (2, 10006, 'ALLOW', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (3, 10001, 'DENY', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (3, 10002, 'DENY', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (3, 10003, 'DENY', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (3, 10004, 'DENY', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (3, 10005, 'DENY', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (3, 10006, 'DENY', '2020-01-01 00:00:00');
INSERT INTO `lnk_roles_permissions` VALUES (6, 10007, 'ALLOW', '2020-10-02 07:09:00');
INSERT INTO `lnk_roles_permissions` VALUES (6, 10010, 'ALLOW', '2020-10-02 07:09:01');
INSERT INTO `lnk_roles_permissions` VALUES (6, 10011, 'ALLOW', '2020-10-02 07:09:01');
INSERT INTO `lnk_roles_permissions` VALUES (6, 10012, 'ALLOW', '2020-10-02 07:09:00');
INSERT INTO `lnk_roles_permissions` VALUES (6, 10013, 'ALLOW', '2020-10-02 07:09:00');
INSERT INTO `lnk_roles_permissions` VALUES (6, 10014, 'ALLOW', '2020-10-02 07:09:00');
-- ----------------------------
-- Table structure for lnk_users_roles
-- ----------------------------
DROP TABLE IF EXISTS `lnk_users_roles`;
CREATE TABLE `lnk_users_roles` (
`user_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`id_role` int(11) NOT NULL,
`created_at` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`user_name`, `id_role`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of lnk_users_roles
-- ----------------------------
INSERT INTO `lnk_users_roles` VALUES ('andrew', 6, '2020-10-03 15:50:59');
INSERT INTO `lnk_users_roles` VALUES ('aron', 6, '2020-10-03 15:51:09');
INSERT INTO `lnk_users_roles` VALUES ('j.araiza', 1, '2020-01-01 00:00:00');
INSERT INTO `lnk_users_roles` VALUES ('j.araiza', 6, '2020-10-03 16:44:08');
INSERT INTO `lnk_users_roles` VALUES ('jose', 6, '2020-10-03 16:44:10');
INSERT INTO `lnk_users_roles` VALUES ('juan', 6, '2020-10-03 17:09:23');
INSERT INTO `lnk_users_roles` VALUES ('mama', 6, '2020-10-03 18:39:43');
INSERT INTO `lnk_users_roles` VALUES ('papa', 3, '2020-01-01 00:00:00');
INSERT INTO `lnk_users_roles` VALUES ('pepe', 3, '2020-01-01 00:00:00');
INSERT INTO `lnk_users_roles` VALUES ('raul', 3, '2020-01-01 00:00:00');
-- ----------------------------
-- Table structure for ma_permissions
-- ----------------------------
DROP TABLE IF EXISTS `ma_permissions`;
CREATE TABLE `ma_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`controller` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`action` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`default` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'DENY',
`description_location` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10018 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ma_permissions
-- ----------------------------
INSERT INTO `ma_permissions` VALUES (10001, 'Users', 'GetUsers', 'View list of users', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10002, 'Users', 'Approve', 'Approve new users accounts', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10003, 'Users', 'Lock', 'Lock users, lock users can not login into the system', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10004, 'Users', 'GetUserData', 'View individual user account info', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10005, 'Users', 'Edit', 'Update user account info', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10006, 'Users', 'New', 'Create new user accounts', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10007, 'Roles', 'GetRoles', 'View list of users', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10010, 'Roles', 'GetRoleData', 'View individual user account info', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10011, 'Roles', 'Edit', 'Update user account info', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10012, 'Roles', 'New', 'Create new user accounts', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10013, 'Roles', 'View', 'View Role permissions and users with each role', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10014, 'Roles', 'List', 'Enter into Query module', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10015, 'Users', 'List', 'Enter into Query module', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10016, 'Roles', 'RemoveUser', 'Remove user from a role list', 'DENY', 'LOCATION_PENDING');
INSERT INTO `ma_permissions` VALUES (10017, 'Roles', 'AddUser', 'Add user to a role list', 'DENY', 'LOCATION_PENDING');
-- ----------------------------
-- Table structure for ma_roles
-- ----------------------------
DROP TABLE IF EXISTS `ma_roles`;
CREATE TABLE `ma_roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`description` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`created_at` datetime(0) NULL DEFAULT NULL,
`updated_at` datetime(0) NULL DEFAULT NULL,
`protected` int(11) NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ma_roles
-- ----------------------------
INSERT INTO `ma_roles` VALUES (1, 'Admin', 'System Admin', '2020-01-01 00:00:00', '2020-01-01 00:00:00', 1);
INSERT INTO `ma_roles` VALUES (2, 'System', 'System', '2020-01-01 00:00:00', '2020-01-01 00:00:00', 1);
INSERT INTO `ma_roles` VALUES (3, 'General User', 'Basic User Role', '2020-01-01 00:00:00', '2020-01-01 00:00:00', 1);
INSERT INTO `ma_roles` VALUES (6, 'Planner', 'Planners', '2020-01-01 00:00:00', '2020-01-01 00:00:00', 0);
-- ----------------------------
-- Table structure for ma_users
-- ----------------------------
DROP TABLE IF EXISTS `ma_users`;
CREATE TABLE `ma_users` (
`user_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`first_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`last_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`locked` int(11) NULL DEFAULT 0,
`approved` int(11) NULL DEFAULT 0,
`last_login` datetime(0) NULL DEFAULT NULL,
`login_attempts` int(11) NULL DEFAULT 0,
`created_at` datetime(0) NULL DEFAULT NULL,
`updated_at` datetime(0) NULL DEFAULT NULL,
`job_description` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`contact_phone` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`user_name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of ma_users
-- ----------------------------
INSERT INTO `ma_users` VALUES ('andrew', '<EMAIL>', 'Andrew', 'Araiza', 'jonathan', 0, 1, NULL, 0, '2020-03-25 00:00:00', NULL, 'Warehouse Support', '6643284226');
INSERT INTO `ma_users` VALUES ('aron', '<EMAIL>', 'Aron', 'aron', 'jonathan', 0, 1, NULL, 0, '2020-01-25 00:00:00', NULL, 'Production Manager', '6643284226');
INSERT INTO `ma_users` VALUES ('j.araiza', '<EMAIL>', 'Jonathan', 'Araiza', 'jonathan', 0, 1, NULL, 0, '2020-06-25 00:00:00', NULL, 'App Developer', '6643284226');
INSERT INTO `ma_users` VALUES ('jose', '<EMAIL>', 'jose', 'jose', 'jonathan', 1, 1, NULL, 0, '2020-09-25 00:00:00', NULL, 'Warehouse Support', '6643284226');
INSERT INTO `ma_users` VALUES ('juan', '<EMAIL>', 'juan', 'juan', 'jonathan', 1, 1, NULL, 0, '2020-09-25 00:00:00', NULL, 'Warehouse Support', '6643284226');
INSERT INTO `ma_users` VALUES ('mama', '<EMAIL>', 'mama', 'mama', 'jonathan', 1, 1, NULL, 0, '2020-09-25 00:00:00', NULL, 'Accounting Support', 'mamamama');
INSERT INTO `ma_users` VALUES ('papa', '<EMAIL>', 'papa', 'papa', 'jonathan', 1, 1, NULL, 0, '2020-09-25 00:00:00', NULL, 'Quality Manager', 'papapapa');
INSERT INTO `ma_users` VALUES ('pepe', '<EMAIL>', 'pepe', 'pepe', 'jonathan', 1, 1, NULL, 0, '2020-09-25 00:00:00', NULL, 'Quality Support', '6643284226');
INSERT INTO `ma_users` VALUES ('raul', '<EMAIL>', 'raul', 'raul', 'jonathan', 1, 1, NULL, 0, '2020-09-25 00:00:00', NULL, 'Shipping Support', '6643284226');
INSERT INTO `ma_users` VALUES ('usuario1', '<EMAIL>', 'Usuario_1', 'Usuario_1', 'jonathan', 0, 0, NULL, 0, NULL, NULL, 'Accounting Support', '6643284226');
INSERT INTO `ma_users` VALUES ('usuario2', '<EMAIL>', 'Usuario_2', 'Usuario_2', 'jonathan', 0, 0, NULL, 0, NULL, NULL, 'Sr. App Developer', '6643284226');
INSERT INTO `ma_users` VALUES ('usuario3', '<EMAIL>', 'Usuario_3', 'Usuario_3', 'jonathan', 0, 0, NULL, 0, NULL, NULL, 'Production Manager', '6643284226');
-- ----------------------------
-- Table structure for md_approvals
-- ----------------------------
DROP TABLE IF EXISTS `md_approvals`;
CREATE TABLE `md_approvals` (
`id_approval` int(11) NOT NULL AUTO_INCREMENT,
`drafter` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`status` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`subject` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`body` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`created_at` datetime(0) NULL DEFAULT NULL,
`submit_at` datetime(0) NULL DEFAULT NULL,
`approval_hash` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`first_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'P',
`last_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'P',
`job_description` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'P',
`finished_at` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id_approval`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 151 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of md_approvals
-- ----------------------------
INSERT INTO `md_approvals` VALUES (147, 'j.araiza', 'Notified', 'Probando solo notificaciones', '<p>Probando solo notificaciones \'hola \"hola</p><p><br></p><p>\'hello\'알림 만 테스트 hello</p>', '2020-11-01 07:56:47', '2020-11-01 08:04:08', '207477b123a86cde32af0f2bbb7a59d3', 'P', 'P', 'P', '2020-11-01 08:04:08');
INSERT INTO `md_approvals` VALUES (148, 'j.araiza', 'Pending', 'Probando status concent', '<p>Probando notificaciones</p><p>\'hello\'알림 만 테스트 hello</p>', '2020-11-01 08:04:41', '2020-11-01 08:05:10', 'f1b0ea5a70ebc9bcabdec217f3f1c857', 'P', 'P', 'P', NULL);
INSERT INTO `md_approvals` VALUES (149, 'j.araiza', 'Draft', NULL, NULL, '0000-00-00 00:00:00', NULL, '17eefdd700b551e6df4766070fa7472b', '2020-11-01 08:49:05', 'Jonathan', 'Araiza', NULL);
INSERT INTO `md_approvals` VALUES (150, 'j.araiza', 'Draft', NULL, NULL, '2020-11-01 08:49:41', NULL, 'e5904067a181e8c833adcbe705945e8a', 'Jonathan', 'Araiza', 'App Developer', NULL);
-- ----------------------------
-- Table structure for md_approvals_files
-- ----------------------------
DROP TABLE IF EXISTS `md_approvals_files`;
CREATE TABLE `md_approvals_files` (
`id_file` int(11) NOT NULL AUTO_INCREMENT,
`id_approval` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_size` int(11) NULL DEFAULT NULL,
`upload_status` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id_file`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 26 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for md_approvals_users
-- ----------------------------
DROP TABLE IF EXISTS `md_approvals_users`;
CREATE TABLE `md_approvals_users` (
`id_approval` int(11) NOT NULL,
`user_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`approval_type` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`status` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`status_set_at` datetime(0) NULL DEFAULT NULL,
`receive_at` datetime(0) NULL DEFAULT NULL,
`comment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
`seq` int(11) NULL DEFAULT NULL,
`first_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`last_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`job_description` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id_approval`, `user_name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of md_approvals_users
-- ----------------------------
INSERT INTO `md_approvals_users` VALUES (147, 'andrew', 'Notification', 'Notified', '2020-11-01 08:04:08', '2020-11-01 08:04:08', '', 2, 'Andrew', 'Araiza', 'Warehouse Support');
INSERT INTO `md_approvals_users` VALUES (147, 'j.araiza', 'Notification', 'Notified', '2020-11-01 08:04:08', '2020-11-01 08:04:08', '', 3, 'Jonathan', 'Araiza', 'App Developer');
INSERT INTO `md_approvals_users` VALUES (147, 'mama', 'Notification', 'Notified', '2020-11-01 08:04:08', '2020-11-01 08:04:08', '', 1, 'mama', 'mama', 'Accounting Support');
INSERT INTO `md_approvals_users` VALUES (148, 'j.araiza', 'Concent', 'Pending', NULL, '2020-11-01 08:05:10', '', 1, 'Jonathan', 'Araiza', 'App Developer');
-- ----------------------------
-- Table structure for migrations
-- ----------------------------
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`version` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`class` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`group` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`namespace` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`time` int(11) NOT NULL,
`batch` int(11) UNSIGNED NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of migrations
-- ----------------------------
INSERT INTO `migrations` VALUES (1, '20200917080200', 'App\\Database\\Migrations\\m20200917080200', 'default', 'App', 1600398857, 1);
INSERT INTO `migrations` VALUES (2, '2020-09-18-233137', 'App\\Database\\Migrations\\AddColumnsToUsers', 'default', 'App', 1600568354, 2);
-- ----------------------------
-- Table structure for sys_emails
-- ----------------------------
DROP TABLE IF EXISTS `sys_emails`;
CREATE TABLE `sys_emails` (
`id_email` int(11) NOT NULL AUTO_INCREMENT,
`email_to` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`email_subject` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`email_body` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`created_at` datetime(0) NULL DEFAULT NULL,
`send_attempts` int(11) NULL DEFAULT 0,
`sent_at` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id_email`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for sys_files_upload
-- ----------------------------
DROP TABLE IF EXISTS `sys_files_upload`;
CREATE TABLE `sys_files_upload` (
`id` int(11) NOT NULL,
`file_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_type` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_size` int(11) NULL DEFAULT NULL,
`upload_dt` datetime(0) NULL DEFAULT NULL,
`user_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`sys_file_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`share_with` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '\'*\'',
`description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '\'\'',
`id_grp` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`tags` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_files_upload
-- ----------------------------
INSERT INTO `sys_files_upload` VALUES (68, 'Template.docx', 'application/vnd.openxmlformats-officedocument', 0, '2020-10-04 21:41:44', 'j.araiza', '1601872902_Template.docx', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\repository\\2020\\10\\68\\1601872902_Template.docx', '*', 'politica medio ambiental', '1601872904', 'politicas');
INSERT INTO `sys_files_upload` VALUES (69, 'Template.docx', 'application/vnd.openxmlformats-officedocument', 0, '2020-10-04 21:43:11', 'j.araiza', '1601872981_Template.docx', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\repository\\2020\\10\\69\\1601872981_Template.docx', '*', 'politica medio ambiental', '1601872991', 'politicas, ehs');
INSERT INTO `sys_files_upload` VALUES (70, 'Template Math.xlsx', 'application/vnd.openxmlformats-officedocument', 0, '2020-10-04 21:43:47', 'j.araiza', '1601873026_Template Math.xlsx', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\repository\\2020\\10\\70\\1601873026_Template Math.xlsx', '*', 'manual de operacion SG435', '1601873027', 'manual, SG435, instructivo');
-- ----------------------------
-- Table structure for sys_files_upload_tmp
-- ----------------------------
DROP TABLE IF EXISTS `sys_files_upload_tmp`;
CREATE TABLE `sys_files_upload_tmp` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uuid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_type` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`file_size` int(11) NULL DEFAULT NULL,
`upload_dt` datetime(0) NULL DEFAULT NULL,
`user_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`sys_file_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`tmp_file_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 91 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_files_upload_tmp
-- ----------------------------
INSERT INTO `sys_files_upload_tmp` VALUES (71, NULL, 'dedo.skp', 'SKP', 0, '2020-10-10 20:19:18', 'j.araiza', '1602386358_dedo.skp', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\t3q01qk46i78duij1b03b6giuehp9t4i\\1602386358_dedo.skp');
INSERT INTO `sys_files_upload_tmp` VALUES (72, NULL, 'dedo.stl', 'application/octet-stream', 0, '2020-10-10 20:19:18', 'j.araiza', '1602386358_dedo.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\t3q01qk46i78duij1b03b6giuehp9t4i\\1602386358_dedo.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (73, NULL, 'dedo2.stl', 'application/octet-stream', 0, '2020-10-10 20:19:19', 'j.araiza', '1602386359_dedo2.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\t3q01qk46i78duij1b03b6giuehp9t4i\\1602386359_dedo2.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (74, NULL, 'luna.stl', 'application/octet-stream', 0, '2020-10-10 20:19:19', 'j.araiza', '1602386359_luna.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\t3q01qk46i78duij1b03b6giuehp9t4i\\1602386359_luna.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (75, NULL, 'dedo.skp', 'SKP', 0, '2020-10-10 20:58:50', 'j.araiza', '1602388730_dedo.skp', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388730_dedo.skp');
INSERT INTO `sys_files_upload_tmp` VALUES (76, NULL, 'dedo.skb', 'application/octet-stream', 0, '2020-10-10 20:58:50', 'j.araiza', '1602388730_dedo.skb', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388730_dedo.skb');
INSERT INTO `sys_files_upload_tmp` VALUES (77, NULL, 'dedo.stl', 'application/octet-stream', 0, '2020-10-10 20:58:50', 'j.araiza', '1602388730_dedo.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388730_dedo.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (78, NULL, 'dedo2.stl', 'application/octet-stream', 0, '2020-10-10 20:58:50', 'j.araiza', '1602388730_dedo2.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388730_dedo2.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (79, NULL, 'dedo.skp', 'SKP', 0, '2020-10-10 20:59:06', 'j.araiza', '1602388746_dedo.skp', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388746_dedo.skp');
INSERT INTO `sys_files_upload_tmp` VALUES (80, NULL, 'dedo.skb', 'application/octet-stream', 0, '2020-10-10 20:59:06', 'j.araiza', '1602388746_dedo.skb', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388746_dedo.skb');
INSERT INTO `sys_files_upload_tmp` VALUES (81, NULL, 'dedo.stl', 'application/octet-stream', 0, '2020-10-10 20:59:06', 'j.araiza', '1602388746_dedo.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388746_dedo.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (82, NULL, 'dedo2.stl', 'application/octet-stream', 0, '2020-10-10 20:59:06', 'j.araiza', '1602388746_dedo2.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388746_dedo2.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (83, NULL, 'dedo.skp', 'SKP', 0, '2020-10-10 20:59:45', 'j.araiza', '1602388785_dedo.skp', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388785_dedo.skp');
INSERT INTO `sys_files_upload_tmp` VALUES (84, NULL, 'dedo.skb', 'application/octet-stream', 0, '2020-10-10 20:59:45', 'j.araiza', '1602388785_dedo.skb', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388785_dedo.skb');
INSERT INTO `sys_files_upload_tmp` VALUES (85, NULL, 'dedo.stl', 'application/octet-stream', 0, '2020-10-10 20:59:46', 'j.araiza', '1602388786_dedo.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388786_dedo.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (86, NULL, 'dedo2.stl', 'application/octet-stream', 0, '2020-10-10 20:59:46', 'j.araiza', '1602388786_dedo2.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602388786_dedo2.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (87, NULL, 'dedo.skb', 'application/octet-stream', 0, '2020-10-10 21:03:24', 'j.araiza', '1602389004_dedo.skb', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602389004_dedo.skb');
INSERT INTO `sys_files_upload_tmp` VALUES (88, NULL, 'dedo.skp', 'SKP', 0, '2020-10-10 21:03:25', 'j.araiza', '1602389005_dedo.skp', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602389005_dedo.skp');
INSERT INTO `sys_files_upload_tmp` VALUES (89, NULL, 'dedo.stl', 'application/octet-stream', 0, '2020-10-10 21:03:25', 'j.araiza', '1602389005_dedo.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602389005_dedo.stl');
INSERT INTO `sys_files_upload_tmp` VALUES (90, NULL, 'dedo2.stl', 'application/octet-stream', 0, '2020-10-10 21:03:25', 'j.araiza', '1602389005_dedo2.stl', 'C:\\xampp\\htdocs\\LiteMES\\writable\\uploads\\s6smq0iicaj95860me3nfocutqvrufnq\\1602389005_dedo2.stl');
-- ----------------------------
-- Table structure for testing
-- ----------------------------
DROP TABLE IF EXISTS `testing`;
CREATE TABLE `testing` (
`user_name` int(50) NOT NULL,
`first_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`last_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`user_name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of testing
-- ----------------------------
INSERT INTO `testing` VALUES (1, 'Anna', 'Krox');
INSERT INTO `testing` VALUES (2, 'Anna', 'Krox');
INSERT INTO `testing` VALUES (3, 'Anna', 'Krox');
SET FOREIGN_KEY_CHECKS = 1;
|
REM INSERTING into SYS.CLI_INST$
SET DEFINE OFF;
|
<reponame>BytelogicTech/paymentportal<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 09, 2022 at 10:15 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 8.1.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `paymentportal`
--
-- --------------------------------------------------------
--
-- Table structure for table `adjustments`
--
CREATE TABLE `adjustments` (
`id` bigint(20) UNSIGNED NOT NULL,
`merchant_fk_id` bigint(20) UNSIGNED NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`details` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `adjustments`
--
INSERT INTO `adjustments` (`id`, `merchant_fk_id`, `type`, `details`, `remarks`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 1, 'Currency Conversion', 'INR 200 converted to USD 300', 'Adjustment Remarks', 1, '2022-04-01 04:15:37', '2022-04-01 04:15:37'),
(2, 2, 'Currency Conversion', 'USD 300 converted to INR 400', 'Ad.. remars1', 1, '2022-04-01 04:16:29', '2022-04-01 04:16:29'),
(3, 3, 'Currency Conversion', 'BYR 400 converted to INR 600', 'Hello Remarks', 1, '2022-04-01 04:17:22', '2022-04-01 04:17:22'),
(4, 1, 'Tier Commission', 'Date From: 2022-04-01 | Date To: 2022-04-08 | Incoming Percentage 10 | RR Percentage 20 | Payout Percentage 200 | B2B Percentage 12 | Remarks: Ad.. Remarks', 'Ad.. Remarks', 1, '2022-04-01 04:21:30', '2022-04-01 04:21:30'),
(5, 2, 'RR Adjustment', 'INR 30 ( Credit ) Remarks: Other Adjustment', 'Other Adjustment 2', 1, '2022-04-01 04:22:43', '2022-04-07 03:39:19');
-- --------------------------------------------------------
--
-- Table structure for table `banks`
--
CREATE TABLE `banks` (
`id` bigint(20) UNSIGNED NOT NULL,
`beneficiary_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`beneficiary_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_nickname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bank_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`zip_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`swift_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`company_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`company_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`prefix` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`declaration_content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`instructions_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`instructions_content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`logo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `banks`
--
INSERT INTO `banks` (`id`, `beneficiary_name`, `beneficiary_address`, `bank_nickname`, `bank_name`, `bank_address`, `zip_code`, `country`, `swift_code`, `remarks`, `company_name`, `company_email`, `prefix`, `declaration_content`, `instructions_title`, `instructions_content`, `logo`, `status`, `created_at`, `updated_at`, `created_by`) VALUES
(1, '<NAME>', 'Mumbai', 'Hitman', 'HDFC', 'Mumbai', '220320', 'India', 'PUNB01234', 'Bank Remarks', 'Lenovo', '<EMAIL>', 'Prefix9090', 'Declaration Content', 'Instruction Message', 'Instruction Content', '1648802707.jpg', 1, '2022-04-01 03:15:07', '2022-04-01 03:15:07', 1),
(2, '<NAME>', 'New Delhi', 'Chicku', 'Axis Bank', 'New Delhi', '202303', 'India', 'AXIX89089', 'Virat Remarks', 'Puma', '<EMAIL>', 'Virat Prefix', 'Virat Content', 'Virat tittle', 'Virat Istruction', '1648802972.jpg', 1, '2022-04-01 03:19:32', '2022-04-01 03:19:32', 1),
(3, '<NAME>', 'Punjab', 'Yuvi', 'Punjab Bank', 'Chandigarh', '998990', 'American Samoa', 'PUNB9900', 'Yuvi Remarks', 'yuvi company', '<EMAIL>', 'Yuvi Prefix', 'Yuvi Content', 'Yuvi Tittle', 'Yuvi Content', '1648803314.jpg', 1, '2022-04-01 03:25:14', '2022-04-01 03:25:49', 1),
(4, 'Hello Bank', 'Noida', NULL, 'HDFC', 'noida', NULL, 'American Samoa', 'PUNB01234', NULL, '12345678', NULL, '4523', NULL, NULL, NULL, '', 1, '2022-04-04 22:51:20', '2022-04-04 22:53:25', 5);
-- --------------------------------------------------------
--
-- Table structure for table `bank_accounts`
--
CREATE TABLE `bank_accounts` (
`id` bigint(20) UNSIGNED NOT NULL,
`bank_id` bigint(20) UNSIGNED NOT NULL,
`currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`account_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`nick_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_charges` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `bank_accounts`
--
INSERT INTO `bank_accounts` (`id`, `bank_id`, `currency`, `account_number`, `nick_name`, `bank_charges`, `created_at`, `updated_at`, `created_by`) VALUES
(1, 1, 'INR', '444455556666', 'Hitman', '100', '2022-04-01 03:15:07', '2022-04-01 03:15:07', 1),
(2, 1, 'INR', '999988887777', 'Hitman', '200', '2022-04-01 03:15:07', '2022-04-01 03:15:07', 1),
(3, 2, 'INR', '333344445555', 'Chicku', '230', '2022-04-01 03:19:32', '2022-04-01 03:19:32', 1),
(4, 2, 'INR', '999900008888', 'Anushka', '320', '2022-04-01 03:19:32', '2022-04-01 03:19:32', 1),
(5, 3, 'USD', '89897676766', 'Yuvi', '600', '2022-04-01 03:25:14', '2022-04-01 03:25:14', 1),
(6, 3, 'USD', '787755664433', 'yuvi', '220', '2022-04-01 03:25:14', '2022-04-01 03:25:14', 1),
(7, 4, 'ALL', '90909', 'NickName', '765', '2022-04-04 22:51:20', '2022-04-04 22:51:20', 5);
-- --------------------------------------------------------
--
-- Table structure for table `bank_account_payouts`
--
CREATE TABLE `bank_account_payouts` (
`id` bigint(20) UNSIGNED NOT NULL,
`customer_fk_id` bigint(20) UNSIGNED NOT NULL,
`beneficiary_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`beneficiary_nickname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`beneficiary_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`beneficiary_country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_branch` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_swift` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`account_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remarks` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`intermediary_bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_swift` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_details_remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `bank_account_payouts`
--
INSERT INTO `bank_account_payouts` (`id`, `customer_fk_id`, `beneficiary_name`, `beneficiary_nickname`, `beneficiary_address`, `beneficiary_country`, `bank_name`, `bank_branch`, `bank_address`, `bank_country`, `bank_swift`, `account_number`, `currency`, `remarks`, `intermediary_bank_name`, `intermediary_bank_address`, `intermediary_bank_swift`, `intermediary_bank_details_remarks`, `created_at`, `updated_at`, `created_by`) VALUES
(1, 1, 'Surajsingh', 'SurajNick', 'Noida', 'India', 'SBI', 'Gwalior', 'Gwalior Address', 'India', 'suraj swift', '999988887777', 'INR', 'Suraj Remarks', 'Intermediary bank', 'Intermediary address', 'Intermediary bank optional', 'Remarks optional', '2022-04-01 03:42:50', '2022-04-01 03:42:50', 1),
(2, 2, 'Punjab', 'PNB', 'Chandigarh', 'India', 'Punjab Bank', 'Chandigarh', 'Chandigarh', 'India', 'Dheeraj Swift 2', '777766665555', 'INR', 'Dheeraj Remarks', 'Intermediary Bank Name2', 'Intermediary address', 'intermediary bank swift', 'intermediary bank details optional', '2022-04-01 03:46:21', '2022-04-01 03:46:21', 1),
(3, 3, 'Dheeraj', 'Dheeru', 'Unnao', 'India', 'ICICI', 'Unnao', 'Unnao', 'India', 'Dheeraj swift', '888877779999', 'INR', 'Dheeraj Remarks', 'Intermediary Bank Name22', 'Intermediary bank address Optional22', 'intermediary bank swift22', 'intermediary bank details optional22', '2022-04-01 03:50:32', '2022-04-01 03:50:32', 1),
(4, 4, 'Rahul', 'Rahu', 'Gurugram', 'India', 'CBI', 'Gurugram', 'Gurugram', 'India', 'R Bank Swift', '222299993333', 'INR', 'Rahul Remarks', 'Intermediary Bank Name2', 'Intermediary bank address Optional', 'intermediary bank swift', 'intermediary bank details optional', '2022-04-01 22:22:57', '2022-04-01 22:22:57', 1),
(5, 5, 'SUN', 'SUN', 'SUN Address', 'India', 'PNB', 'Dabra', 'Dabra', 'India', 'Bank Swift 2', '9988889900', 'INR', 'SUN Remarks', 'Hello Remarks Optional', 'Intermediary bank address Optional', 'intermediary bank swift', 'intermediary bank details optional', '2022-04-02 01:11:24', '2022-04-02 01:11:24', 2),
(6, 6, 'suraj', 'suraj', 'sss', 'India', 'dsdx', 'ds', 'xsz', 'Algeria', 'dsx', '26768', 'AED', 'wde', NULL, NULL, NULL, NULL, '2022-04-04 22:33:18', '2022-04-04 22:33:18', 5),
(7, 7, '<NAME>', '<NAME>', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'India', 'Bank Name', 'Noida', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'Algeria', 'fewsz', '90909', 'DZD', 'Hello Remarks', NULL, NULL, NULL, NULL, '2022-04-07 00:24:09', '2022-04-07 00:24:09', 5),
(8, 8, 'virat 2', '<NAME>', 'hp', 'Afganistan', 'HDFC', 'Mumbai', 'hp', 'Albania', 'fewsz', 'ery53e', 'USD', 'gvbdfx', 'Intermediary Bank Name2', 'fe', 'intermediary bank swift22', 'intermediary bank details optional', '2022-04-07 01:35:30', '2022-04-07 01:35:30', 5),
(9, 9, 'virat 2', '<NAME>', 'hp', 'Algeria', 'HDFC', 'Noida', 'hp', 'American Samoa', 'Bank Swift 2', '90909', 'EUR', 'Hello Remarks', 'Intermediary Bank Name2', 'Intermediary bank address Optional', 'intermediary bank swift', 'intermediary bank details optional', '2022-04-07 05:48:51', '2022-04-07 05:48:51', 5),
(10, 10, 'virat 2', '<NAME>', 'hp', 'India', '4', 'Noida', 'Madhya Pradesh', 'Albania', 'Bank Swift 2', '90909', 'GBP', 'Hello Remarks', 'Intermediary Bank Name2', 'Intermediary bank address Optional', 'intermediary bank swift', 'intermediary bank details optional', '2022-04-07 05:51:05', '2022-04-07 05:51:05', 2),
(11, 11, 'virat 2', '<NAME>', 'mp', 'Afganistan', 'HDFC', 'Noida', 'mp', 'Afganistan', 'Bank Swift 2', '90909', 'USD', 'Hello Remarks', 'Intermediary bank', 'inter Name', 'Intermediary bank optional', 'intermediary bank details optional22', '2022-04-07 06:59:00', '2022-04-07 06:59:00', 2),
(12, 12, 'virat 2', '<NAME>', 'mp', 'American Samoa', 'HDFC', 'Noida', 'mp', 'Albania', 'Bank Swift 2', '90909', 'GBP', 'Rahul Remarks', 'Intermediary Bank Name2', 'Intermediary bank address Optional', 'Swift', 'Remarks optional', '2022-04-07 22:47:06', '2022-04-07 22:47:06', 5),
(13, 13, 'virat 2', '<NAME>', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'India', 'HDFC', 'Noida', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'Afganistan', 'Bank Swift 2', '90909', 'USD', 'Hello Remarks', NULL, NULL, NULL, NULL, '2022-04-08 01:56:23', '2022-04-08 01:56:23', 12),
(14, 14, '<NAME>', 'Tomar', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'India', 'HDFC', 'Noida', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'American Samoa', 'Bank Swift 2', '90909', 'EUR', 'Hello Remarks', 'Intermediary Bank Name2', 'Intermediary bank address Optional', 'intermediary bank swift22', 'intermediary bank details optional22', '2022-04-08 06:34:13', '2022-04-08 06:34:13', 2);
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE `customers` (
`id` bigint(20) UNSIGNED NOT NULL,
`merchant_fk_id` bigint(20) UNSIGNED NOT NULL,
`first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`date_of_birth` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `customers`
--
INSERT INTO `customers` (`id`, `merchant_fk_id`, `first_name`, `last_name`, `email`, `phone`, `address`, `country`, `date_of_birth`, `id_number`, `status`, `created_at`, `updated_at`, `created_by`) VALUES
(1, 1, 'Suraj', 'Singh', '<EMAIL>', '8979797787', 'Gwalior', 'India', '2022-04-22', '909090', 1, '2022-04-01 03:42:50', '2022-04-01 03:42:50', 1),
(2, 2, 'Dheeraj', 'Pal', '<EMAIL>', '78769666669', 'Unnao', 'India', '2022-05-01', '78777979', 1, '2022-04-01 03:46:21', '2022-04-01 03:46:21', 1),
(3, 3, 'Keshav', 'Singh', '<EMAIL>', '9889766755', 'Ghaziabad', 'India', '2022-04-14', '686687', 1, '2022-04-01 03:50:32', '2022-04-01 03:50:32', 1),
(4, 2, 'Rahul', 'Sharma', '<EMAIL>', '9889766777', 'Gurugram', 'India', '2022-04-02', '770', 1, '2022-04-01 22:22:57', '2022-04-01 22:22:57', 1),
(5, 8, '<NAME>', 'Singh22', '<EMAIL>', '9967547546', 'Bhind', 'India', '2022-04-03', NULL, 1, '2022-04-02 01:11:24', '2022-04-07 05:08:22', 2),
(6, 8, 'Suraj11', 'Singh', '<EMAIL>', '9770286553', NULL, 'Albania', NULL, NULL, 1, '2022-04-04 22:33:18', '2022-04-05 05:37:13', 5),
(7, 3, 'Suraj', 'Singh', '<EMAIL>', '08770286553', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'India', '2022-04-24', '898', 1, '2022-04-07 00:24:09', '2022-04-07 00:24:09', 5),
(8, 3, 'Hello', 'Suraj', '<EMAIL>', '989897709', 'HP', 'India', NULL, NULL, 1, '2022-04-07 01:35:30', '2022-04-07 01:35:30', 5),
(9, 4, 'Hello', 'Suraj', '<EMAIL>', '909087908', 'HP', 'American Samoa', '2022-04-09', '909', 1, '2022-04-07 05:48:51', '2022-04-07 05:48:51', 5),
(10, 1, 'Suraj', 'Singh', '<EMAIL>', '8908889', 'hp', 'American Samoa', NULL, NULL, 1, '2022-04-07 05:51:05', '2022-04-07 05:51:05', 2),
(11, 8, 'Suraj', 'Singh', '<EMAIL>', '79879809', 'mp', 'American Samoa', NULL, NULL, 1, '2022-04-07 06:59:00', '2022-04-07 06:59:12', 2),
(12, 8, 'Rajesh', 'Singh', '<EMAIL>', '08098098908', 'mp', 'American Samoa', '2022-04-20', '90', 1, '2022-04-07 22:47:06', '2022-04-08 01:55:25', 5),
(13, 9, 'Suraj', 'Singh', '<EMAIL>', '08770286553', 'Madhya Pradesh', 'India', NULL, NULL, 1, '2022-04-08 01:56:23', '2022-04-08 06:31:02', 12),
(14, 1, 'Suraj', 'Singh', '<EMAIL>', '08770286553', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'India', '2022-04-24', '78777979', 1, '2022-04-08 06:34:13', '2022-04-08 06:34:13', 2);
-- --------------------------------------------------------
--
-- Table structure for table `customer_documents`
--
CREATE TABLE `customer_documents` (
`id` bigint(20) UNSIGNED NOT NULL,
`customer_fk_id` bigint(20) UNSIGNED NOT NULL,
`document_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`upload_file` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `customer_documents`
--
INSERT INTO `customer_documents` (`id`, `customer_fk_id`, `document_type`, `upload_file`, `created_at`, `updated_at`, `created_by`) VALUES
(1, 1, 'photo_id', '', '2022-04-01 03:42:50', '2022-04-01 03:42:50', 1),
(2, 2, 'bank_statement', '', '2022-04-01 03:46:21', '2022-04-01 03:46:21', 1),
(3, 3, 'photo_id', '', '2022-04-01 03:50:32', '2022-04-01 03:50:32', 1),
(4, 4, 'photo_id', '', '2022-04-01 22:22:57', '2022-04-01 22:22:57', 1),
(5, 5, 'photo_id', '', '2022-04-02 01:11:25', '2022-04-02 01:11:25', 2),
(6, 6, 'bank_statement', '', '2022-04-04 22:33:18', '2022-04-04 22:33:18', 5),
(7, 7, 'photo_id', '', '2022-04-07 00:24:09', '2022-04-07 00:24:09', 5),
(8, 8, 'photo_id', '', '2022-04-07 01:35:30', '2022-04-07 01:35:30', 5),
(9, 9, 'photo_id', '', '2022-04-07 05:48:51', '2022-04-07 05:48:51', 5),
(10, 10, 'photo_id', '', '2022-04-07 05:51:05', '2022-04-07 05:51:05', 2),
(11, 11, 'photo_id', '', '2022-04-07 06:59:00', '2022-04-07 06:59:00', 2),
(12, 12, 'photo_id', '', '2022-04-07 22:47:06', '2022-04-07 22:47:06', 5),
(13, 13, 'photo_id', '', '2022-04-08 01:56:23', '2022-04-08 01:56:23', 12),
(14, 14, 'photo_id', '', '2022-04-08 06:34:13', '2022-04-08 06:34:13', 2);
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`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()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `loggers`
--
CREATE TABLE `loggers` (
`id` bigint(20) UNSIGNED NOT NULL,
`itemid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`module` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `loggers`
--
INSERT INTO `loggers` (`id`, `itemid`, `module`, `action`, `created_by`, `created_at`, `updated_at`) VALUES
(20, '1', 'transaction', 'update', 5, '2022-04-07 05:01:07', '2022-04-07 05:01:07'),
(21, '7', 'payout', 'add', 0, '2022-04-07 05:02:27', '2022-04-07 05:02:27'),
(22, '7', 'payout', 'update', 0, '2022-04-07 05:03:44', '2022-04-07 05:03:44'),
(23, '7', 'payout', 'update', 5, '2022-04-07 05:04:47', '2022-04-07 05:04:47'),
(24, '5', 'adjustment', 'update', 5, '2022-04-07 05:06:16', '2022-04-07 05:06:16'),
(25, '1', 'settlement', 'update', 5, '2022-04-07 05:07:15', '2022-04-07 05:07:15'),
(26, '4', 'settlementaccount', 'delete', 5, '2022-04-07 05:07:51', '2022-04-07 05:07:51'),
(27, '5', 'customer', 'update', 5, '2022-04-07 05:08:22', '2022-04-07 05:08:22'),
(28, '8', 'user', 'update', 5, '2022-04-07 05:09:45', '2022-04-07 05:09:45'),
(29, '8', 'merchant', 'update', 5, '2022-04-07 05:11:12', '2022-04-07 05:11:12'),
(30, '2', 'bank', 'update', 5, '2022-04-07 05:11:37', '2022-04-07 05:11:37'),
(31, '5', 'transaction', 'update', 2, '2022-04-07 05:22:52', '2022-04-07 05:22:52'),
(32, '9', 'customer', 'add', 5, '2022-04-07 05:48:51', '2022-04-07 05:48:51'),
(33, '10', 'customer', 'add', 2, '2022-04-07 05:51:05', '2022-04-07 05:51:05'),
(34, '1', 'transaction', 'update', 2, '2022-04-07 06:12:24', '2022-04-07 06:12:24'),
(35, '6', 'transaction', 'add', 2, '2022-04-07 06:17:14', '2022-04-07 06:17:14'),
(36, '3', 'settlementaccount', 'update', 2, '2022-04-07 06:57:47', '2022-04-07 06:57:47'),
(37, '7', 'transaction', 'add', 2, '2022-04-07 07:06:32', '2022-04-07 07:06:32'),
(38, '8', 'transaction', 'add', 2, '2022-04-07 22:54:37', '2022-04-07 22:54:37'),
(39, '5', 'settlementaccount', 'add', 12, '2022-04-08 01:49:09', '2022-04-08 01:49:09'),
(40, '9', 'payout', 'add', 12, '2022-04-08 01:54:38', '2022-04-08 01:54:38'),
(41, '12', 'user', 'update', 12, '2022-04-08 01:56:35', '2022-04-08 01:56:35'),
(42, '10', 'payout', 'add', 2, '2022-04-08 02:51:37', '2022-04-08 02:51:37'),
(43, '11', 'payout', 'add', 7, '2022-04-08 03:05:35', '2022-04-08 03:05:35'),
(44, '12', 'payout', 'add', 2, '2022-04-08 03:41:02', '2022-04-08 03:41:02'),
(45, '2', 'settlement', 'add', 2, '2022-04-08 03:50:40', '2022-04-08 03:50:40'),
(46, '6', 'settlementaccount', 'add', 2, '2022-04-08 03:51:57', '2022-04-08 03:51:57'),
(47, '9', 'settlement', 'add', 2, '2022-04-08 04:01:18', '2022-04-08 04:01:18'),
(48, '10', 'settlement', 'add', 2, '2022-04-08 04:11:52', '2022-04-08 04:11:52'),
(49, '11', 'settlement', 'add', 2, '2022-04-08 04:30:51', '2022-04-08 04:30:51'),
(50, '2', 'transaction', 'update', 7, '2022-04-08 05:14:03', '2022-04-08 05:14:03'),
(51, '13', 'payout', 'add', 7, '2022-04-08 05:27:26', '2022-04-08 05:27:26'),
(52, '14', 'payout', 'add', 7, '2022-04-08 05:40:33', '2022-04-08 05:40:33'),
(53, '15', 'settlement', 'add', 7, '2022-04-08 05:43:30', '2022-04-08 05:43:30'),
(54, '9', 'merchant', 'add', 5, '2022-04-08 06:04:25', '2022-04-08 06:04:25'),
(55, '1', 'transaction', 'update', 2, '2022-04-08 06:14:41', '2022-04-08 06:14:41'),
(56, '9', 'transaction', 'add', 2, '2022-04-08 06:15:09', '2022-04-08 06:15:09'),
(57, '15', 'payout', 'add', 2, '2022-04-08 06:23:42', '2022-04-08 06:23:42'),
(58, '7', 'settlementaccount', 'add', 2, '2022-04-08 06:28:03', '2022-04-08 06:28:03'),
(59, '16', 'payout', 'add', 2, '2022-04-09 00:37:38', '2022-04-09 00:37:38'),
(60, '10', 'transaction', 'add', 2, '2022-04-09 00:38:00', '2022-04-09 00:38:00'),
(61, '16', 'settlement', 'add', 2, '2022-04-09 00:38:15', '2022-04-09 00:38:15'),
(62, '8', 'settlementaccount', 'add', 2, '2022-04-09 00:38:49', '2022-04-09 00:38:49'),
(63, '10', 'transaction', 'update', 2, '2022-04-09 01:02:44', '2022-04-09 01:02:44');
-- --------------------------------------------------------
--
-- Table structure for table `mailboxes`
--
CREATE TABLE `mailboxes` (
`id` bigint(20) UNSIGNED NOT NULL,
`from_id` bigint(20) UNSIGNED NOT NULL,
`to_id` bigint(20) UNSIGNED NOT NULL,
`subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`message` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `mailboxes`
--
INSERT INTO `mailboxes` (`id`, `from_id`, `to_id`, `subject`, `message`, `created_at`, `updated_at`) VALUES
(3, 5, 6, 'hello testing email from admin to suraj merchant superadmin', 'hello testing email', '2022-04-04 04:02:49', '2022-04-04 04:02:49'),
(4, 5, 7, 'hello dheeraj', 'hello dheeraj testing email', '2022-04-04 04:06:00', '2022-04-04 04:06:00'),
(6, 6, 5, 'hello mail from merchant to admin', 'fdsfd', '2022-04-04 04:15:36', '2022-04-04 04:15:36'),
(7, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:15:42', '2022-04-04 05:15:42'),
(8, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:16:19', '2022-04-04 05:16:19'),
(9, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:16:39', '2022-04-04 05:16:39'),
(10, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:16:54', '2022-04-04 05:16:54'),
(11, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:18:20', '2022-04-04 05:18:20'),
(12, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:18:37', '2022-04-04 05:18:37'),
(13, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:19:01', '2022-04-04 05:19:01'),
(14, 6, 5, 'hello testing from gmail', 'helo gmail', '2022-04-04 05:23:15', '2022-04-04 05:23:15');
-- --------------------------------------------------------
--
-- Table structure for table `merchants`
--
CREATE TABLE `merchants` (
`id` bigint(20) UNSIGNED NOT NULL,
`merchant_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_account_id` bigint(20) UNSIGNED NOT NULL,
`first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`Country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`secondary_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`invoice_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`payout_notification_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`settlement_notification_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`payout_notification_email_admin` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`settlement_notification_email_admin` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`incoming_percentage` double NOT NULL,
`payout_percentage` double NOT NULL,
`alternate_payout_commission` int(11) DEFAULT NULL,
`b2b_percentage` double NOT NULL,
`rolling_reserve_percentage` double NOT NULL,
`rolling_reserve_release_days` int(11) NOT NULL,
`website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`customer_support_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`invoice_remarks` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`enable_mail_for_customers` tinyint(1) NOT NULL,
`company_details_on_left` tinyint(1) NOT NULL,
`invoice_details_on_right` tinyint(1) NOT NULL,
`b2b_access` tinyint(1) NOT NULL,
`status` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `merchants`
--
INSERT INTO `merchants` (`id`, `merchant_name`, `bank_account_id`, `first_name`, `last_name`, `email`, `Country`, `secondary_email`, `invoice_email`, `payout_notification_email`, `settlement_notification_email`, `payout_notification_email_admin`, `settlement_notification_email_admin`, `incoming_percentage`, `payout_percentage`, `alternate_payout_commission`, `b2b_percentage`, `rolling_reserve_percentage`, `rolling_reserve_release_days`, `website`, `customer_support_number`, `invoice_remarks`, `upload_logo`, `enable_mail_for_customers`, `company_details_on_left`, `invoice_details_on_right`, `b2b_access`, `status`, `created_at`, `updated_at`, `created_by`) VALUES
(1, '<NAME>', 1, 'Kartik', 'Aaryan', '<EMAIL>', 'India', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', 9, 8, 7, 6, 5, 4, 'bytelogic', '9988776655', 'Merchant Remarks', '1648803557.jpg', 1, 1, 1, 1, 1, '2022-04-01 03:29:17', '2022-04-01 03:29:17', 1),
(2, '<NAME>', 3, 'Akshay', 'Kumar', '<EMAIL>', 'India', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', 2, 3, 4, 5, 6, 7, 'Akshay Website', '890877779', 'Akshay Remarks', '1648803807.jpg', 1, 1, 1, 1, 1, '2022-04-01 03:33:27', '2022-04-01 03:33:27', 1),
(3, '<NAME>', 5, 'Ranveer', 'Kapoor', '<EMAIL>', 'India', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', 8, 3, 4, 2, 5, 7, 'Ranveer website', '8979797972', 'Ranveer Remarks', '1648804019.jpg', 1, 1, 1, 1, 1, '2022-04-01 03:36:59', '2022-04-01 03:36:59', 1),
(4, 'suraj merchant', 1, 'suraj', 'Bhadoriya', '<EMAIL>', 'Indonesia', NULL, NULL, NULL, NULL, NULL, NULL, 5, 5, NULL, 5, 5, 9, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2022-04-04 03:57:39', '2022-04-04 03:57:39', 5),
(5, 'dheeraj merchant', 3, 'Dheeraj', 'Pal', '<EMAIL>', 'Azerbaijan', NULL, NULL, NULL, NULL, NULL, NULL, 5, 5, NULL, 5, 5, 5, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2022-04-04 04:05:39', '2022-04-04 04:05:39', 5),
(8, 'Hello merchant', 3, 'Suraj', 'Singh', '<EMAIL>', 'India', NULL, NULL, NULL, NULL, NULL, NULL, 4324, 4, 4, 4, 4, 4, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2022-04-04 23:41:00', '2022-04-04 23:41:00', 5),
(9, 'Hello merchant', 2, 'Suraj', 'Singh', '<EMAIL>', 'India', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>', NULL, 10, 200, NULL, 9, 9, 5, 'digimonk', '8979797979789', 'hello', NULL, 1, 1, 1, 1, 1, '2022-04-08 06:04:24', '2022-04-08 06:04:24', 5);
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2022_03_07_081250_create_banks_table', 1),
(6, '2022_03_07_090333_create_bank_accounts', 1),
(7, '2022_03_10_062625_create_merchants_table', 1),
(8, '2022_03_13_145534_create_customers_table', 1),
(9, '2022_03_13_154645_create_bank_account_payouts_table', 1),
(10, '2022_03_14_081522_create_customer_documents_table', 1),
(11, '2022_03_15_084408_create_transactions_table', 1),
(12, '2022_03_22_060642_create_payouts_table', 1),
(14, '2022_03_27_163846_create_settlement_accounts_table', 1),
(15, '2022_03_31_054604_create_adjustments_table', 1),
(16, '2022_03_24_111642_create_settlements_table', 2),
(17, '2022_04_04_060708_create_mailboxes_table', 3),
(18, '2022_04_07_051646_create_loggers_table', 4);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `payouts`
--
CREATE TABLE `payouts` (
`id` bigint(20) UNSIGNED NOT NULL,
`bank_account_to_fk_id` bigint(20) UNSIGNED NOT NULL,
`merchant_fk_id` bigint(20) UNSIGNED NOT NULL,
`customer_fk_id` bigint(20) UNSIGNED NOT NULL,
`payout_amount` double NOT NULL,
`remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`reference_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_invoice` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_processing_charges` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
`date_paid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`amount_returned` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
`rejected_onhold_remarks` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_reciept` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bank_account_from_fk_id` bigint(20) UNSIGNED NOT NULL,
`status_of_payout` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`upload_extra_document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `payouts`
--
INSERT INTO `payouts` (`id`, `bank_account_to_fk_id`, `merchant_fk_id`, `customer_fk_id`, `payout_amount`, `remarks`, `notes`, `reference_id`, `upload_invoice`, `bank_processing_charges`, `date_paid`, `amount_returned`, `rejected_onhold_remarks`, `upload_reciept`, `bank_account_from_fk_id`, `status_of_payout`, `upload_extra_document`, `created_at`, `updated_at`, `created_by`) VALUES
(1, 1, 1, 1, 1000, 'Shopping', NULL, '9908', '1648805167.jpg', '0', NULL, '0', NULL, '1648805167.jpg', 1, 'Paid', NULL, '2022-04-01 03:56:07', '2022-04-07 03:05:56', 5),
(2, 2, 2, 2, 20000, 'Laptop', NULL, '787', '1648805208.jpg', '0', NULL, '0', NULL, '1648805208.jpg', 3, 'Hold', NULL, '2022-04-01 03:56:48', '2022-04-01 03:56:48', 1),
(3, 3, 3, 3, 3000, 'Car Shopping', NULL, '909', '1648805268.jpg', '0', NULL, '0', NULL, '1648805268.jpg', 5, 'Canceled', NULL, '2022-04-01 03:57:48', '2022-04-01 03:57:48', 1),
(4, 2, 2, 2, 66, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 2, 'New', NULL, '2022-04-04 23:07:00', '2022-04-04 23:07:00', 5),
(5, 4, 2, 4, 22, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 2, 'New', NULL, '2022-04-04 23:09:42', '2022-04-04 23:09:42', 5),
(6, 1, 1, 1, 545, NULL, NULL, NULL, '1649139888.jpg', '0', NULL, '0', NULL, '1649139888.pdf', 3, 'New', NULL, '2022-04-05 00:54:48', '2022-04-05 00:54:48', 5),
(7, 4, 2, 4, 900, 'hello', NULL, '099', '1649327547.png', '0', NULL, '0', NULL, '1649327547.png', 2, 'Hold', NULL, '2022-04-07 05:02:27', '2022-04-07 05:02:27', 5),
(9, 2, 2, 2, 900, 'Hello Remarks', NULL, '09', '', '0', NULL, '0', NULL, '', 2, 'New', NULL, '2022-04-08 01:54:38', '2022-04-08 01:54:38', 12),
(10, 10, 1, 10, 900, 'Hello Remarks', NULL, '09', '', '0', NULL, '0', NULL, '', 2, 'New', NULL, '2022-04-08 02:51:37', '2022-04-08 02:51:37', 2),
(11, 13, 2, 13, 900, 'Hello Remarks', NULL, '09', '', '0', NULL, '0', NULL, '', 2, 'New', NULL, '2022-04-08 03:05:35', '2022-04-08 03:05:35', 7),
(12, 1, 1, 1, 5435, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 1, 'New', NULL, '2022-04-08 03:41:02', '2022-04-08 03:41:02', 2),
(13, 2, 2, 2, 700, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 3, 'New', NULL, '2022-04-08 05:27:26', '2022-04-08 05:27:26', 7),
(14, 2, 2, 2, 900, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 3, 'New', NULL, '2022-04-08 05:40:33', '2022-04-08 05:40:33', 7),
(15, 1, 1, 1, 900, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 1, 'New', NULL, '2022-04-08 06:23:42', '2022-04-08 06:23:42', 2),
(16, 2, 2, 2, 900, NULL, NULL, NULL, '', '0', NULL, '0', NULL, '', 3, 'New', NULL, '2022-04-09 00:37:38', '2022-04-09 00:37:38', 2);
-- --------------------------------------------------------
--
-- Table structure for table `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint(20) UNSIGNED NOT NULL,
`tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint(20) 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 DEFAULT NULL,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `settlements`
--
CREATE TABLE `settlements` (
`id` bigint(20) UNSIGNED NOT NULL,
`merchant_fk_id` bigint(20) UNSIGNED NOT NULL,
`bank_account_from_fk_id` bigint(20) UNSIGNED NOT NULL,
`bank_account_to_fk_id` bigint(20) UNSIGNED NOT NULL,
`settlement_amount` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`upload_settlement_invoice` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remarks` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`reference_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`rr_settlement` tinyint(1) DEFAULT NULL,
`status_of_settlement` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`date_paid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `settlements`
--
INSERT INTO `settlements` (`id`, `merchant_fk_id`, `bank_account_from_fk_id`, `bank_account_to_fk_id`, `settlement_amount`, `upload_settlement_invoice`, `remarks`, `reference_id`, `rr_settlement`, `status_of_settlement`, `date_paid`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 2, 2, 2, '1222', NULL, NULL, NULL, 1, 'Processing', NULL, 5, '2022-04-04 06:46:13', '2022-04-04 06:52:05'),
(2, 1, 1, 1, '100', '1649409640.jpg', 'remarks', 'ref_909', 0, NULL, NULL, 2, '2022-04-08 03:50:40', '2022-04-08 03:50:40'),
(9, 1, 3, 1, '100', '1649410278.jpg', 'hello', '90', 0, NULL, NULL, 2, '2022-04-08 04:01:18', '2022-04-08 04:01:18'),
(10, 1, 3, 6, '100', '1649410912.jpg', 'hlo', '22', 0, NULL, NULL, 2, '2022-04-08 04:11:52', '2022-04-08 04:11:52'),
(11, 1, 1, 1, '100', '1649412051.jpg', 'hello', '22', 0, NULL, NULL, 2, '2022-04-08 04:30:51', '2022-04-08 04:30:51'),
(15, 2, 3, 2, '100', NULL, NULL, NULL, 0, NULL, NULL, 7, '2022-04-08 05:43:30', '2022-04-08 05:43:30'),
(16, 2, 3, 2, '100', NULL, NULL, NULL, 0, NULL, NULL, 2, '2022-04-09 00:38:15', '2022-04-09 00:38:15');
-- --------------------------------------------------------
--
-- Table structure for table `settlement_accounts`
--
CREATE TABLE `settlement_accounts` (
`id` bigint(20) UNSIGNED NOT NULL,
`merchant_fk_id` bigint(20) UNSIGNED NOT NULL,
`beneficiary_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`beneficiary_nickname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`beneficiary_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bank_branch` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bank_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bank_country` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bank_swift` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`account_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`currency` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_swift` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`intermediary_bank_details_remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_bank_statement` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `settlement_accounts`
--
INSERT INTO `settlement_accounts` (`id`, `merchant_fk_id`, `beneficiary_name`, `beneficiary_nickname`, `beneficiary_address`, `bank_name`, `bank_branch`, `bank_address`, `bank_country`, `bank_swift`, `account_number`, `currency`, `remarks`, `intermediary_bank_name`, `intermediary_bank_address`, `intermediary_bank_swift`, `intermediary_bank_details_remarks`, `upload_bank_statement`, `created_at`, `updated_at`) VALUES
(1, 1, 'Suraj', 'Suraj', 'Gwalior', 'SBI', 'Gwalior', 'Gwalior', 'India', 'Suraj Swift', '999988887777', 'INR', 'Suraj Remarks', 'Inter Bank Name', 'Inter Bank Address', 'Inter Bank Swift', 'Inter Bank Remarks', '1648806055.jpg', '2022-04-01 04:10:55', '2022-04-01 04:10:55'),
(2, 2, 'Dheeraj', 'Dheeraj', 'Unnao', 'Unnao', 'Unnao', 'Unnao', 'India', 'Dheeraj Swift', '888899997777', 'INR', 'Dheeraj Remarks', 'Inter Bank Name', 'Inter Bank Address', 'Inter Bank Swift', 'Inter Bank Remarks', '1648806159.jpg', '2022-04-01 04:12:39', '2022-04-01 04:12:39'),
(3, 3, 'Keshav', 'Keshav', 'Noida', 'Noida', 'Noida', 'Noida', 'India', 'Keshav Swift', '66665555444', NULL, 'Keshav Remarks', 'Inter Bank Name', 'Inter Bank Address', 'Inter Bank Swift', 'Inter Bank Remarks', '1649334467.png', '2022-04-01 04:14:11', '2022-04-07 06:57:47'),
(5, 2, 'Hello Bank', 'Suraj', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'HDFC', 'Gwalior', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'Indonesia', 'Suraj Swift', '66665555444', 'USD', 'dws', 'Inter Bank Name', 'Inter Bank Address', 'Inter Bank Swift', 'Inter Bank Remarks', '1649402349.png', '2022-04-08 01:49:09', '2022-04-08 01:49:09'),
(6, 1, 'Hello Bank', 'Suraj', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'HDFC', 'Unnao', 'Hanspura, Mehgaon, Bhind, Madhya Pradesh', 'India', 'Suraj Swift', '66665555444', 'EUR', 'dws', 'Inter Bank Name', 'Inter Bank Address', 'Inter Bank Swift', 'Inter Bank Remarks', '1649409717.jpg', '2022-04-08 03:51:57', '2022-04-08 03:51:57'),
(7, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1649419083.png', '2022-04-08 06:28:03', '2022-04-08 06:28:03'),
(8, 2, 'Hello Bank', 'Suraj', 'swxwd', 'HDFC', 'Gwalior', 'wsdwd', 'Algeria', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1649484529.jpg', '2022-04-09 00:38:49', '2022-04-09 00:38:49');
-- --------------------------------------------------------
--
-- Table structure for table `transactions`
--
CREATE TABLE `transactions` (
`id` bigint(20) UNSIGNED NOT NULL,
`invoice_date` date NOT NULL,
`invoice_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`merchant_fk_id` bigint(20) UNSIGNED NOT NULL,
`bank_account_fk_id` bigint(20) UNSIGNED NOT NULL,
`customer_fk_id` bigint(20) UNSIGNED NOT NULL,
`product_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`product_price` double NOT NULL,
`remarks` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`reference_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_signed_invoice` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`proof_of_payment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`date_recieved` date DEFAULT NULL,
`amount_recieved` double DEFAULT NULL,
`status_of_transaction` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type_of_transaction` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_by` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `transactions`
--
INSERT INTO `transactions` (`id`, `invoice_date`, `invoice_number`, `merchant_fk_id`, `bank_account_fk_id`, `customer_fk_id`, `product_name`, `product_price`, `remarks`, `reference_id`, `upload_signed_invoice`, `proof_of_payment`, `date_recieved`, `amount_recieved`, `status_of_transaction`, `type_of_transaction`, `created_at`, `updated_at`, `created_by`) VALUES
(1, '2022-04-01', 'tran22049', 1, 1, 1, 'Product1', 100, 'Remarks1', '001', '1649135299.jpg', '1649135299.jpg', '2022-04-08', 200, 'new', 'C2B', '2022-04-01 03:52:05', '2022-04-08 06:14:41', 1),
(2, '2022-04-02', 'tran22049', 2, 3, 2, 'Product 2', 200, 'Dheeraj Remarks', '9900', '1648805008.jpg', NULL, '2022-04-09', 250, 'new', 'B2B', '2022-04-01 03:53:28', '2022-04-08 05:14:03', 1),
(3, '2022-04-03', 'tran22043', 3, 3, 3, 'Product 3', 300, 'Keshav Remarks', '7987', '1648805088.jpg', NULL, '2022-04-10', 350, 'Canceled', 'C2B', '2022-04-01 03:54:48', '2022-04-01 03:54:48', 1),
(4, '0000-00-00', 'tran22044', 1, 1, 5, 'product 222', 45, NULL, NULL, NULL, NULL, NULL, 0, 'New', 'C2B', '2022-04-02 05:55:35', '2022-04-02 05:55:35', 2),
(5, '2022-04-02', 'tran22046', 1, 1, 1, '5r4r4', 8687, NULL, NULL, '1649138313.jpg', '1649138313.jpg', NULL, 0, 'new', 'C2B', '2022-04-02 06:02:51', '2022-04-05 00:28:33', 2),
(6, '2022-04-07', 'tran22046', 1, 2, 1, 'product 2', 100, NULL, NULL, NULL, NULL, NULL, 0, 'New', 'C2B', '2022-04-07 06:17:13', '2022-04-07 06:17:13', 2),
(7, '2022-04-07', 'tran22047', 1, 1, 10, 'product 2', 100, 'dws', '22', NULL, NULL, NULL, 0, 'New', 'C2B', '2022-04-07 07:06:32', '2022-04-07 07:06:32', 2),
(8, '2022-04-08', 'tran22048', 1, 1, 1, 'product 2', 100, 'hello remarks', '22', NULL, NULL, NULL, 0, 'New', 'C2B', '2022-04-07 22:54:37', '2022-04-07 22:54:37', 2),
(9, '2022-04-08', 'tran22049', 1, 1, 1, 'product 2', 100, 'hello remarks', '22', '1649418309.png', NULL, NULL, 0, 'New', 'C2B', '2022-04-08 06:15:09', '2022-04-08 06:15:09', 2),
(10, '2022-04-09', 'tran220411', 2, 1, 2, 'product 2', 100, NULL, NULL, NULL, NULL, NULL, 90, 'new', 'C2B', '2022-04-09 00:38:00', '2022-04-09 01:02:44', 2);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`merchant_fk_id` int(11) DEFAULT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 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,
`website` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
`logo` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
`country` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
`role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'user',
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `first_name`, `last_name`, `merchant_fk_id`, `phone`, `address`, `email`, `email_verified_at`, `password`, `website`, `logo`, `country`, `role`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Anurag', 'Bytelogic', 2, '9876543210', 'Noida', '<EMAIL>', NULL, '$2y$10$FQPx2avQspjRdf7atFnUZ.NiOiM9Zsj2Q9xnSIG9NZKxKSgCoqJ0y', '', '', '', 'Merchant Admin', NULL, '2022-04-01 03:09:36', '2022-04-01 03:09:36'),
(2, 'Suraj', 'Singh', 2, '9898767655', 'Gwalior', '<EMAIL>', NULL, '$2y$10$pGTmcqwAmhncn4j6x6QM7uqzs33a/zSsPTD65pWCenHoGJQberE5y', '', '', '', 'Merchant Admin', NULL, '2022-04-01 03:59:44', '2022-04-08 23:54:04'),
(3, 'Dheeraj', 'Pal', 2, '6876666697', 'Unnao', '<EMAIL>', NULL, '$2y$10$/dARViy59JVeEwZattF/0u6eHVp6a7Ge0ZSQOgby/Sxsn.WD3YjS6', '', '', '', 'Merchant View-Only', NULL, '2022-04-01 04:00:45', '2022-04-01 04:00:45'),
(4, 'Keshav', 'Singh', 3, '6786696678', 'Noida', '<EMAIL>', NULL, '$2y$10$Pz8F/yCN/4ugaE5UzsldW.3VfcqPYltOXLmdwXKl57vD4LktRPSn.', '', '', '', 'Merchant Admin', NULL, '2022-04-01 04:01:50', '2022-04-01 04:01:50'),
(5, 'Admin', 'Bytelogic', 1, '9876543210', 'Noida', '<EMAIL>', NULL, '$2y$10$FQPx2avQspjRdf7atFnUZ.NiOiM9Zsj2Q9xnSIG9NZKxKSgCoqJ0y', '', '', '', 'Admin', NULL, '2022-04-01 03:09:36', '2022-04-01 03:09:36'),
(6, 'suraj', 'Bhadoriya', 1, NULL, NULL, '<EMAIL>', NULL, '$2y$10$pzuAJ70o4SZ0xkVO5suX/OZtdwY7fbzkmB25rr88lr9EaRgeZceYO', '', '', '', 'Merchant Superadmin', 's6MMWPr3kzpO09uENxIvn8HRY0EE2t36djxcI8EIvflYIJRA2lq2GVFH2gqO', '2022-04-04 03:57:39', '2022-04-06 23:28:38'),
(7, 'Dheeraj', 'Pal', 2, '9880808090', 'hp', '<EMAIL>', NULL, '$2y$10$FYbti6W05v5mI3sxrWDvg.tGRlygUGzk7RTk1VMlo3o2fnJbE0Jfy', '', '', '', 'Merchant Superadmin', NULL, '2022-04-04 04:05:39', '2022-04-04 04:05:39'),
(8, 'Rohit', 'Singh', 2, NULL, NULL, '<EMAIL>', NULL, '$2y$10$9LJIpMy.24gG3G8OKFOfQuhxK1cgPYQ0wJ01mdWMvXua3sN4AFEC2', '', '', '', 'merchant admin', NULL, '2022-04-04 22:43:51', '2022-04-07 05:09:45'),
(11, 'Suraj', 'Singh', 2, '9070286553', 'MP', '<EMAIL>', NULL, '$2y$10$d3iGpQ6860sy8D39LZmJO.oMUwLm/W5wWIBAGOfnc08vtAhUP7wBG', '', '', '', 'merchant admin', NULL, '2022-04-04 23:30:54', '2022-04-04 23:33:41'),
(12, 'Suraj', 'Singh', 2, '9090898909', 'MP', '<EMAIL>', NULL, '$2y$10$4n4O2VdytBdIOt7aW0IRAeDkqndjvx7EkuibxWFuh3NFddGT/Skum', '', '', '', 'merchant admin', NULL, '2022-04-04 23:41:00', '2022-04-08 01:56:35'),
(13, 'Suraj', 'Singh', NULL, '8979797979789', NULL, '<EMAIL>', NULL, '$2y$10$./k9uuE2.96mtj.J2jr0COblrzChKTO5z6jJHFgn.KkmXON9fcWui', '', '', '', 'Merchant Superadmin', NULL, '2022-04-08 06:04:25', '2022-04-08 06:04:25');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `adjustments`
--
ALTER TABLE `adjustments`
ADD PRIMARY KEY (`id`),
ADD KEY `adjustments_merchant_fk_id_foreign` (`merchant_fk_id`),
ADD KEY `adjustments_created_by_foreign` (`created_by`);
--
-- Indexes for table `banks`
--
ALTER TABLE `banks`
ADD PRIMARY KEY (`id`),
ADD KEY `banks_created_by_foreign` (`created_by`);
--
-- Indexes for table `bank_accounts`
--
ALTER TABLE `bank_accounts`
ADD PRIMARY KEY (`id`),
ADD KEY `bank_accounts_bank_id_foreign` (`bank_id`),
ADD KEY `bank_accounts_created_by_foreign` (`created_by`);
--
-- Indexes for table `bank_account_payouts`
--
ALTER TABLE `bank_account_payouts`
ADD PRIMARY KEY (`id`),
ADD KEY `bank_account_payouts_customer_fk_id_foreign` (`customer_fk_id`),
ADD KEY `bank_account_payouts_created_by_foreign` (`created_by`);
--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
ADD PRIMARY KEY (`id`),
ADD KEY `customers_merchant_fk_id_foreign` (`merchant_fk_id`),
ADD KEY `customers_created_by_foreign` (`created_by`);
--
-- Indexes for table `customer_documents`
--
ALTER TABLE `customer_documents`
ADD PRIMARY KEY (`id`),
ADD KEY `customer_documents_customer_fk_id_foreign` (`customer_fk_id`),
ADD KEY `customer_documents_created_by_foreign` (`created_by`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Indexes for table `loggers`
--
ALTER TABLE `loggers`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mailboxes`
--
ALTER TABLE `mailboxes`
ADD PRIMARY KEY (`id`),
ADD KEY `mailboxes_from_id_foreign` (`from_id`),
ADD KEY `mailboxes_to_id_foreign` (`to_id`);
--
-- Indexes for table `merchants`
--
ALTER TABLE `merchants`
ADD PRIMARY KEY (`id`),
ADD KEY `merchants_bank_account_id_foreign` (`bank_account_id`),
ADD KEY `merchants_created_by_foreign` (`created_by`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `payouts`
--
ALTER TABLE `payouts`
ADD PRIMARY KEY (`id`),
ADD KEY `payouts_created_by_foreign` (`created_by`),
ADD KEY `payouts_bank_account_to_fk_id_foreign` (`bank_account_to_fk_id`),
ADD KEY `payouts_merchant_fk_id_foreign` (`merchant_fk_id`),
ADD KEY `payouts_customer_fk_id_foreign` (`customer_fk_id`),
ADD KEY `payouts_bank_account_from_fk_id_foreign` (`bank_account_from_fk_id`);
--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- Indexes for table `settlements`
--
ALTER TABLE `settlements`
ADD PRIMARY KEY (`id`),
ADD KEY `settlements_merchant_fk_id_foreign` (`merchant_fk_id`),
ADD KEY `settlements_bank_account_to_fk_id_foreign` (`bank_account_to_fk_id`),
ADD KEY `settlements_bank_account_from_fk_id_foreign` (`bank_account_from_fk_id`),
ADD KEY `settlements_created_by_foreign` (`created_by`);
--
-- Indexes for table `settlement_accounts`
--
ALTER TABLE `settlement_accounts`
ADD PRIMARY KEY (`id`),
ADD KEY `settlement_accounts_merchant_fk_id_foreign` (`merchant_fk_id`);
--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
ADD PRIMARY KEY (`id`),
ADD KEY `transactions_merchant_fk_id_foreign` (`merchant_fk_id`),
ADD KEY `transactions_bank_account_fk_id_foreign` (`bank_account_fk_id`),
ADD KEY `transactions_customer_fk_id_foreign` (`customer_fk_id`),
ADD KEY `transactions_created_by_foreign` (`created_by`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `adjustments`
--
ALTER TABLE `adjustments`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `banks`
--
ALTER TABLE `banks`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `bank_accounts`
--
ALTER TABLE `bank_accounts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `bank_account_payouts`
--
ALTER TABLE `bank_account_payouts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `customer_documents`
--
ALTER TABLE `customer_documents`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `loggers`
--
ALTER TABLE `loggers`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64;
--
-- AUTO_INCREMENT for table `mailboxes`
--
ALTER TABLE `mailboxes`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `merchants`
--
ALTER TABLE `merchants`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `payouts`
--
ALTER TABLE `payouts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `settlements`
--
ALTER TABLE `settlements`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `settlement_accounts`
--
ALTER TABLE `settlement_accounts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `adjustments`
--
ALTER TABLE `adjustments`
ADD CONSTRAINT `adjustments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `adjustments_merchant_fk_id_foreign` FOREIGN KEY (`merchant_fk_id`) REFERENCES `merchants` (`id`);
--
-- Constraints for table `banks`
--
ALTER TABLE `banks`
ADD CONSTRAINT `banks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);
--
-- Constraints for table `bank_accounts`
--
ALTER TABLE `bank_accounts`
ADD CONSTRAINT `bank_accounts_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`),
ADD CONSTRAINT `bank_accounts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);
--
-- Constraints for table `bank_account_payouts`
--
ALTER TABLE `bank_account_payouts`
ADD CONSTRAINT `bank_account_payouts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `bank_account_payouts_customer_fk_id_foreign` FOREIGN KEY (`customer_fk_id`) REFERENCES `customers` (`id`);
--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
ADD CONSTRAINT `customers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `customers_merchant_fk_id_foreign` FOREIGN KEY (`merchant_fk_id`) REFERENCES `merchants` (`id`);
--
-- Constraints for table `customer_documents`
--
ALTER TABLE `customer_documents`
ADD CONSTRAINT `customer_documents_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `customer_documents_customer_fk_id_foreign` FOREIGN KEY (`customer_fk_id`) REFERENCES `customers` (`id`);
--
-- Constraints for table `mailboxes`
--
ALTER TABLE `mailboxes`
ADD CONSTRAINT `mailboxes_from_id_foreign` FOREIGN KEY (`from_id`) REFERENCES `users` (`id`),
ADD CONSTRAINT `mailboxes_to_id_foreign` FOREIGN KEY (`to_id`) REFERENCES `users` (`id`);
--
-- Constraints for table `merchants`
--
ALTER TABLE `merchants`
ADD CONSTRAINT `merchants_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`),
ADD CONSTRAINT `merchants_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);
--
-- Constraints for table `payouts`
--
ALTER TABLE `payouts`
ADD CONSTRAINT `payouts_bank_account_from_fk_id_foreign` FOREIGN KEY (`bank_account_from_fk_id`) REFERENCES `bank_accounts` (`id`),
ADD CONSTRAINT `payouts_bank_account_to_fk_id_foreign` FOREIGN KEY (`bank_account_to_fk_id`) REFERENCES `bank_account_payouts` (`id`),
ADD CONSTRAINT `payouts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `payouts_customer_fk_id_foreign` FOREIGN KEY (`customer_fk_id`) REFERENCES `customers` (`id`),
ADD CONSTRAINT `payouts_merchant_fk_id_foreign` FOREIGN KEY (`merchant_fk_id`) REFERENCES `merchants` (`id`);
--
-- Constraints for table `settlements`
--
ALTER TABLE `settlements`
ADD CONSTRAINT `settlements_bank_account_from_fk_id_foreign` FOREIGN KEY (`bank_account_from_fk_id`) REFERENCES `settlement_accounts` (`id`),
ADD CONSTRAINT `settlements_bank_account_to_fk_id_foreign` FOREIGN KEY (`bank_account_to_fk_id`) REFERENCES `bank_account_payouts` (`id`),
ADD CONSTRAINT `settlements_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `settlements_merchant_fk_id_foreign` FOREIGN KEY (`merchant_fk_id`) REFERENCES `merchants` (`id`);
--
-- Constraints for table `settlement_accounts`
--
ALTER TABLE `settlement_accounts`
ADD CONSTRAINT `settlement_accounts_merchant_fk_id_foreign` FOREIGN KEY (`merchant_fk_id`) REFERENCES `merchants` (`id`);
--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
ADD CONSTRAINT `transactions_bank_account_fk_id_foreign` FOREIGN KEY (`bank_account_fk_id`) REFERENCES `bank_accounts` (`id`),
ADD CONSTRAINT `transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
ADD CONSTRAINT `transactions_customer_fk_id_foreign` FOREIGN KEY (`customer_fk_id`) REFERENCES `customers` (`id`),
ADD CONSTRAINT `transactions_merchant_fk_id_foreign` FOREIGN KEY (`merchant_fk_id`) REFERENCES `merchants` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
DO $$
BEGIN
BEGIN
UPDATE cd_profiles SET private = true WHERE private IS NULL;
END;
BEGIN
ALTER TABLE cd_profiles ALTER COLUMN private SET NOT NULL;
END;
END;
$$
|
<reponame>ivanvalmorbida/Soteriasoft
-- --------------------------------------------------------
--
-- Estrutura da tabela `tb_atividade_economica_setor`
--
CREATE TABLE `tb_atividade_economica_setor` (
`codigo` int(11) NOT NULL,
`setor` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `tb_atividade_economica_setor`
--
INSERT INTO `tb_atividade_economica_setor` (`codigo`, `setor`) VALUES
(517, 'Comércio'),
(518, 'Finanças'),
(519, 'Indústria'),
(520, 'Informática'),
(521, 'Infraestrutura'),
(522, 'Serviços'),
(523, 'Setor Primário'),
(524, 'Setor Público');
|
-- all auto brand year info is from wikipedia.com
INSERT Makes (Name, YearStarted, YearEnded) VALUES
('<NAME> ', 1913, null),
('Acura ', 1986, null),
('<NAME> ', 1970, null),
('<NAME> ', 1910, null),
('Audi ', 1989, null),
('Bentley ', 1919, null),
('BMW ', 1916, null),
('Bugatti ', 1909, null),
('Buick ', 1899, null),
('Cadillac ', 1902, null),
('Chrysler ', 1925, null),
('Chevrolet ', 1911, null),
('Dodge', 1900, null),
('Datsun ', 1931, 1986),
('Datsun ', 2013, null),
('Dodge ', 1900, null),
('Fiat ', 1899, null),
('Ferrari ', 1939, null),
('Ford ', 1903, null),
('GMC ', 1911, null),
('GM ', 1908, null),
('Hyundai ', 1967, null),
('Holden ', 1856, null),
('Hennessey', 1991, null),
('Honda ', 1946, null),
('Infiniti ', 1989, null),
('Isuzu ', 1953, null),
('Jeep ', 1941, null),
('Jaguar ', 1933, null),
('Kia ', 1962, null),
('<NAME> ', 1967, null),
('Rover ', 1948, null),
('Lincoln ', 1917, null),
('Lotus ', 1952, null),
('Lexus ', 1989, null),
('Lancia ', 1906, null),
('Lamborghini ', 1963, null),
('Maybach ', 1909, null),
('Mazda ', 1920, null),
('Mitsubishi ', 1970, null),
('Mitsubishi', 1917, 1921),
('Mitsubishi', 1959, null),
('Mercedes-Benz', 1870, null),
('Mercury ', 1938, 2011),
('Maserati ', 1914, null),
('MINI ', 1959, null),
('Nissan ', 1933, null),
('Opel ', 1862, null),
('Porsche ', 1931, null),
('Pontiac ', 1926, 2010),
('Ram ', 2009, null),
('<NAME> ', 1906, null),
('Subaru ', 1953, null),
('Suzuki ', 1937, null),
('Smart ', 1994, null),
('Sprinter (Dodge or Freightliner) ', 1995, null),
('Scion', 2003, 2016),
('Tesla ', 2003, null),
('Toyota ', 1937, null),
('Triumph ', 1921, null),
('Volvo ', 1924, null),
('Volkswagen ', 1937, null),
('Anteros', 2005, null),
('Aurica', 2010, null),
('Buick', 1903, null),
('BXR', 2008, null),
('Elio Motors', 2009, null),
('Equus Automotive', 2014, null),
('E-Z-GO', 1954, null),
('Falcon', 2009, null),
('Faraday', 2014, null),
('Fisker', 2011, 2014),
('Karma', 2016, null),
('Local', 2007, null),
('<NAME>', 2014, null),
('Lyons', 2011, null),
('Mosler', 1993, 2013),
('Niama-Reisser', 2005, null),
('Panoz', 1989, null),
('Racefab', 1991, null),
('Rezvani', 2014, null),
('Rossion', 2007, null),
('<NAME>', 1992, null),
('SSC', 1999, null),
('Zimmer', 1978, 1988),
('Zimmer', 1997, null)
INSERT Models(Name, YearStarted, YearEnded) VALUES
('Magnum', 2005, 2008),
-- every Dodge made in 2000 below
('Avenger', 1995, 2000),
('Avenger', 2007, 2014),
('<NAME>', 1984, null),
('Dakota', 1987, 2011),
('Durango', 1998, null),
('Intrepid', 1993, 2004),
('Neon', 1995, 2005),
('Ram', 1981, null),
('<NAME>', 1971, 2003),
('Stratus', 1995, 2006),
('Viper', 1991, 2017),
-- every Honda made in 2000 below
('Accord', 1976, null),
('Civic', 1972, null),
('CR-V', 1995, null),
('Insight', 1999, 2006),
('Insight', 2009, 2014),
('Insight', 2019, null),
('Odyssey', 1995, null),
('Passport', 1994, 2002),
('Prelude', 1978, 2001),
('S2000', 1999, 2008)
|
-- randexpr1.test
--
-- db eval {SELECT +case when case when ~t1.b<=case when ~17*19 | 11*11*f between t1.c and b then t1.a when e in (t1.a,t1.e,e) then t1.c else 19 end-t1.c-17+a then (t1.d) when 13 not between 13 and 19 then c else c end=(f) or d<t1.f then -t1.f else t1.d end FROM t1 WHERE 19*++t1.e=coalesce((select case -t1.f when case when d-t1.a*d*coalesce((select max(t1.d) from t1 where b-b> -coalesce((select t1.b from t1 where c*13+c<>t1.f),a)),t1.e)+t1.f=t1.f then - - -f else b end then -11 else -d end from t1 where ( -t1.c<f)),t1.e)+19}
SELECT +case when case when ~t1.b<=case when ~17*19 | 11*11*f between t1.c and b then t1.a when e in (t1.a,t1.e,e) then t1.c else 19 end-t1.c-17+a then (t1.d) when 13 not between 13 and 19 then c else c end=(f) or d<t1.f then -t1.f else t1.d end FROM t1 WHERE 19*++t1.e=coalesce((select case -t1.f when case when d-t1.a*d*coalesce((select max(t1.d) from t1 where b-b> -coalesce((select t1.b from t1 where c*13+c<>t1.f),a)),t1.e)+t1.f=t1.f then - - -f else b end then -11 else -d end from t1 where ( -t1.c<f)),t1.e)+19
|
<reponame>AwadYoo/hotelbook-JavaWeb<gh_stars>100-1000
-- 建立hotelbook数据库
CREATE SCHEMA `hotelbook` DEFAULT CHARACTER SET utf8 ;
-- 建立登录表
CREATE TABLE `hotelbook`.`login` (
`loginId` INT NOT NULL AUTO_INCREMENT COMMENT '登录内部标示,主键、自动增长。',
`loginName` VARCHAR(45) NOT NULL COMMENT '登录用户名,前台唯一性的标识。不能重复。',
`loginPwd` VARCHAR(45) NOT NULL COMMENT '登录用户的密码,不能为空。',
`loginNickName` VARCHAR(45) NULL COMMENT '登录用户的昵称' ,
`loginAdmin` INT NULL COMMENT '权限,默认最高权限是0',
PRIMARY KEY (`loginId`),
UNIQUE INDEX `loginName_UNIQUE` (`loginName` ASC));
-- 为login表插入默认的管理员用户
INSERT INTO `hotelbook`.`login` (`loginName`,`loginPwd`,`loginNickName`,`loginAdmin`) VALUE ("root","eySvyLyA5UjWbE5/9yFxxQ==","管理员",0);
-- 建立日志表
CREATE TABLE `hotelbook`.`logInfo` (
`logId` INT NOT NULL AUTO_INCREMENT COMMENT '日志,主键、自动增长。',
`logName` VARCHAR(45) NOT NULL COMMENT '日志项目',
`loginId` INT NOT NULL COMMENT '用户 外键 login表字段值',
`loginName` VARCHAR(45) NULL COMMENT '用户名称',
`logDate` VARCHAR(45) NULL COMMENT '日志时间' ,
PRIMARY KEY (`logId`),
CONSTRAINT `fk_logInfo_1`
FOREIGN KEY (`loginId`)
REFERENCES `hotelbook`.`login` (`loginId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- 创建主体数据表
-- 核心数据库内容
-- 将不使用存储过程,仅仅用到外键/外联
-- 数据维护主要依靠后端维护
-- 楼层信息
CREATE TABLE `hotelbook`.`floorInfo` (
`floorId` INT NOT NULL AUTO_INCREMENT COMMENT '楼层编号',
`floorName` VARCHAR(45) NULL COMMENT '楼层名称',
PRIMARY KEY (`floorId`));
-- 客房类型
CREATE TABLE `hotelbook`.`roomType` (
`typeId` VARCHAR(45) NOT NULL COMMENT '类型编号',
`typeName` VARCHAR(45) NULL COMMENT '类型名称',
`price` VARCHAR(20) NULL COMMENT '价格',
`splicPrice` VARCHAR(20) NULL COMMENT '拼房价格',
`exceedance` INT NULL COMMENT '可超预定数',
`isSplice` VARCHAR(10) NULL COMMENT '是否可拼房',
PRIMARY KEY (`typeId`));
-- 客房信息
CREATE TABLE `hotelbook`.`roomInfo` (
`roomId` VARCHAR(45) NOT NULL COMMENT '客房编号',
`typeId` VARCHAR(45) NOT NULL COMMENT '类型编号',
`floorId` INT NOT NULL COMMENT '楼层编号',
`ratedNum` INT NULL COMMENT '额定人数',
`bedNum` INT NULL COMMENT '床数',
`roomDescription` VARCHAR(45) NULL COMMENT '客房描述',
`remark` VARCHAR(100) NULL COMMENT '备注',
`status` VARCHAR(10) NULL COMMENT '状态',
`isSplice` VARCHAR(10) NULL COMMENT '是否可拼房',
PRIMARY KEY (`roomId`),
INDEX `fk_roomInfo_1_idx` (`typeId` ASC),
INDEX `fk_roomInfo_2_idx` (`floorId` ASC),
CONSTRAINT `fk_roomInfo_1`
FOREIGN KEY (`typeId`)
REFERENCES `hotelbook`.`roomType` (`typeId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_roomInfo_2`
FOREIGN KEY (`floorId`)
REFERENCES `hotelbook`.`floorInfo` (`floorId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- 预订单
CREATE TABLE `hotelbook`.`orderInfo` (
`orderId` VARCHAR(45) NOT NULL COMMENT '预定单号',
`orderName` VARCHAR(45) NULL COMMENT '预定人',
`orderPhone` VARCHAR(45) NULL COMMENT '联系电话',
`orderIDcard` VARCHAR(18) NULL COMMENT '身份证号',
`typeId` VARCHAR(45) NOT NULL COMMENT '客房类型',
`arrireDate` VARCHAR(45) NULL COMMENT '抵店时间',
`leaveDate` VARCHAR(45) NULL COMMENT '离店时间',
`orderState` VARCHAR(20) NULL COMMENT '单据状态',
`checkNum` VARCHAR(45) NULL COMMENT '入住人数',
`roomId` VARCHAR(45) NULL COMMENT '客房编号',
`price` VARCHAR(20) NULL COMMENT '客房价格',
`checkPrice` VARCHAR(20) NULL COMMENT '入住价格',
`discount` INT NULL COMMENT '折扣',
`discountReason` VARCHAR(60) NULL COMMENT '折扣原因',
`addBed` VARCHAR(10) NULL COMMENT '是否加床',
`addBedPrice` VARCHAR(20) NULL COMMENT '加床价格',
`orderMoney` VARCHAR(20) NULL COMMENT '预收款',
`remark` VARCHAR(500) NULL COMMENT '备注',
`operatorId` VARCHAR(45) NULL COMMENT '操作员',
PRIMARY KEY (`orderId`),
INDEX `fk_orderInfo_1_idx` (`typeId` ASC),
CONSTRAINT `fk_orderInfo_1`
FOREIGN KEY (`typeId`)
REFERENCES `hotelbook`.`roomType` (`typeId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- 入住单
CREATE TABLE `hotelbook`.`checkInInfo` (
`checkId` VARCHAR(45) NOT NULL COMMENT '入住单号',
`orderId` VARCHAR(45) NULL COMMENT '预定单号',
`checkName` VARCHAR(45) NULL COMMENT '入住人',
`checkPhone` VARCHAR(45) NULL COMMENT '联系电话',
`checkIDcard` VARCHAR(18) NULL COMMENT '身份证号',
`typeId` VARCHAR(45) NOT NULL COMMENT '客房类型',
`arrireTime` VARCHAR(45) NULL COMMENT '抵店时间',
`leaveTime` VARCHAR(45) NULL COMMENT '离店时间',
`checkState` VARCHAR(20) NULL COMMENT '单据状态',
`checkNum` INT NULL COMMENT '入住人数',
`roomId` VARCHAR(45) NOT NULL COMMENT '客房编号',
`price` VARCHAR(20) NULL COMMENT '客房价格',
`checkPrice` VARCHAR(20) NULL COMMENT '入住价格',
`discount` INT NULL COMMENT '折扣',
`discountReason` VARCHAR(60) NULL COMMENT '折扣原因',
`addBed` VARCHAR(10) NULL COMMENT '是否加床',
`addBedPrice` VARCHAR(20) NULL COMMENT '加床价格',
`orderMoney` VARCHAR(20) NULL COMMENT '预收款',
`money` VARCHAR(20) NULL COMMENT '应收账款',
`isCheck` VARCHAR(10) NULL COMMENT '是否结账',
`checkMoney` VARCHAR(20) NULL COMMENT '结账金额',
`checkDate` VARCHAR(45) NULL COMMENT '结账日期',
`remark` VARCHAR(500) NULL COMMENT '备注',
`operatorId` VARCHAR(45) NULL COMMENT '操作员',
PRIMARY KEY (`checkId`),
INDEX `fk_checkInfo_1_idx` (`typeId` ASC),
INDEX `fk_checkInfo_2_idx` (`roomId` ASC),
CONSTRAINT `fk_checkInfo_1`
FOREIGN KEY (`typeId`)
REFERENCES `hotelbook`.`roomType` (`typeId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_checkInfo_2`
FOREIGN KEY (`roomId`)
REFERENCES `hotelbook`.`roomInfo` (`roomId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- 账单明细
CREATE TABLE `hotelbook`.`billInfo` (
`billId` INT NOT NULL COMMENT '账单编号',
`checkId` VARCHAR(45) NOT NULL COMMENT '入住单号',
`costMoney` VARCHAR(20) NULL COMMENT '消费金额',
`costDate` VARCHAR(45) NULL COMMENT '消费时间',
`remark` VARCHAR(100) NULL COMMENT '备注',
PRIMARY KEY (`billId`),
INDEX `fk_billInfo_1_idx` (`checkId` ASC),
CONSTRAINT `fk_billInfo_1`
FOREIGN KEY (`checkId`)
REFERENCES `hotelbook`.`checkInInfo` (`checkId`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- 权限管理
CREATE TABLE `hotelbook`.`authInfo` (
`authId` INT NOT NULL AUTO_INCREMENT COMMENT '权限编号',
`authItem` VARCHAR(45) NULL COMMENT '权限项',
`isRead` VARCHAR(45) NULL COMMENT '可读',
`isWrite` VARCHAR(45) NULL COMMENT '可写',
`isChange` VARCHAR(45) NULL COMMENT '可改',
`isDelete` VARCHAR(45) NULL COMMENT '可删',
PRIMARY KEY (`authId`));
|
<reponame>ONRR/cloud-repo
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.6 (Debian 12.6-1.pgdg100+1)
-- Dumped by pg_dump version 12.6 (Debian 12.6-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: download_calendar_year_production; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW public.download_calendar_year_production AS
SELECT period.period,
period.calendar_year,
period.period_date,
location.location_name,
location.fips_code,
location.state,
location.state_name,
location.county,
location.land_class,
location.land_category,
location.land_type,
location.region_type,
location.offshore_region,
commodity.commodity,
commodity.product,
production.volume
FROM (((public.production
JOIN public.period USING (period_id))
JOIN public.location USING (location_id))
JOIN public.commodity USING (commodity_id))
WHERE ((period.period)::text = 'Calendar Year'::text)
ORDER BY period.period_date;
ALTER TABLE public.download_calendar_year_production OWNER TO postgres;
--
-- PostgreSQL database dump complete
--
|
<gh_stars>0
INSERT INTO customer (id,first_name,last_name,date_of_birth,email,phone)
VALUES
(1,'Kelsey','Price','Dec 31, 1969','<EMAIL>','(367) 871-6294'),
(2,'Roth','Saunders','Dec 31, 1969','<EMAIL>','(856) 576-8455'),
(3,'Ingrid','Olsen','Dec 31, 1969','<EMAIL>','(292) 619-9663'),
(4,'Donna','Sharp','Dec 31, 1969','<EMAIL>','(609) 727-9295'),
(5,'Tatiana','Avery','Dec 31, 1969','<EMAIL>','(683) 346-7111'),
(6,'Wesley','Martinez','Dec 31, 1969','<EMAIL>','(907) 953-3305'),
(7,'Hoyt','Cleveland','Dec 31, 1969','<EMAIL>','(230) 846-6319'),
(8,'Bradley','Glass','Dec 31, 1969','<EMAIL>','(239) 634-1050'),
(9,'Sacha','Trujillo','Dec 31, 1969','<EMAIL>','(539) 733-7145'),
(10,'Cally','Dorsey','Dec 31, 1969','<EMAIL>','(890) 159-2475')
|
<filename>db/migrations/000001_create_blocks_table.down.sql
DROP TABLE IF EXISTS "blocks";
|
--------------------------------------------------------------------------
-- test PostgreSQL various array data types
--------------------------------------------------------------------------
.run ../common/postgresql_setup.sql
SET TIME ZONE '-04:00';
.debug resultset on
.debug preparedstatement on
CREATE TABLE NumTable
(
a INTEGER,
c1 SMALLINT[],
c2 INTEGER[],
c3 BIGINT[],
c4 FLOAT[],
c5 DOUBLE PRECISION[]
);
INSERT INTO NumTable VALUES (1, '{-12345}', '{-123456789}', '{-1234567890}', '{-1234.5}', '{-4.5e15}');
INSERT INTO NumTable VALUES (2, '{12345}', '{123456789}', '{1234567890}', '{1234.5}', '{4.5e15}');
.export json t.json
SELECT * FROM NumTable ORDER BY a;
DELETE FROM NumTable;
.import json t.json
INSERT INTO NumTable VALUES ({{a}}, {{c1}}, {{c2}}, {{c3}}, {{c4}}, {{c5}});
SELECT * FROM NumTable ORDER BY a;
DROP TABLE NumTable;
CREATE TABLE DecTable
(
a INTEGER,
c1 DECIMAL(3,2)[],
c2 DECIMAL(9,2)[],
c3 DECIMAL(22,2)[],
c4 DECIMAL(31,2)[]
);
INSERT INTO DecTable VALUES (1, '{-1.23}', '{-1234567.89}', '{-12345678901234567890.12}', '{-12345678901234567890123456789.01}');
INSERT INTO DecTable VALUES (2, '{1.23}', '{1234567.89}', '{12345678901234567890.12}', '{12345678901234567890123456789.01}');
.export json t.json
SELECT * FROM DecTable ORDER BY a;
DELETE FROM DecTable;
.import json t.json
INSERT INTO DecTable VALUES ({{a}}, {{c1}}, {{c2}}, {{c3}}, {{c4}});
SELECT * FROM DecTable ORDER BY a;
DROP TABLE DecTable;
CREATE TABLE StrTable
(
a INTEGER,
c1 VARCHAR(255)[],
c2 CHAR(1)[],
c3 CHAR(5)[],
c4 TEXT[]
);
INSERT INTO StrTable VALUES (1, '{aa}', '{A}', '{abcde}', '{aaaaa}');
INSERT INTO StrTable VALUES (2, '{bbb}', '{B}', '{fghij}', '{bbbbb}');
.export json t.json
SELECT * FROM StrTable ORDER BY a;
DELETE FROM StrTable;
.import json t.json
INSERT INTO StrTable VALUES ({{a}}, {{c1}}, {{c2}}, {{c3}}, {{c4}});
SELECT * FROM StrTable ORDER BY a;
DROP TABLE StrTable;
CREATE TABLE BinTable
(
a INTEGER,
c1 BYTEA[]
);
INSERT INTO BinTable VALUES (1, '{\\xdeadbeef}');
INSERT INTO BinTable VALUES (2, '{\\xfacefeed}');
.export json t.json
SELECT * FROM BinTable ORDER BY a;
DELETE FROM BinTable;
.import json t.json
INSERT INTO BinTable VALUES ({{a}}, {{c1}});
SELECT * FROM BinTable ORDER BY a;
DROP TABLE BinTable;
CREATE TABLE TimeTable
(
a INTEGER,
c1 DATE[],
c2 TIME[],
c3 TIME WITH TIME ZONE[],
c4 TIMESTAMP[],
c5 TIMESTAMP WITH TIME ZONE[]
);
INSERT INTO TimeTable VALUES (1, '{2001-02-03}', '{12:34:56}', '{12:34:56-08:00}', '{2001-02-03 12:34:56}', '{2001-02-03 12:34:56-08:00}');
INSERT INTO TimeTable VALUES (2, '{2001-03-04}', '{12:34:56}', '{12:34:56+08:00}', '{2001-03-04 12:34:56}', '{2001-02-03 12:34:56+08:00}');
.export json t.json
SELECT * FROM TimeTable ORDER BY a;
DELETE FROM TimeTable;
.import json t.json
INSERT INTO TimeTable VALUES ({{a}}, {{c1}}, {{c2}}, {{c3}}, {{c4}}, {{c5}});
SELECT * FROM TimeTable ORDER BY a;
.os rm -f t.json
DROP TABLE TimeTable;
.close
|
/* Drop old columns of pubSubNode */
ALTER TABLE pubsubNode DROP COLUMN contacts;
ALTER TABLE pubsubNode DROP COLUMN rosterGroups;
ALTER TABLE pubsubNode DROP COLUMN replyRooms;
ALTER TABLE pubsubNode DROP COLUMN replyTo;
ALTER TABLE pubsubNode DROP COLUMN associationTrusted;
/* Add new pubsub tables */
CREATE TABLE pubsubNodeJIDs (
serviceID NVARCHAR(100) NOT NULL,
nodeID NVARCHAR(100) NOT NULL,
jid NVARCHAR(1024) NOT NULL,
associationType NVARCHAR(20) NOT NULL,
CONSTRAINT pubsubJID_pk PRIMARY KEY (serviceID, nodeID, jid)
);
CREATE TABLE pubsubNodeGroups (
serviceID NVARCHAR(100) NOT NULL,
nodeID NVARCHAR(100) NOT NULL,
rosterGroup NVARCHAR(100) NOT NULL
);
CREATE INDEX pubsubNodeGroups_idx ON pubsubNodeGroups (serviceID, nodeID);
UPDATE jiveVersion set version=8 where name = 'openfire';
|
alter table ACT_RU_TASK add column IS_COUNT_ENABLED_ smallint check(IS_COUNT_ENABLED_ in (1,0));
alter table ACT_RU_TASK add column VAR_COUNT_ integer;
alter table ACT_RU_TASK add column ID_LINK_COUNT_ integer;
update ACT_GE_PROPERTY set VALUE_ = '6.0.0.5' where NAME_ = 'schema.version';
|
use demo;
create table ORDERS (
id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
customer_id INT,
order_total_usd DECIMAL(11,2),
make VARCHAR(50),
model VARCHAR(50),
delivery_city VARCHAR(50),
delivery_company VARCHAR(50),
delivery_address VARCHAR(50),
CREATE_TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UPDATE_TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
|
<reponame>taromaru04/sistemaPos
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-02-2020 a las 19:45:55
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `pos`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categorias`
--
CREATE TABLE `categorias` (
`id` int(11) NOT NULL,
`categoria` text COLLATE utf8_spanish_ci NOT NULL,
`fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `categorias`
--
INSERT INTO `categorias` (`id`, `categoria`, `fecha`) VALUES
(1, 'Equipos Electromecánicos', '2017-12-21 20:53:29'),
(2, 'Taladros', '2017-12-21 20:53:29'),
(3, 'Andamios', '2017-12-21 20:53:29'),
(4, 'Generadores de energía', '2017-12-21 20:53:29'),
(5, 'Equipos para construcción', '2017-12-21 20:53:29'),
(6, '<NAME>', '2017-12-21 23:06:40'),
(10, 'ECONOMICOS', '2020-02-26 00:46:04'),
(11, 'Mecanismos pesados', '2020-02-26 00:58:53');
--
-- Disparadores `categorias`
--
DELIMITER $$
CREATE TRIGGER `insertcategory` AFTER INSERT ON `categorias` FOR EACH ROW INSERT INTO bd_inventario.categorias SET id = NEW.id,categoria= NEW.categoria,fecha = NEW.fecha
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `updatecategory` AFTER UPDATE ON `categorias` FOR EACH ROW UPDATE bd_inventario.categorias SET id = NEW.id,categoria= NEW.categoria,fecha = NEW.fecha WHERE id = NEW.id
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `clientes`
--
CREATE TABLE `clientes` (
`id` int(11) NOT NULL,
`nombre` text COLLATE utf8_spanish_ci NOT NULL,
`documento` int(11) NOT NULL,
`email` text COLLATE utf8_spanish_ci NOT NULL,
`telefono` text COLLATE utf8_spanish_ci NOT NULL,
`direccion` text COLLATE utf8_spanish_ci NOT NULL,
`fecha_nacimiento` date NOT NULL,
`compras` int(11) NOT NULL,
`ultima_compra` datetime NOT NULL,
`fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `clientes`
--
INSERT INTO `clientes` (`id`, `nombre`, `documento`, `email`, `telefono`, `direccion`, `fecha_nacimiento`, `compras`, `ultima_compra`, `fecha`) VALUES
(3, '<NAME>', 2147483647, '<EMAIL>', '(300) 341-2345', 'Calle 23 # 45 - 56', '1980-11-02', 7, '2018-02-06 17:47:02', '2018-02-06 22:47:02'),
(4, '<NAME>', 2147483647, '<EMAIL>', '(399) 876-5432', 'Calle 34 N33 -56', '1970-08-07', 7, '2017-12-26 17:27:42', '2017-12-26 22:27:42'),
(5, '<NAME>', 325235235, '<EMAIL>', '(254) 545-3446', 'calle 34 # 34 - 23', '1976-03-04', 42, '2020-02-25 20:04:01', '2020-02-26 01:04:01'),
(6, '<NAME>', 34565432, '<EMAIL>', '(344) 345-6678', 'Calle 45 # 34 - 56', '1976-11-30', 14, '2017-12-26 17:26:51', '2017-12-26 22:26:51'),
(7, '<NAME>', 786786545, '<EMAIL>', '(675) 674-5453', 'Carrera 45 # 54 - 56', '1980-04-05', 14, '2017-12-26 17:26:28', '2017-12-26 22:26:28'),
(8, '<NAME>', 65756735, '<EMAIL>', '(435) 346-3463', 'Carrera 34 # 45- 56', '1956-06-05', 9, '2017-12-26 17:25:55', '2017-12-26 22:25:55'),
(9, '<NAME>', 2147483647, '<EMAIL>', '(534) 634-6565', 'Carrera 67 # 45sur', '1978-03-04', 12, '2017-12-26 17:25:33', '2017-12-26 22:25:33'),
(10, '<NAME>', 436346346, '<EMAIL>', '(543) 463-4634', 'calle 45 # 23 - 45', '1956-03-04', 18, '2017-12-26 17:25:08', '2017-12-26 22:25:08'),
(11, '<NAME>', 43634643, '<EMAIL>', '(354) 574-5634', 'carrera 45 # 45 ', '1967-05-04', 10, '2017-12-26 17:24:50', '2017-12-26 22:24:50'),
(12, '<NAME>', 436346346, '<EMAIL>', '(235) 346-3464', 'Carrera 34 # 56 - 34', '1967-08-09', 24, '2017-12-25 17:24:24', '2017-12-27 00:30:12');
--
-- Disparadores `clientes`
--
DELIMITER $$
CREATE TRIGGER `insertcustomers` AFTER INSERT ON `clientes` FOR EACH ROW INSERT INTO bd_ventas.clientes SET id = NEW.id ,nombre = NEW.nombre ,documento = NEW.documento ,email = NEW.email ,telefono = NEW.telefono ,direccion = NEW.direccion ,
fecha_nacimiento = NEW.fecha_nacimiento ,compras = NEW.compras ,ultima_compra = NEW.ultima_compra ,fecha = NEW.fecha
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `updatecustomers` AFTER UPDATE ON `clientes` FOR EACH ROW UPDATE bd_ventas.clientes SET id = NEW.id ,nombre = NEW.nombre ,documento = NEW.documento ,email = NEW.email ,telefono = NEW.telefono ,direccion = NEW.direccion ,
fecha_nacimiento = NEW.fecha_nacimiento ,compras = NEW.compras ,ultima_compra = NEW.ultima_compra ,fecha = NEW.fecha WHERE id = NEW.id
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `productos`
--
CREATE TABLE `productos` (
`id` int(11) NOT NULL,
`id_categoria` int(11) NOT NULL,
`codigo` text COLLATE utf8_spanish_ci NOT NULL,
`descripcion` text COLLATE utf8_spanish_ci NOT NULL,
`imagen` text COLLATE utf8_spanish_ci NOT NULL,
`stock` int(11) NOT NULL,
`precio_compra` float NOT NULL,
`precio_venta` float NOT NULL,
`ventas` int(11) NOT NULL,
`fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `productos`
--
INSERT INTO `productos` (`id`, `id_categoria`, `codigo`, `descripcion`, `imagen`, `stock`, `precio_compra`, `precio_venta`, `ventas`, `fecha`) VALUES
(1, 1, '101', 'Aspiradora Industrial ', 'vistas/img/productos/101/105.png', 13, 1000, 1200, 2, '2017-12-24 01:11:04'),
(2, 1, '102', 'Plato Flotante para Allanadora', 'vistas/img/productos/102/940.jpg', 6, 4500, 6300, 3, '2017-12-26 15:04:11'),
(3, 1, '103', 'Compresor de Aire para pintura', 'vistas/img/productos/103/763.jpg', 8, 3000, 4200, 12, '2017-12-26 15:03:22'),
(4, 1, '104', 'Cortadora de Adobe sin Disco ', 'vistas/img/productos/104/957.jpg', 16, 4000, 5600, 4, '2017-12-26 15:03:22'),
(5, 1, '105', 'Cortadora de Piso sin Disco ', 'vistas/img/productos/105/630.jpg', 13, 1540, 2156, 7, '2017-12-26 15:03:22'),
(6, 1, '106', '<NAME> ', 'vistas/img/productos/106/635.jpg', 15, 1100, 1540, 5, '2017-12-26 15:04:38'),
(7, 1, '107', 'Extractor de Aire ', 'vistas/img/productos/107/848.jpg', 12, 1540, 2156, 8, '2017-12-26 15:04:11'),
(8, 1, '108', 'Guadañadora ', 'vistas/img/productos/108/163.jpg', 13, 1540, 2156, 7, '2017-12-26 15:03:52'),
(9, 1, '109', '<NAME> ', 'vistas/img/productos/109/769.jpg', 15, 2600, 3640, 5, '2017-12-26 15:05:09'),
(10, 1, '110', '<NAME>asolina', 'vistas/img/productos/110/582.jpg', 18, 2210, 3094, 2, '2017-12-26 15:05:09'),
(11, 1, '111', 'Motobomba a Gasolina', 'vistas/img/productos/default/anonymous.png', 20, 2860, 4004, 0, '2017-12-21 21:56:28'),
(12, 1, '112', 'Motobomba El?ctrica', 'vistas/img/productos/default/anonymous.png', 20, 2400, 3360, 0, '2017-12-21 21:56:28'),
(13, 1, '113', 'Sierra Circular ', 'vistas/img/productos/default/anonymous.png', 20, 1100, 1540, 0, '2017-12-21 21:56:28'),
(14, 1, '114', 'Disco de tugsteno para Sierra circular', 'vistas/img/productos/default/anonymous.png', 20, 4500, 6300, 0, '2017-12-21 21:56:28'),
(15, 1, '115', 'Soldador Electrico ', 'vistas/img/productos/default/anonymous.png', 20, 1980, 2772, 0, '2017-12-21 21:56:28'),
(16, 1, '116', 'Careta para Soldador', 'vistas/img/productos/default/anonymous.png', 20, 4200, 5880, 0, '2017-12-21 21:56:28'),
(17, 1, '117', 'Torre de iluminacion ', 'vistas/img/productos/default/anonymous.png', 20, 1800, 2520, 0, '2017-12-21 21:56:28'),
(18, 2, '201', 'Martillo Demoledor de Piso 110V', 'vistas/img/productos/default/anonymous.png', 20, 5600, 7840, 0, '2017-12-21 21:56:28'),
(19, 2, '202', 'Muela o cincel martillo demoledor piso', 'vistas/img/productos/default/anonymous.png', 20, 9600, 13440, 0, '2017-12-21 21:56:28'),
(20, 2, '203', 'Taladro Demoledor de muro 110V', 'vistas/img/productos/default/anonymous.png', 20, 3850, 5390, 0, '2017-12-21 21:56:28'),
(21, 2, '204', 'Muela o cincel martillo demoledor muro', 'vistas/img/productos/default/anonymous.png', 20, 9600, 13440, 0, '2017-12-21 21:56:28'),
(22, 2, '205', 'Taladro Percutor de 1/2 Madera y Metal', 'vistas/img/productos/default/anonymous.png', 20, 8000, 11200, 0, '2017-12-21 22:28:24'),
(23, 2, '206', 'Taladro Percutor SDS Plus 110V', 'vistas/img/productos/default/anonymous.png', 20, 3900, 5460, 0, '2017-12-21 21:56:28'),
(24, 2, '207', 'Taladro Percutor SDS Max 110V (Mineria)', 'vistas/img/productos/default/anonymous.png', 20, 4600, 6440, 0, '2017-12-21 21:56:28'),
(25, 3, '301', '<NAME>', 'vistas/img/productos/default/anonymous.png', 20, 1440, 2016, 0, '2017-12-21 21:56:28'),
(26, 3, '302', 'Distanciador andamio colgante', 'vistas/img/productos/default/anonymous.png', 20, 1600, 2240, 0, '2017-12-21 21:56:28'),
(27, 3, '303', '<NAME> modular ', 'vistas/img/productos/default/anonymous.png', 20, 900, 1260, 0, '2017-12-21 21:56:28'),
(28, 3, '304', '<NAME> tijera', 'vistas/img/productos/default/anonymous.png', 20, 100, 140, 0, '2017-12-21 21:56:28'),
(29, 3, '305', 'Tijera para andamio', 'vistas/img/productos/default/anonymous.png', 20, 162, 226, 0, '2017-12-21 21:56:28'),
(30, 3, '306', 'Escalera interna para andamio', 'vistas/img/productos/default/anonymous.png', 20, 270, 378, 0, '2017-12-21 21:56:28'),
(31, 3, '307', 'Pasamanos de seguridad', 'vistas/img/productos/default/anonymous.png', 20, 75, 105, 0, '2017-12-21 21:56:28'),
(32, 3, '308', 'Rueda giratoria para andamio', 'vistas/img/productos/default/anonymous.png', 20, 168, 235, 0, '2017-12-21 21:56:28'),
(33, 3, '309', 'Arnes de seguridad', 'vistas/img/productos/default/anonymous.png', 20, 1750, 2450, 0, '2017-12-21 21:56:28'),
(34, 3, '310', 'Eslinga para arnes', 'vistas/img/productos/default/anonymous.png', 20, 175, 245, 0, '2017-12-21 21:56:28'),
(35, 3, '311', 'Plataforma Met?lica', 'vistas/img/productos/default/anonymous.png', 20, 420, 588, 0, '2017-12-21 21:56:28'),
(36, 4, '401', 'Planta Electrica Diesel 6 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3500, 4900, 0, '2017-12-21 21:56:28'),
(37, 4, '402', 'Planta Electrica Diesel 10 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3550, 4970, 0, '2017-12-21 21:56:28'),
(38, 4, '403', 'Planta Electrica Diesel 20 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3600, 5040, 0, '2017-12-21 21:56:28'),
(39, 4, '404', 'Planta Electrica Diesel 30 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3650, 5110, 0, '2017-12-21 21:56:28'),
(40, 4, '405', 'Planta Electrica Diesel 60 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3700, 5180, 0, '2017-12-21 21:56:28'),
(41, 4, '406', 'Planta Electrica Diesel 75 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3750, 5250, 0, '2017-12-21 21:56:28'),
(42, 4, '407', 'Planta Electrica Diesel 100 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3800, 5320, 0, '2017-12-21 21:56:28'),
(43, 4, '408', 'Planta Electrica Diesel 120 Kva', 'vistas/img/productos/default/anonymous.png', 20, 3850, 5390, 0, '2017-12-21 21:56:28'),
(44, 5, '501', 'Escalera de Tijera Aluminio ', 'vistas/img/productos/default/anonymous.png', 20, 350, 490, 0, '2017-12-21 21:56:28'),
(45, 5, '502', 'Extension Electrica ', 'vistas/img/productos/default/anonymous.png', 20, 370, 518, 0, '2017-12-21 21:56:28'),
(46, 5, '503', 'Gato tensor', 'vistas/img/productos/default/anonymous.png', 20, 380, 532, 0, '2017-12-21 21:56:28'),
(47, 5, '504', '<NAME> ', 'vistas/img/productos/default/anonymous.png', 20, 380, 532, 0, '2017-12-21 21:56:28'),
(48, 5, '505', 'Llave de Tubo', 'vistas/img/productos/default/anonymous.png', 20, 480, 672, 0, '2017-12-21 21:56:28'),
(49, 5, '506', 'Manila por Metro', 'vistas/img/productos/default/anonymous.png', 20, 600, 840, 0, '2017-12-21 21:56:28'),
(50, 5, '507', 'Polea 2 canales', 'vistas/img/productos/default/anonymous.png', 20, 900, 1260, 0, '2017-12-21 21:56:28'),
(51, 5, '508', 'Tensor', 'vistas/img/productos/508/500.jpg', 19, 100, 140, 1, '2017-12-26 22:26:51'),
(52, 5, '509', 'Bascula ', 'vistas/img/productos/509/878.jpg', 12, 130, 182, 8, '2017-12-26 22:26:51'),
(53, 5, '510', 'Bomba Hidrostatica', 'vistas/img/productos/510/870.jpg', 8, 770, 1078, 12, '2017-12-26 22:26:51'),
(54, 5, '511', 'Chapeta', 'vistas/img/productos/511/239.jpg', 16, 660, 924, 4, '2017-12-26 22:27:42'),
(55, 5, '512', 'Cilindro muestra de concreto', 'vistas/img/productos/512/266.jpg', 16, 400, 560, 4, '2017-12-26 22:27:41'),
(56, 5, '513', 'Cizalla de Palanca', 'vistas/img/productos/513/445.jpg', 3, 450, 630, 17, '2017-12-27 00:30:12'),
(57, 5, '514', 'Cizalla de Tijera', 'vistas/img/productos/514/249.jpg', 20, 580, 812, 13, '2017-12-27 04:29:22'),
(58, 5, '515', 'Coche llanta neumatica', 'vistas/img/productos/515/174.jpg', 17, 420, 588, 3, '2017-12-27 00:30:12'),
(59, 5, '516', 'Cono slump', 'vistas/img/productos/516/228.jpg', 15, 140, 196, 5, '2018-02-06 22:47:02'),
(60, 5, '517', 'Cortadora de Baldosin', 'vistas/img/productos/517/746.jpg', 5, 930, 1302, 17, '2020-02-26 01:04:01');
--
-- Disparadores `productos`
--
DELIMITER $$
CREATE TRIGGER `insertproduct` AFTER INSERT ON `productos` FOR EACH ROW INSERT INTO bd_inventario.productos SET id=NEW.id,id_categoria=NEW.id_categoria,codigo=NEW.codigo,descripcion=NEW.descripcion,imagen=NEW.imagen,stock=NEW.stock,precio_compra=NEW.precio_compra,
precio_venta=NEW.precio_venta,ventas=NEW.ventas,fecha=NEW.fecha
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `updateproduct` AFTER UPDATE ON `productos` FOR EACH ROW UPDATE bd_inventario.productos SET id=NEW.id,id_categoria=NEW.id_categoria,codigo=NEW.codigo,descripcion=NEW.descripcion,imagen=NEW.imagen,stock=NEW.stock,precio_compra=NEW.precio_compra,
precio_venta = NEW.precio_venta, ventas = NEW.ventas, fecha = NEW.fecha WHERE id = NEW.id
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuarios`
--
CREATE TABLE `usuarios` (
`id` int(11) NOT NULL,
`nombre` text COLLATE utf8_spanish_ci NOT NULL,
`usuario` text COLLATE utf8_spanish_ci NOT NULL,
`password` text COLLATE utf8_spanish_ci NOT NULL,
`perfil` text COLLATE utf8_spanish_ci NOT NULL,
`foto` text COLLATE utf8_spanish_ci NOT NULL,
`estado` int(11) NOT NULL,
`ultimo_login` datetime NOT NULL,
`fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `usuarios`
--
INSERT INTO `usuarios` (`id`, `nombre`, `usuario`, `password`, `perfil`, `foto`, `estado`, `ultimo_login`, `fecha`) VALUES
(1, 'Administrador', 'admin', '$2a$07$asxx54ahjppf45sd87a5auXBm1Vr2M1NV5t/zNQtGHGpS5fFirrbG', 'Administrador', 'vistas/img/usuarios/admin/191.jpg', 1, '2020-02-25 18:51:19', '2020-02-25 23:51:20'),
(57, '<NAME>', 'juan', '$2a$07$asxx54ahjppf45sd87a5auwRi.z6UsW7kVIpm0CUEuCpmsvT2sG6O', 'Vendedor', 'vistas/img/usuarios/juan/461.jpg', 1, '2018-02-06 16:58:50', '2018-02-06 21:58:50'),
(58, '<NAME>', 'julio', '$2a$07$asxx54ahjppf45sd87a5auQhldmFjGsrgUipGlmQgDAcqevQZSAAC', 'Especial', 'vistas/img/usuarios/julio/100.png', 1, '2018-02-06 17:09:22', '2018-02-06 22:09:22'),
(59, '<NAME>', 'ana', '$2a$07$asxx54ahjppf45sd87a5auLd2AxYsA/2BbmGKNk2kMChC3oj7V0Ca', 'Vendedor', 'vistas/img/usuarios/ana/260.png', 1, '2017-12-26 19:21:40', '2017-12-27 00:21:40'),
(65, 'miafasdf', 'miguel', '$2a$07$asxx54ahjppf45sd87a5aum2asoJPgkM6AOTNeSlHrUhy1A1//yMC', 'Administrador', '', 1, '0000-00-00 00:00:00', '2020-02-26 00:45:50'),
(66, 'Bratt', 'bratt', '$2a$07$asxx54ahjppf45sd87a5auGZEtGHuyZwm.Ur.FJvWLCql3nmsMbXy', 'Administrador', '', 1, '0000-00-00 00:00:00', '2020-02-26 00:45:53'),
(67, 'jesus', 'jesus', '$2a$07$asxx54ahjppf45sd87a5aum2asoJPgkM6AOTNeSlHrUhy1A1//yMC', 'Especial', '', 0, '0000-00-00 00:00:00', '2020-02-26 00:59:44');
--
-- Disparadores `usuarios`
--
DELIMITER $$
CREATE TRIGGER `insertusers` AFTER INSERT ON `usuarios` FOR EACH ROW INSERT INTO bd_ventas.usuarios SET id = NEW.id ,nombre = NEW.nombre ,usuario = NEW.usuario ,password = <PASSWORD> ,perfil = NEW.perfil ,foto = NEW.foto ,estado = NEW.estado ,
ultimo_login = NEW.ultimo_login ,fecha = NEW.fecha
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `updateusers` AFTER UPDATE ON `usuarios` FOR EACH ROW UPDATE bd_ventas.usuarios SET id = NEW.id ,nombre = NEW.nombre ,usuario = NEW.usuario ,password = <PASSWORD> ,perfil = NEW.perfil ,foto = NEW.foto ,estado = NEW.estado ,
ultimo_login = NEW.ultimo_login ,fecha = NEW.fecha WHERE id = NEW.id
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ventas`
--
CREATE TABLE `ventas` (
`id` int(11) NOT NULL,
`codigo` int(11) NOT NULL,
`id_cliente` int(11) NOT NULL,
`id_vendedor` int(11) NOT NULL,
`productos` text COLLATE utf8_spanish_ci NOT NULL,
`impuesto` float NOT NULL,
`neto` float NOT NULL,
`total` float NOT NULL,
`metodo_pago` text COLLATE utf8_spanish_ci NOT NULL,
`fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `ventas`
--
INSERT INTO `ventas` (`id`, `codigo`, `id_cliente`, `id_vendedor`, `productos`, `impuesto`, `neto`, `total`, `metodo_pago`, `fecha`) VALUES
(17, 10001, 3, 1, '[{\"id\":\"1\",\"descripcion\":\"Aspiradora Industrial \",\"cantidad\":\"2\",\"stock\":\"13\",\"precio\":\"1200\",\"total\":\"2400\"},{\"id\":\"2\",\"descripcion\":\"Plato Flotante para Allanadora\",\"cantidad\":\"2\",\"stock\":\"7\",\"precio\":\"6300\",\"total\":\"12600\"},{\"id\":\"3\",\"descripcion\":\"Compresor de Aire para pintura\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"4200\",\"total\":\"4200\"}]', 3648, 19200, 22848, 'Efectivo', '2018-02-02 01:11:04'),
(18, 10002, 4, 59, '[{\"id\":\"5\",\"descripcion\":\"Cortadora de Piso sin Disco \",\"cantidad\":\"2\",\"stock\":\"18\",\"precio\":\"2156\",\"total\":\"4312\"},{\"id\":\"4\",\"descripcion\":\"Cortadora de Adobe sin Disco \",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"5600\",\"total\":\"5600\"},{\"id\":\"6\",\"descripcion\":\"Disco Punta Diamante \",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"1540\",\"total\":\"1540\"},{\"id\":\"7\",\"descripcion\":\"Extractor de Aire \",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"2156\",\"total\":\"2156\"}]', 2585.52, 13608, 16193.5, 'TC-34346346346', '2018-02-02 14:57:20'),
(19, 10003, 5, 59, '[{\"id\":\"8\",\"descripcion\":\"Guadañadora \",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"2156\",\"total\":\"2156\"},{\"id\":\"9\",\"descripcion\":\"Hidrolavadora Eléctrica \",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"3640\",\"total\":\"3640\"},{\"id\":\"7\",\"descripcion\":\"Extractor de Aire \",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"2156\",\"total\":\"2156\"}]', 1510.88, 7952, 9462.88, 'Efectivo', '2018-01-18 14:57:40'),
(20, 10004, 5, 59, '[{\"id\":\"3\",\"descripcion\":\"Compresor de Aire para pintura\",\"cantidad\":\"5\",\"stock\":\"14\",\"precio\":\"4200\",\"total\":\"21000\"},{\"id\":\"4\",\"descripcion\":\"Cortadora de Adobe sin Disco \",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"5600\",\"total\":\"5600\"},{\"id\":\"5\",\"descripcion\":\"Cortadora de Piso sin Disco \",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"2156\",\"total\":\"2156\"}]', 5463.64, 28756, 34219.6, 'TD-454475467567', '2018-01-25 14:58:09'),
(21, 10005, 6, 57, '[{\"id\":\"4\",\"descripcion\":\"Cortadora de Adobe sin Disco \",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"5600\",\"total\":\"5600\"},{\"id\":\"5\",\"descripcion\":\"Cortadora de Piso sin Disco \",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"2156\",\"total\":\"2156\"},{\"id\":\"3\",\"descripcion\":\"Compresor de Aire para pintura\",\"cantidad\":\"5\",\"stock\":\"9\",\"precio\":\"4200\",\"total\":\"21000\"}]', 5463.64, 28756, 34219.6, 'TC-6756856867', '2018-01-09 14:59:07'),
(22, 10006, 10, 1, '[{\"id\":\"3\",\"descripcion\":\"Compresor de Aire para pintura\",\"cantidad\":\"1\",\"stock\":\"8\",\"precio\":\"4200\",\"total\":\"4200\"},{\"id\":\"4\",\"descripcion\":\"Cortadora de Adobe sin Disco \",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"5600\",\"total\":\"5600\"},{\"id\":\"5\",\"descripcion\":\"Cortadora de Piso sin Disco \",\"cantidad\":\"3\",\"stock\":\"13\",\"precio\":\"2156\",\"total\":\"6468\"},{\"id\":\"6\",\"descripcion\":\"Disco Punta Diamante \",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"1540\",\"total\":\"1540\"}]', 3383.52, 17808, 21191.5, 'Efectivo', '2018-01-26 15:03:22'),
(23, 10007, 9, 1, '[{\"id\":\"6\",\"descripcion\":\"Disco Punta Diamante \",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"1540\",\"total\":\"1540\"},{\"id\":\"7\",\"descripcion\":\"Extractor de Aire \",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"2156\",\"total\":\"2156\"},{\"id\":\"8\",\"descripcion\":\"Guadañadora \",\"cantidad\":\"6\",\"stock\":\"13\",\"precio\":\"2156\",\"total\":\"12936\"},{\"id\":\"9\",\"descripcion\":\"Hidrolavadora Eléctrica \",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"3640\",\"total\":\"3640\"}]', 3851.68, 20272, 24123.7, 'TC-357547467346', '2017-11-30 15:03:53'),
(24, 10008, 12, 1, '[{\"id\":\"2\",\"descripcion\":\"Plato Flotante para Allanadora\",\"cantidad\":\"1\",\"stock\":\"6\",\"precio\":\"6300\",\"total\":\"6300\"},{\"id\":\"7\",\"descripcion\":\"Extractor de Aire \",\"cantidad\":\"5\",\"stock\":\"12\",\"precio\":\"2156\",\"total\":\"10780\"},{\"id\":\"6\",\"descripcion\":\"Disco Punta Diamante \",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"1540\",\"total\":\"1540\"},{\"id\":\"9\",\"descripcion\":\"Hidrolavadora Eléctrica \",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"3640\",\"total\":\"3640\"}]', 4229.4, 22260, 26489.4, 'TD-35745575', '2017-12-25 15:04:11'),
(25, 10009, 11, 1, '[{\"id\":\"10\",\"descripcion\":\"Hidrolavadora Gasolina\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"3094\",\"total\":\"3094\"},{\"id\":\"9\",\"descripcion\":\"Hidrolavadora Eléctrica \",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"3640\",\"total\":\"3640\"},{\"id\":\"6\",\"descripcion\":\"Disco Punta Diamante \",\"cantidad\":\"1\",\"stock\":\"15\",\"precio\":\"1540\",\"total\":\"1540\"}]', 1572.06, 8274, 9846.06, 'TD-5745745745', '2017-08-15 15:04:38'),
(26, 10010, 8, 1, '[{\"id\":\"9\",\"descripcion\":\"Hidrolavadora Eléctrica \",\"cantidad\":\"1\",\"stock\":\"15\",\"precio\":\"3640\",\"total\":\"3640\"},{\"id\":\"10\",\"descripcion\":\"Hidrolavadora Gasolina\",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"3094\",\"total\":\"3094\"}]', 1279.46, 6734, 8013.46, 'Efectivo', '2017-12-07 15:05:09'),
(27, 10011, 7, 1, '[{\"id\":\"60\",\"descripcion\":\"Cortadora de Baldosin\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"1302\",\"total\":\"1302\"},{\"id\":\"59\",\"descripcion\":\"Cono slump\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"196\",\"total\":\"196\"},{\"id\":\"58\",\"descripcion\":\"Coche llanta neumatica\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"588\",\"total\":\"588\"},{\"id\":\"57\",\"descripcion\":\"Cizalla de Tijera\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"812\",\"total\":\"812\"}]', 550.62, 2898, 3448.62, 'Efectivo', '2017-12-25 22:23:38'),
(28, 10012, 12, 57, '[{\"id\":\"59\",\"descripcion\":\"Cono slump\",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"196\",\"total\":\"196\"},{\"id\":\"58\",\"descripcion\":\"Coche llanta neumatica\",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"588\",\"total\":\"588\"},{\"id\":\"54\",\"descripcion\":\"Chapeta\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"924\",\"total\":\"924\"},{\"id\":\"53\",\"descripcion\":\"Bomba Hidrostatica\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"1078\",\"total\":\"1078\"}]', 529.34, 2786, 3315.34, 'TC-3545235235', '2017-12-25 22:24:24'),
(29, 10013, 11, 57, '[{\"id\":\"54\",\"descripcion\":\"Chapeta\",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"924\",\"total\":\"924\"},{\"id\":\"59\",\"descripcion\":\"Cono slump\",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"196\",\"total\":\"196\"},{\"id\":\"60\",\"descripcion\":\"Cortadora de Baldosin\",\"cantidad\":\"5\",\"stock\":\"14\",\"precio\":\"1302\",\"total\":\"6510\"}]', 1449.7, 7630, 9079.7, 'TC-425235235235', '2017-12-26 22:24:50'),
(30, 10014, 10, 57, '[{\"id\":\"59\",\"descripcion\":\"Cono slump\",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"196\",\"total\":\"196\"},{\"id\":\"54\",\"descripcion\":\"Chapeta\",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"924\",\"total\":\"924\"},{\"id\":\"53\",\"descripcion\":\"Bomba Hidrostatica\",\"cantidad\":\"10\",\"stock\":\"9\",\"precio\":\"1078\",\"total\":\"10780\"}]', 2261, 11900, 14161, 'Efectivo', '2017-12-26 22:25:09'),
(31, 10015, 9, 57, '[{\"id\":\"57\",\"descripcion\":\"Cizalla de Tijera\",\"cantidad\":\"3\",\"stock\":\"16\",\"precio\":\"812\",\"total\":\"2436\"}]', 462.84, 2436, 2898.84, 'Efectivo', '2017-12-26 22:25:33'),
(32, 10016, 8, 57, '[{\"id\":\"58\",\"descripcion\":\"Coche llanta neumatica\",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"588\",\"total\":\"588\"},{\"id\":\"57\",\"descripcion\":\"Cizalla de Tijera\",\"cantidad\":\"5\",\"stock\":\"11\",\"precio\":\"812\",\"total\":\"4060\"},{\"id\":\"56\",\"descripcion\":\"Cizalla de Palanca\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"630\",\"total\":\"630\"}]', 1002.82, 5278, 6280.82, 'TD-4523523523', '2017-12-26 22:25:55'),
(33, 10017, 7, 57, '[{\"id\":\"57\",\"descripcion\":\"Cizalla de Tijera\",\"cantidad\":\"4\",\"stock\":\"7\",\"precio\":\"812\",\"total\":\"3248\"},{\"id\":\"52\",\"descripcion\":\"Bascula \",\"cantidad\":\"3\",\"stock\":\"17\",\"precio\":\"182\",\"total\":\"546\"},{\"id\":\"55\",\"descripcion\":\"Cilindro muestra de concreto\",\"cantidad\":\"2\",\"stock\":\"18\",\"precio\":\"560\",\"total\":\"1120\"},{\"id\":\"56\",\"descripcion\":\"Cizalla de Palanca\",\"cantidad\":\"1\",\"stock\":\"18\",\"precio\":\"630\",\"total\":\"630\"}]', 1053.36, 5544, 6597.36, 'Efectivo', '2017-12-26 22:26:28'),
(34, 10018, 6, 57, '[{\"id\":\"51\",\"descripcion\":\"Tensor\",\"cantidad\":\"1\",\"stock\":\"19\",\"precio\":\"140\",\"total\":\"140\"},{\"id\":\"52\",\"descripcion\":\"Bascula \",\"cantidad\":\"5\",\"stock\":\"12\",\"precio\":\"182\",\"total\":\"910\"},{\"id\":\"53\",\"descripcion\":\"Bomba Hidrostatica\",\"cantidad\":\"1\",\"stock\":\"8\",\"precio\":\"1078\",\"total\":\"1078\"}]', 404.32, 2128, 2532.32, 'Efectivo', '2017-12-26 22:26:51'),
(35, 10019, 5, 57, '[{\"id\":\"56\",\"descripcion\":\"Cizalla de Palanca\",\"cantidad\":\"15\",\"stock\":\"3\",\"precio\":\"630\",\"total\":\"9450\"},{\"id\":\"55\",\"descripcion\":\"Cilindro muestra de concreto\",\"cantidad\":\"1\",\"stock\":\"17\",\"precio\":\"560\",\"total\":\"560\"}]', 1901.9, 10010, 11911.9, 'Efectivo', '2017-12-26 22:27:13'),
(36, 10020, 4, 57, '[{\"id\":\"55\",\"descripcion\":\"Cilindro muestra de concreto\",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"560\",\"total\":\"560\"},{\"id\":\"54\",\"descripcion\":\"Chapeta\",\"cantidad\":\"1\",\"stock\":\"16\",\"precio\":\"924\",\"total\":\"924\"}]', 281.96, 1484, 1765.96, 'TC-46346346346', '2017-12-26 22:27:42'),
(37, 10021, 3, 1, '[{\"id\":\"60\",\"descripcion\":\"Cortadora de Baldosin\",\"cantidad\":\"1\",\"stock\":\"13\",\"precio\":\"1302\",\"total\":\"1302\"},{\"id\":\"59\",\"descripcion\":\"Cono slump\",\"cantidad\":\"1\",\"stock\":\"15\",\"precio\":\"196\",\"total\":\"196\"}]', 149.8, 1498, 1647.8, 'Efectivo', '2018-02-06 22:47:02'),
(38, 10022, 5, 1, '[{\"id\":\"60\",\"descripcion\":\"Cortadora de Baldosin\",\"cantidad\":\"10\",\"stock\":\"5\",\"precio\":\"1302\",\"total\":\"13020\"}]', 2343.6, 13020, 15363.6, 'Efectivo', '2020-02-26 01:04:01');
--
-- Disparadores `ventas`
--
DELIMITER $$
CREATE TRIGGER `insertsales` AFTER INSERT ON `ventas` FOR EACH ROW INSERT INTO bd_ventas.ventas SET id=id = NEW.id,codigo = NEW.codigo,id_cliente = NEW.id_cliente,id_vendedor = NEW.id_vendedor,productos = NEW.productos,impuesto = NEW.impuesto,
neto = NEW.neto,total = NEW.total,metodo_pago = NEW.metodo_pago,fecha = NEW.fecha
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `updatesales` AFTER UPDATE ON `ventas` FOR EACH ROW UPDATE bd_ventas.ventas SET id = NEW.id,codigo = NEW.codigo,id_cliente = NEW.id_cliente,id_vendedor = NEW.id_vendedor,productos = NEW.productos,impuesto = NEW.impuesto,
neto = NEW.neto,total = NEW.total,metodo_pago = NEW.metodo_pago,fecha = NEW.fecha WHERE id = NEW.id
$$
DELIMITER ;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `categorias`
--
ALTER TABLE `categorias`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `clientes`
--
ALTER TABLE `clientes`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `productos`
--
ALTER TABLE `productos`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `usuarios`
--
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `ventas`
--
ALTER TABLE `ventas`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `categorias`
--
ALTER TABLE `categorias`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT de la tabla `clientes`
--
ALTER TABLE `clientes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT de la tabla `productos`
--
ALTER TABLE `productos`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=61;
--
-- AUTO_INCREMENT de la tabla `usuarios`
--
ALTER TABLE `usuarios`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;
--
-- AUTO_INCREMENT de la tabla `ventas`
--
ALTER TABLE `ventas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- MySQL dump 10.13 Distrib 5.5.52, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: cms-core
-- ------------------------------------------------------
-- Server version 5.5.52-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `site`
--
DROP TABLE IF EXISTS `site`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site` (
`site_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`status` int(11) NOT NULL DEFAULT '0',
`domain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`is_sanmax_hosting` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`contact_info` text COLLATE utf8_unicode_ci,
`description` text COLLATE utf8_unicode_ci,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`site_id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site`
--
LOCK TABLES `site` WRITE;
/*!40000 ALTER TABLE `site` DISABLE KEYS */;
INSERT INTO `site` VALUES (41,0,'','1',NULL,NULL,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12');
/*!40000 ALTER TABLE `site` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_database`
--
DROP TABLE IF EXISTS `site_database`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_database` (
`site_database_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`site_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`port` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`database_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`table_prefix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`site_database_id`),
KEY `site_database_site_id_foreign` (`site_id`),
CONSTRAINT `site_database_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_database`
--
LOCK TABLES `site_database` WRITE;
/*!40000 ALTER TABLE `site_database` DISABLE KEYS */;
INSERT INTO `site_database` VALUES (41,41,'',NULL,'',NULL,'','$2y$10$/vytxw2q5e9y6/A53JXBv.GsaJnjZ5zb3xc09bCVYhbviiQGO20Ea',NULL,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12');
/*!40000 ALTER TABLE `site_database` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_hosting`
--
DROP TABLE IF EXISTS `site_hosting`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_hosting` (
`site_hosting_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`site_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`port` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`site_hosting_id`),
KEY `site_hosting_site_id_foreign` (`site_id`),
CONSTRAINT `site_hosting_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_hosting`
--
LOCK TABLES `site_hosting` WRITE;
/*!40000 ALTER TABLE `site_hosting` DISABLE KEYS */;
INSERT INTO `site_hosting` VALUES (41,41,'',NULL,'<EMAIL>','$2y$10$KdBb0sXOYwkTm0Y84i53u.baLOvX1p3QOakIuj0lc0HLAcq06/ePe',NULL,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12');
/*!40000 ALTER TABLE `site_hosting` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_info`
--
DROP TABLE IF EXISTS `site_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_info` (
`site_info_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`site_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`telephone` int(11) NOT NULL DEFAULT '0',
`address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`site_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`site_slogan` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`site_info_id`),
KEY `site_info_site_id_foreign` (`site_id`),
CONSTRAINT `site_info_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_info`
--
LOCK TABLES `site_info` WRITE;
/*!40000 ALTER TABLE `site_info` DISABLE KEYS */;
INSERT INTO `site_info` VALUES (41,41,2147483647,'rose test','rose test',NULL,'Rose','<EMAIL>',NULL,NULL,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12');
/*!40000 ALTER TABLE `site_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_language`
--
DROP TABLE IF EXISTS `site_language`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_language` (
`site_language_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`site_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`language_id` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`site_language_id`),
KEY `site_language_site_id_foreign` (`site_id`),
KEY `site_language_language_id_foreign` (`language_id`),
CONSTRAINT `site_language_language_id_foreign` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON DELETE CASCADE,
CONSTRAINT `site_language_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_language`
--
LOCK TABLES `site_language` WRITE;
/*!40000 ALTER TABLE `site_language` DISABLE KEYS */;
INSERT INTO `site_language` VALUES (106,41,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12',11),(107,41,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12',12),(108,41,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12',13),(109,41,NULL,'2017-03-17 08:02:12','2017-03-17 08:02:12',14);
/*!40000 ALTER TABLE `site_language` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_theme`
--
DROP TABLE IF EXISTS `site_theme`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_theme` (
`site_theme_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`site_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`theme_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`site_theme_id`),
KEY `site_theme_site_id_foreign` (`site_id`),
KEY `site_theme_theme_id_foreign` (`theme_id`),
CONSTRAINT `site_theme_theme_id_foreign` FOREIGN KEY (`theme_id`) REFERENCES `themes` (`id`) ON DELETE CASCADE,
CONSTRAINT `site_theme_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_theme`
--
LOCK TABLES `site_theme` WRITE;
/*!40000 ALTER TABLE `site_theme` DISABLE KEYS */;
INSERT INTO `site_theme` VALUES (107,41,304,'2017-03-17 08:05:53','2017-03-17 08:05:53',NULL);
/*!40000 ALTER TABLE `site_theme` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comments` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`author` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` longtext COLLATE utf8_unicode_ci NOT NULL,
`approved` tinyint(1) NOT NULL DEFAULT '0',
`parent` bigint(20) NOT NULL DEFAULT '0',
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `comments_email_unique` (`email`),
KEY `comments_post_id_index` (`post_id`),
CONSTRAINT `comments_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `comments`
--
LOCK TABLES `comments` WRITE;
/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `contacts`
--
DROP TABLE IF EXISTS `contacts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contacts` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`message` text COLLATE utf8_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `contacts`
--
LOCK TABLES `contacts` WRITE;
/*!40000 ALTER TABLE `contacts` DISABLE KEYS */;
/*!40000 ALTER TABLE `contacts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `countries`
--
DROP TABLE IF EXISTS `countries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `countries` (
`country_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `countries`
--
LOCK TABLES `countries` WRITE;
/*!40000 ALTER TABLE `countries` DISABLE KEYS */;
INSERT INTO `countries` VALUES (1,'English','en',NULL,NULL,NULL),(2,'Dutch','nl',NULL,NULL,NULL),(3,'German','de',NULL,NULL,NULL),(4,'French','fr',NULL,NULL,NULL);
/*!40000 ALTER TABLE `countries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `galleries`
--
DROP TABLE IF EXISTS `galleries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `galleries` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`gallery_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`gallery_status` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `galleries`
--
LOCK TABLES `galleries` WRITE;
/*!40000 ALTER TABLE `galleries` DISABLE KEYS */;
INSERT INTO `galleries` VALUES (1,'Gallery Slider',1,NULL,NULL,NULL),(2,'Slider',1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `galleries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gallery_images`
--
DROP TABLE IF EXISTS `gallery_images`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gallery_images` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`gallery_id` bigint(20) unsigned NOT NULL,
`image_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`image_title` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`image_link` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image_description` text COLLATE utf8_unicode_ci NOT NULL,
`image_status` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `gallery_images_gallery_id_index` (`gallery_id`),
CONSTRAINT `gallery_images_gallery_id_foreign` FOREIGN KEY (`gallery_id`) REFERENCES `galleries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gallery_images`
--
LOCK TABLES `gallery_images` WRITE;
/*!40000 ALTER TABLE `gallery_images` DISABLE KEYS */;
INSERT INTO `gallery_images` VALUES (1,1,'1489465563-Chrysanthemum.jpg','Why do we use it?','http://www.lipsum.com/','It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).',1,NULL,NULL,NULL),(2,1,'1478182208-images (1).jpg','What is Lorem Ipsum?','http://www.lipsum.com/','Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.',1,NULL,NULL,NULL),(3,1,'1478182065-images1236346_1926933_787295351331675_9172257670834369168_n.jpg','Where can I get some?','','There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don\'t look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn\'t anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.',1,NULL,NULL,NULL),(4,1,'1478182081-hurghada.JPG',' Where does it come from?','http://www.lipsum.com/','Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. <NAME>, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.\r\n\r\nThe standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from \"de Finibus Bonorum et Malorum\" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by <NAME>.',1,NULL,NULL,NULL),(5,1,'1478184014-images.jpg','The standard Lorem Ipsum passage, used since the 1500s','http://www.lipsum.com/','\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\"',1,NULL,NULL,NULL),(6,2,'1489053398-content-img.jpg','','','',1,NULL,NULL,NULL),(7,2,'1489053406-content-img.jpg','','','',1,NULL,NULL,NULL),(8,1,'1489737960-Hydrangeas.jpg','','','',1,NULL,NULL,NULL),(9,1,'1489738005-8616670b3f511795137c65ef0151c3f2.jpg','','','',1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `gallery_images` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `language`
--
DROP TABLE IF EXISTS `language`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `language` (
`language_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`country_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT '1',
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`language_id`),
KEY `language_country_id_foreign` (`country_id`),
CONSTRAINT `language_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`country_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `language`
--
LOCK TABLES `language` WRITE;
/*!40000 ALTER TABLE `language` DISABLE KEYS */;
INSERT INTO `language` VALUES (11,3,'German','','',1,NULL,NULL,NULL),(12,2,'Dutch','','',1,NULL,NULL,NULL),(13,4,'French','','',1,NULL,NULL,NULL),(14,1,'English','','',1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `language` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `migrations`
--
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `migrations`
--
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES ('2014_10_12_000000_create_roles_table',1),('2014_10_12_000001_create_users_table',1),('2014_10_12_100000_create_password_resets_table',1),('2016_06_05_151525_create_table_articles',1),('2016_07_22_213333_create_table_term_relationships',1),('2016_07_23_103628_create_table_term_taxonomy',1),('2016_07_23_103647_create_table_terms',1),('2016_07_23_105531_create_table_article_meta',1),('2016_08_18_143846_create_options_table',1),('2016_08_24_190534_create_table_themes',1),('2016_08_25_151736_create_table_theme_meta',1),('2016_08_26_082921_create_table_widget_groups',1),('2016_08_26_082938_create_table_widget',1),('2016_08_31_100931_create_table_user_meta',1),('2016_08_31_151324_create_table_comments',1),('2016_11_01_081606_galleries',1),('2016_11_01_081617_gallery_images',1),('2016_11_11_035809_add_provider_to_users_table',2),('2017_02_17_072353_create_site_table',2),('2017_02_17_075212_create_site_database_table',2),('2017_02_17_075510_create_site_hosting_table',2),('2017_02_17_075520_create_site_info_table',2),('2017_02_17_091202_create_post_translations_table',2),('2017_02_17_092510_create_countries_table',2),('2017_02_17_092547_create_language_table',2),('2017_02_17_092951_create_site_language_table',2),('2017_02_21_033231_create_theme_type_table',2),('2017_02_21_034328_add_publish_parent_to_theme_table',3),('2016_11_03_153632_create_contacts_table',4),('2017_02_28_071937_drop_theme_id_from_site_table',4),('2017_02_28_080337_create_site_theme_table',4),('2017_02_28_102355_add_status_to_site_table',4),('2017_03_02_121655_add_field_machine_name_to_themes',5),('2017_03_03_074358_add_telephone_to_site_info_table',5),('2017_03_07_071127_update_foreign_key_language_table',5),('2017_03_13_025012_add_status_to_language_table',6),('2017_03_13_033156_translate_table',6),('2017_03_14_125332_create_term_translations_tabel',7);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `options`
--
DROP TABLE IF EXISTS `options`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `options` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` longtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `options`
--
LOCK TABLES `options` WRITE;
/*!40000 ALTER TABLE `options` DISABLE KEYS */;
INSERT INTO `options` VALUES (1,'site_title','QSoft Vietnam'),(2,'site_tagline','Content Management System'),(3,'email_administrator','<EMAIL>'),(4,'frontpage_blog','0'),(5,'view_post_index','10'),(6,'image_thumbnail_width','150'),(7,'image_thumbnail_height','150'),(8,'image_medium_width','300'),(9,'image_medium_height','300'),(10,'image_large_width','1024'),(11,'image_large_height','800'),(12,'menu_name','a:14:{i:0;s:9:\"main-menu\";i:1;s:11:\"tes-website\";i:2;s:12:\"test-website\";i:3;s:12:\"test-website\";i:4;s:10:\"about-us-2\";i:5;s:12:\"social-media\";i:6;s:5:\"forum\";i:7;s:6:\"doctor\";i:8;s:9:\"test-menu\";i:9;s:9:\"test-menu\";i:10;s:9:\"rose-test\";i:11;s:14:\"rose-test-menu\";i:12;s:16:\"test-create-menu\";i:13;s:8:\"xus-menu\";}'),(13,'show_on_front','page'),(14,'page_on_front','post-12');
/*!40000 ALTER TABLE `options` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `password_resets`
--
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
KEY `password_resets_email_index` (`email`),
KEY `password_resets_token_index` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `password_resets`
--
LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
INSERT INTO `password_resets` VALUES ('<EMAIL>','<PASSWORD>','2016-11-16 02:12:16');
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `post_meta`
--
DROP TABLE IF EXISTS `post_meta`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `post_meta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`meta_value` longtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`meta_id`),
KEY `post_meta_post_id_index` (`post_id`),
KEY `post_meta_meta_key_index` (`meta_key`),
CONSTRAINT `post_meta_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=644 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `post_meta`
--
LOCK TABLES `post_meta` WRITE;
/*!40000 ALTER TABLE `post_meta` DISABLE KEYS */;
INSERT INTO `post_meta` VALUES (221,128,'_nav_item_parent','132'),(222,128,'_nav_item_url','qui-totam-nisi-natus-quaerat-asperiores-laboriosam-modi'),(223,128,'_nav_item_type','post'),(224,129,'_nav_item_parent','132'),(225,129,'_nav_item_url','maiores-voluptatem-alias-non-et-rem'),(226,129,'_nav_item_type','post'),(227,130,'_nav_item_parent','132'),(228,130,'_nav_item_url','ea-quia-corporis-incidunt-voluptatibus'),(229,130,'_nav_item_type','post'),(230,131,'_nav_item_parent','132'),(231,131,'_nav_item_url','nisi-rerum-ut-hic-optio-quisquam-cum'),(232,131,'_nav_item_type','post'),(233,132,'_nav_item_parent',''),(234,132,'_nav_item_url','http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com'),(235,132,'_nav_item_type','home'),(236,133,'_nav_item_parent',''),(237,133,'_nav_item_url','http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com'),(238,133,'_nav_item_type','home'),(252,138,'_file_size','37797'),(253,139,'_file_size','24512'),(263,143,'_file_size','142685'),(272,147,'_file_size','6722979'),(363,183,'_file_size','106600'),(369,186,'_file_size','466252'),(389,194,'_file_size','487886'),(396,197,'_file_size','217859'),(432,211,'_file_size','37797'),(433,212,'_file_size','4658'),(436,214,'_file_size','879394'),(501,238,'_file_size','845941'),(517,246,'_file_size','487886'),(529,252,'_nav_item_parent',''),(530,252,'_nav_item_url',''),(531,252,'_nav_item_type','home'),(535,254,'_nav_item_parent',''),(536,254,'_nav_item_url','contact'),(537,254,'_nav_item_type','page'),(538,255,'_nav_item_parent',''),(539,255,'_nav_item_url','info-for-patient'),(540,255,'_nav_item_type','page'),(541,256,'_nav_item_parent',''),(542,256,'_nav_item_url','news'),(543,256,'_nav_item_type','page'),(550,259,'_nav_item_parent',''),(551,259,'_nav_item_url','dr'),(552,259,'_nav_item_type','category'),(570,266,'_nav_item_parent',''),(571,266,'_nav_item_url','xus-page'),(572,266,'_nav_item_type','page'),(632,287,'layout',''),(633,287,'featured_img',''),(634,288,'layout',''),(635,288,'featured_img',''),(638,290,'layout',''),(639,290,'featured_img',''),(640,291,'layout',''),(641,291,'featured_img',''),(642,292,'layout',''),(643,292,'featured_img','');
/*!40000 ALTER TABLE `post_meta` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `post_translations`
--
DROP TABLE IF EXISTS `post_translations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `post_translations` (
`post_translations_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`post_title` text COLLATE utf8_unicode_ci NOT NULL,
`post_excerpt` text COLLATE utf8_unicode_ci NOT NULL,
`post_content` longtext COLLATE utf8_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`post_translations_id`),
KEY `post_translations_post_id_foreign` (`post_id`),
CONSTRAINT `post_translations_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=430 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `post_translations`
--
LOCK TABLES `post_translations` WRITE;
/*!40000 ALTER TABLE `post_translations` DISABLE KEYS */;
INSERT INTO `post_translations` VALUES (49,183,'en','8616670b3f511795137c65ef0151c3f2','','',NULL,'2017-03-15 08:24:11','2017-03-15 08:24:11'),(54,186,'en','0205080_PE360076_S5','','',NULL,'2017-03-15 08:42:44','2017-03-15 08:42:44'),(67,194,'en','Chrysanthemum','','',NULL,'2017-03-15 10:03:33','2017-03-15 10:03:33'),(68,197,'en','Creative Bookshelf 211__700','','',NULL,'2017-03-15 10:27:15','2017-03-15 10:27:15'),(117,211,'en','Doctor 2','','',NULL,'2017-03-16 05:56:10','2017-03-16 05:56:10'),(118,212,'en','Logo','','',NULL,'2017-03-16 05:59:23','2017-03-16 05:59:23'),(123,214,'en','Chrysanthemum','','',NULL,'2017-03-16 08:00:28','2017-03-16 08:00:28'),(216,238,'en','Desert','','',NULL,'2017-03-16 08:14:58','2017-03-16 08:14:58'),(245,246,'en','Chrysanthemum','','',NULL,'2017-03-16 08:50:05','2017-03-16 08:50:05'),(266,252,'fr','Home','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(267,252,'en','Home','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(268,252,'nl','Home','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(269,252,'de','Home','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(274,254,'fr','contact us','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(275,254,'en','Contact','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(276,254,'nl','Contact Us','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(277,254,'de','contact german','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(278,255,'fr','Info for patient in French','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(279,255,'en','Info for patient','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(280,255,'nl','Info for patient in Dutch','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(281,255,'de','Info for patient in German','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(282,256,'fr','News in French','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(283,256,'en','News','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(284,256,'nl','News in Dutch','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(285,256,'de','News is German','','',NULL,'2017-03-16 10:11:14','2017-03-16 10:11:14'),(294,259,'fr','Doctor in Fr','','',NULL,'2017-03-16 10:12:38','2017-03-16 10:12:38'),(295,259,'en','Doctor in EN','','',NULL,'2017-03-16 10:12:38','2017-03-16 10:12:38'),(296,259,'nl','Doctor in Du','','',NULL,'2017-03-16 10:12:38','2017-03-16 10:12:38'),(297,259,'de','Doctor in Gr','','',NULL,'2017-03-16 10:12:38','2017-03-16 10:12:38'),(322,266,'fr','','','',NULL,'2017-03-16 10:49:35','2017-03-16 10:49:35'),(323,266,'en','Xu\'s page','','',NULL,'2017-03-16 10:49:35','2017-03-16 10:49:35'),(324,266,'nl','','','',NULL,'2017-03-16 10:49:35','2017-03-16 10:49:35'),(325,266,'de','','','',NULL,'2017-03-16 10:49:35','2017-03-16 10:49:35'),(406,287,'fr','Home_FR','','<p>xzbfuwhdjnsc</p>',NULL,'2017-03-17 07:35:06','2017-03-17 07:35:06'),(407,287,'en','Home_EN','','<p>dskhoiwhkjnxz</p>',NULL,'2017-03-17 07:35:06','2017-03-17 07:35:06'),(408,287,'nl','Home_Du','','<p>sbjckjhldoih</p>',NULL,'2017-03-17 07:35:06','2017-03-17 07:35:06'),(409,287,'de','Home_GR','','<p>bfjheuihklncnzm</p>',NULL,'2017-03-17 07:35:06','2017-03-17 07:35:06'),(410,288,'fr','Contact_FR','','<p>zdgwuidgbhj</p>',NULL,'2017-03-17 07:36:04','2017-03-17 07:36:04'),(411,288,'en','Contact_EN','','<p>scaygdjk nc</p>',NULL,'2017-03-17 07:36:04','2017-03-17 07:36:04'),(412,288,'nl','Contact_Du','','<p>cb ạbdhnjcns</p>',NULL,'2017-03-17 07:36:04','2017-03-17 07:36:04'),(413,288,'de','Contact_Gr','','<p>zjbnjenckznklnj kdnjk</p>',NULL,'2017-03-17 07:36:04','2017-03-17 07:45:08'),(418,290,'fr','Info for Patient_FR','','<p>xgsegbdfb</p>',NULL,'2017-03-17 07:45:38','2017-03-17 07:45:38'),(419,290,'en','Info for patient_EN','','<p>sdgvcbdbv</p>',NULL,'2017-03-17 07:45:38','2017-03-17 07:45:38'),(420,290,'nl','','','',NULL,'2017-03-17 07:45:38','2017-03-17 07:45:38'),(421,290,'de','','','',NULL,'2017-03-17 07:45:38','2017-03-17 07:45:38'),(422,291,'fr','News_Fr','','<p>bdsdgasdubg</p>',NULL,'2017-03-17 07:52:48','2017-03-17 07:52:48'),(423,291,'en','News_EN','','<p>bcvhjsgfuhjxh</p>',NULL,'2017-03-17 07:52:48','2017-03-17 07:52:48'),(424,291,'nl','','','',NULL,'2017-03-17 07:52:48','2017-03-17 07:52:48'),(425,291,'de','','','',NULL,'2017-03-17 07:52:48','2017-03-17 07:52:48'),(426,292,'en','What is this \'Lorem Ipsum\' or \'Lorum Ipsum\' stuff?','','<p style=\"margin-top: 9px; margin-bottom: 9px; padding: 0px; border: 0px; outline: 0px; font-size: 12px; vertical-align: baseline; background: transparent; line-height: 18px; font-family: Helvetica, Arial, sans-serif;\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Videmus igitur ut conquiescere ne infantes quidem possint. An est aliquid per se ipsum flagitiosum, etiamsi nulla comitetur infamia? Idem iste, inquam, de voluptate quid sentit?</p><p style=\"margin-top: 9px; margin-bottom: 9px; padding: 0px; border: 0px; outline: 0px; font-size: 12px; vertical-align: baseline; background: transparent; line-height: 18px; font-family: Helvetica, Arial, sans-serif;\">Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Tu vero, inquam, ducas licet, si sequetur; Quid igitur dubitamus in tota eius natura quaerere quid sit effectum? Ut proverbia non nulla veriora sint quam vestra dogmata. Duo Reges: constructio interrete. Quantum Aristoxeni ingenium consumptum videmus in musicis? Nec vero alia sunt quaerenda contra Carneadeam illam sententiam. Est igitur officium eius generis, quod nec in bonis ponatur nec in contrariis. Cur id non ita fit? Aliter enim explicari, quod quaeritur, non potest. Idem iste, inquam, de voluptate quid sentit? Non igitur de improbo, sed de callido improbo quaerimus, qualis Q.</p><p style=\"margin-top: 9px; margin-bottom: 9px; padding: 0px; border: 0px; outline: 0px; font-size: 12px; vertical-align: baseline; background: transparent; line-height: 18px; font-family: Helvetica, Arial, sans-serif;\">Haec bene dicuntur, nec ego repugno, sed inter sese ipsa pugnant. Sed ego in hoc resisto; Sed tu istuc dixti bene Latine, parum plane. Si verbum sequimur, primum longius verbum praepositum quam bonum.</p><p style=\"margin-top: 9px; margin-bottom: 9px; padding: 0px; border: 0px; outline: 0px; font-size: 12px; vertical-align: baseline; background: transparent; line-height: 18px; font-family: Helvetica, Arial, sans-serif;\">Paulum, cum regem Persem captum adduceret, eodem flumine invectio? Hoc non est positum in nostra actione. Quae similitudo in genere etiam humano apparet. Hinc ceteri particulas arripere conati suam quisque videro voluit afferre sententiam.</p><p style=\"margin-top: 9px; margin-bottom: 9px; padding: 0px; border: 0px; outline: 0px; font-size: 12px; vertical-align: baseline; background: transparent; line-height: 18px; font-family: Helvetica, Arial, sans-serif;\">Scisse enim te quis coarguere possit? Animum autem reliquis rebus ita perfecit, ut corpus; Quae cum essent dicta, discessimus. Stuprata per vim Lucretia a regis filio testata civis se ipsa interemit. Hoc non est positum in nostra actione. Cur id non ita fit? Negat esse eam, inquit, propter se expetendam. Etenim semper illud extra est, quod arte comprehenditur. Non potes, nisi retexueris illa</p>',NULL,'2017-03-17 08:03:20','2017-03-17 08:03:20'),(427,292,'fr','What is this \'Lorem Ipsum\' or \'Lorum Ipsum\' stuff?_FR','','<p style=\"text-align: justify; margin-top: 9px; margin-bottom: 9px; padding: 0px; border: 0px; outline: 0px; font-size: 12px; vertical-align: baseline; background: transparent; line-height: 18px; font-family: Helvetica, Arial, sans-serif;\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Videmus igitur ut conquiescere ne infantes quidem possint. An est aliquid per se ipsum flagitiosum, etiamsi nulla comitetur infamia? Idem iste, inquam, de voluptate quid sentit?<br>Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Tu vero, inquam, ducas licet, si sequetur; Quid igitur dubitamus in tota eius natura quaerere quid sit effectum? Ut proverbia non nulla veriora sint quam vestra dogmata. Duo Reges: constructio interrete. Quantum Aristoxeni ingenium consumptum videmus in musicis? Nec vero alia sunt quaerenda contra Carneadeam illam sententiam. Est igitur officium eius generis, quod nec in bonis ponatur nec in contrariis. Cur id non ita fit? Aliter enim explicari, quod quaeritur, non potest. Idem iste, inquam, de voluptate quid sentit? Non igitur de improbo, sed de callido improbo quaerimus, qualis Q.<br>Haec bene dicuntur, nec ego repugno, sed inter sese ipsa pugnant. Sed ego in hoc resisto; Sed tu istuc dixti bene Latine, parum plane. Si verbum sequimur, primum longius verbum praepositum quam bonum.<br>Paulum, cum regem Persem captum adduceret, eodem<img src=\"http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/uploads/chrysanthemum.jpg\" style=\"width: 564px;\"> flumine invectio? Hoc non est positum in nostra actione. Quae similitudo in genere etiam humano apparet. Hinc ceteri particulas arripere conati suam quisque videro voluit afferre sententiam.<br>Scisse enim te quis coarguere possit? Animum autem reliquis rebus ita perfecit, ut corpus; Quae cum essent dicta, discessimus. Stuprata per vim Lucretia a regis filio testata civis se ipsa interemit. Hoc non est positum in nostra actione. Cur id non ita fit? Negat esse eam, inquit, propter se expetendam. Etenim semper illud extra est, quod arte comprehenditur. Non potes, nisi retexueris illa</p>',NULL,'2017-03-17 08:03:20','2017-03-17 08:03:20'),(428,292,'nl','','','',NULL,'2017-03-17 08:03:20','2017-03-17 08:03:20'),(429,292,'de','','','',NULL,'2017-03-17 08:03:20','2017-03-17 08:03:20');
/*!40000 ALTER TABLE `post_translations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `posts`
--
DROP TABLE IF EXISTS `posts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `posts` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_author` int(10) unsigned NOT NULL DEFAULT '0',
`post_content` longtext COLLATE utf8_unicode_ci NOT NULL,
`post_title` text COLLATE utf8_unicode_ci NOT NULL,
`post_excerpt` text COLLATE utf8_unicode_ci NOT NULL,
`post_status` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'publish',
`comment_status` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'open',
`post_password` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`post_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`post_parent` bigint(20) NOT NULL DEFAULT '0',
`guid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`menu_order` int(11) NOT NULL DEFAULT '0',
`menu_group` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`post_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`post_hit` int(11) NOT NULL DEFAULT '0',
`post_mime_type` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'post',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `posts_post_author_foreign` (`post_author`),
CONSTRAINT `posts_post_author_foreign` FOREIGN KEY (`post_author`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=293 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `posts`
--
LOCK TABLES `posts` WRITE;
/*!40000 ALTER TABLE `posts` DISABLE KEYS */;
INSERT INTO `posts` VALUES (29,1,'','Logo','','inherit','open','','logo.jpg',0,'',0,'','attachment',0,'image/jpeg','2016-11-03 17:24:06','2016-11-03 17:24:06'),(128,1,'','Qui totam nisi natus quaerat asperiores laboriosam modi.','','publish','close','','qui-totam-nisi-natus-quaerat-asperiores-laboriosam-modi',0,'',2,'about-us-2','nav-menu',0,'nav-menu','2017-03-09 03:01:22','2017-03-09 03:02:01'),(129,1,'','Maiores voluptatem alias non et rem.','','publish','close','','maiores-voluptatem-alias-non-et-rem',0,'',3,'about-us-2','nav-menu',0,'nav-menu','2017-03-09 03:01:22','2017-03-09 03:02:01'),(130,1,'','Ea quia corporis incidunt voluptatibus.','','publish','close','','ea-quia-corporis-incidunt-voluptatibus',0,'',4,'about-us-2','nav-menu',0,'nav-menu','2017-03-09 03:01:22','2017-03-09 03:02:01'),(131,1,'','Nisi rerum ut hic optio quisquam cum.','','publish','close','','nisi-rerum-ut-hic-optio-quisquam-cum',0,'',5,'about-us-2','nav-menu',0,'nav-menu','2017-03-09 03:01:22','2017-03-09 03:02:01'),(132,1,'','Home','','publish','close','','home',0,'',1,'about-us-2','nav-menu',0,'nav-menu','2017-03-09 03:01:39','2017-03-09 03:02:01'),(133,1,'','Home','','publish','close','','home',0,'',0,'about-us-2','nav-menu',0,'nav-menu','2017-03-09 03:02:12','2017-03-09 03:02:12'),(138,1,'','Doctor 2','','inherit','open','','doctor-2.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-09 09:55:12','2017-03-09 09:55:12'),(139,1,'','Doctor 1','','inherit','open','','doctor-1.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-09 09:57:34','2017-03-09 09:57:34'),(143,1,'','Content Img','','inherit','open','','content-img.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-09 10:00:53','2017-03-09 10:00:53'),(147,1,'','IMG_5113','','inherit','open','','img-5113.JPG',0,'',0,'','attachment',0,'image/jpeg','2017-03-10 02:56:17','2017-03-10 02:56:17'),(183,1,'','','','inherit','open','','8616670b3f511795137c65ef0151c3f2.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-15 08:24:11','2017-03-15 08:24:11'),(186,1,'','','','inherit','open','','0205080-pe360076-s5.JPG',0,'',0,'','attachment',0,'image/jpeg','2017-03-15 08:42:44','2017-03-15 08:42:44'),(194,1,'','','','inherit','open','','chrysanthemum.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-15 10:03:33','2017-03-15 10:03:33'),(197,1,'','','','inherit','open','','creative-bookshelf-211-700.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-15 10:27:15','2017-03-15 10:27:15'),(211,1,'','','','inherit','open','','doctor-2.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-16 05:56:10','2017-03-16 05:56:10'),(212,1,'','','','inherit','open','','logo.png',0,'',0,'','attachment',0,'image/png','2017-03-16 05:59:23','2017-03-16 05:59:23'),(214,1,'','','','inherit','open','','chrysanthemum.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-16 08:00:28','2017-03-16 08:00:28'),(238,1,'','','','inherit','open','','desert.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-16 08:14:58','2017-03-16 08:14:58'),(246,1,'','','','inherit','open','','chrysanthemum.jpg',0,'',0,'','attachment',0,'image/jpeg','2017-03-16 08:50:05','2017-03-16 08:50:05'),(252,1,'','','','publish','close','','home',0,'',1,'xus-menu','nav-menu',0,'nav-menu','2017-03-16 10:11:14','2017-03-16 10:49:58'),(254,1,'','','','publish','close','','contact-german',0,'',3,'xus-menu','nav-menu',0,'nav-menu','2017-03-16 10:11:14','2017-03-16 10:49:58'),(255,1,'','','','publish','close','','info-for-patient-in-german',0,'',4,'xus-menu','nav-menu',0,'nav-menu','2017-03-16 10:11:14','2017-03-16 10:49:58'),(256,1,'','','','publish','close','','news-is-german',0,'',5,'xus-menu','nav-menu',0,'nav-menu','2017-03-16 10:11:14','2017-03-16 10:49:58'),(259,1,'','','','publish','close','','doctor-in-en',0,'',6,'xus-menu','nav-menu',0,'nav-menu','2017-03-16 10:12:38','2017-03-16 10:49:58'),(266,1,'','','','publish','close','','xus-page',0,'',7,'xus-menu','nav-menu',0,'nav-menu','2017-03-16 10:49:35','2017-03-16 10:49:58'),(287,1,'','','','publish','open','','home-en',0,'',0,'','page',0,'post','2017-03-17 07:35:06','2017-03-17 07:35:06'),(288,1,'','','','publish','open','','contact-en',0,'',0,'','page',0,'post','2017-03-17 07:36:04','2017-03-17 07:36:04'),(290,1,'','','','publish','open','','info-for-patient-en',0,'',0,'','page',0,'post','2017-03-17 07:45:38','2017-03-17 07:45:38'),(291,1,'','','','publish','open','','news-en',0,'',0,'','page',0,'post','2017-03-17 07:52:48','2017-03-17 07:52:48'),(292,1,'','','','publish','close','','what-is-this-lorem-ipsum-or-lorum-ipsum-stuff',0,'',0,'','post',0,'post','2017-03-17 08:03:20','2017-03-17 08:03:20');
/*!40000 ALTER TABLE `posts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci,
`status` tinyint(1) DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `roles`
--
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'Administrator','This is super admin',1,NULL,NULL,NULL),(2,'Editor','This is sub-admin who will be manage content',1,NULL,NULL,NULL),(3,'User','This is normal user',1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `term_relationships`
--
DROP TABLE IF EXISTS `term_relationships`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `term_relationships` (
`object_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`term_taxonomy_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`term_order` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`object_id`,`term_taxonomy_id`),
KEY `term_relationships_term_taxonomy_id_index` (`term_taxonomy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `term_relationships`
--
LOCK TABLES `term_relationships` WRITE;
/*!40000 ALTER TABLE `term_relationships` DISABLE KEYS */;
/*!40000 ALTER TABLE `term_relationships` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `term_translations`
--
DROP TABLE IF EXISTS `term_translations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `term_translations` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`term_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` longtext COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `term_translations_term_id_foreign` (`term_id`),
CONSTRAINT `term_translations_term_id_foreign` FOREIGN KEY (`term_id`) REFERENCES `terms` (`term_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `term_translations`
--
LOCK TABLES `term_translations` WRITE;
/*!40000 ALTER TABLE `term_translations` DISABLE KEYS */;
/*!40000 ALTER TABLE `term_translations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `terms`
--
DROP TABLE IF EXISTS `terms`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `terms` (
`term_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`taxonomy` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` longtext COLLATE utf8_unicode_ci NOT NULL,
`parent` bigint(20) unsigned NOT NULL DEFAULT '0',
`term_group` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`term_id`),
KEY `terms_slug_index` (`slug`),
KEY `terms_name_index` (`name`),
KEY `terms_taxonomy_index` (`taxonomy`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `terms`
--
LOCK TABLES `terms` WRITE;
/*!40000 ALTER TABLE `terms` DISABLE KEYS */;
/*!40000 ALTER TABLE `terms` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `theme_meta`
--
DROP TABLE IF EXISTS `theme_meta`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `theme_meta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`theme_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_group` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`meta_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`meta_value` longtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`meta_id`),
KEY `theme_meta_theme_id_index` (`theme_id`),
KEY `theme_meta_meta_key_index` (`meta_key`),
CONSTRAINT `theme_meta_theme_id_foreign` FOREIGN KEY (`theme_id`) REFERENCES `themes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2430 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `theme_meta`
--
LOCK TABLES `theme_meta` WRITE;
/*!40000 ALTER TABLE `theme_meta` DISABLE KEYS */;
INSERT INTO `theme_meta` VALUES (1134,146,'menu_position','menu-top',''),(1135,146,'menu_position','menu-bottom',''),(1136,146,'menu_position','menu-left',''),(1137,146,'menu_position','menu-right',''),(1138,146,'options','general','a:4:{i:0;a:4:{s:4:\"name\";s:4:\"logo\";s:4:\"type\";s:11:\"imageupload\";s:5:\"value\";s:13:\"Default Theme\";s:5:\"label\";s:4:\"Logo\";}i:1;a:4:{s:4:\"name\";s:13:\"feature_image\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:57:\"http://sbd639.loc/uploads/hoangdv-log-checkout-240117.png\";s:5:\"label\";s:13:\"Feature image\";}i:2;a:4:{s:4:\"name\";s:9:\"copyright\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:28:\"Copyright © 2016 ITLSVN\";s:5:\"label\";s:14:\"Copyright Text\";}i:3;a:4:{s:4:\"name\";s:9:\"customcss\";s:4:\"type\";s:8:\"textarea\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:10:\"Custom CSS\";}}'),(1139,146,'options','social_media','a:4:{i:0;a:4:{s:4:\"name\";s:8:\"facebook\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:8:\"Facebook\";}i:1;a:4:{s:4:\"name\";s:7:\"twitter\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Twitter\";}i:2;a:4:{s:4:\"name\";s:11:\"google_plus\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:11:\"Google Plus\";}i:3;a:4:{s:4:\"name\";s:7:\"youtube\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Youtube\";}}'),(1140,146,'options','layouts','a:1:{i:0;a:5:{s:4:\"name\";s:12:\"layout_style\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:5:{s:13:\"right-sidebar\";s:13:\"Right Sidebar\";s:12:\"left-sidebar\";s:12:\"Left Sidebar\";s:12:\"none-sidebar\";s:12:\"None Sidebar\";s:14:\"center-content\";s:14:\"Center Content\";s:7:\"content\";s:7:\"Content\";}s:5:\"value\";s:12:\"none-sidebar\";s:5:\"label\";s:12:\"Layout Style\";}}'),(1141,146,'options','typography','a:6:{i:0;a:4:{s:4:\"name\";s:7:\"general\";s:5:\"label\";s:0:\"\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:2:{i:0;a:4:{s:4:\"name\";s:16:\"background_image\";s:5:\"label\";s:16:\"Background image\";s:5:\"value\";s:57:\"http://sbd639.loc/uploads/hoangdv-log-checkout-240117.png\";s:4:\"type\";s:12:\"input_upload\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:6:\"tahoma\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:2:{s:5:\"arial\";s:5:\"Arial\";s:6:\"tahoma\";s:6:\"Tahoma\";}}}}i:1;a:4:{s:4:\"name\";s:10:\"site_title\";s:5:\"label\";s:10:\"Site title\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:2:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:5:\"Color\";s:5:\"value\";s:7:\"#ff0000\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"16px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:3:{s:4:\"14px\";s:5:\"14 px\";s:4:\"15px\";s:5:\"15 px\";s:4:\"16px\";s:5:\"16 px\";}}}}i:2;a:4:{s:4:\"name\";s:7:\"sologan\";s:5:\"label\";s:7:\"Sologan\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:2:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:5:\"Color\";s:5:\"value\";s:7:\"#cccccc\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"15px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:3:{s:4:\"14px\";s:5:\"14 px\";s:4:\"15px\";s:5:\"15 px\";s:4:\"16px\";s:5:\"16 px\";}}}}i:3;a:4:{s:4:\"name\";s:4:\"text\";s:5:\"label\";s:4:\"Text\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:2:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:5:\"Color\";s:5:\"value\";s:7:\"#26B99A\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"15px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:3:{s:4:\"14px\";s:5:\"14 px\";s:4:\"15px\";s:5:\"15 px\";s:4:\"16px\";s:5:\"16 px\";}}}}i:4;a:4:{s:4:\"name\";s:4:\"link\";s:5:\"label\";s:4:\"Link\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:6:\"Normal\";s:5:\"value\";s:7:\"#f26726\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:4:{s:4:\"name\";s:11:\"color_hover\";s:5:\"label\";s:5:\"Hover\";s:5:\"value\";s:7:\"#6fcf6c\";s:4:\"type\";s:11:\"colorpicker\";}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"15px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:3:{s:4:\"14px\";s:5:\"14 px\";s:4:\"15px\";s:5:\"15 px\";s:4:\"16px\";s:5:\"16 px\";}}}}i:5;a:4:{s:4:\"name\";s:6:\"button\";s:5:\"label\";s:6:\"Button\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:5:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:6:\"Normal\";s:5:\"value\";s:7:\"#27b4f0\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:4:{s:4:\"name\";s:11:\"color_hover\";s:5:\"label\";s:10:\"Text Hover\";s:5:\"value\";s:7:\"#f26726\";s:4:\"type\";s:11:\"colorpicker\";}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"13px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:3:{s:4:\"13px\";s:5:\"13 px\";s:4:\"14px\";s:5:\"14 px\";s:4:\"15px\";s:5:\"15 px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#ea87ed\";s:4:\"type\";s:11:\"colorpicker\";}i:4;a:4:{s:4:\"name\";s:16:\"background_hover\";s:5:\"label\";s:16:\"Background Hover\";s:5:\"value\";s:7:\"#f26726\";s:4:\"type\";s:11:\"colorpicker\";}}}}'),(2398,304,'menu_position','menu-top',''),(2399,304,'menu_position','menu-bottom',''),(2400,304,'menu_position','menu-left',''),(2401,304,'menu_position','menu-right',''),(2402,304,'options','general','a:4:{i:0;a:4:{s:4:\"name\";s:4:\"logo\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:4:\"Logo\";}i:1;a:4:{s:4:\"name\";s:16:\"background_image\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:16:\"Background image\";}i:2;a:4:{s:4:\"name\";s:9:\"copyright\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:28:\"Copyright © 2016 ITLSVN\";s:5:\"label\";s:14:\"Copyright Text\";}i:3;a:4:{s:4:\"name\";s:9:\"customcss\";s:4:\"type\";s:8:\"textarea\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:10:\"Custom CSS\";}}'),(2403,304,'options','social_media','a:4:{i:0;a:4:{s:4:\"name\";s:8:\"facebook\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:8:\"Facebook\";}i:1;a:4:{s:4:\"name\";s:7:\"twitter\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Twitter\";}i:2;a:4:{s:4:\"name\";s:11:\"google_plus\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:11:\"Google Plus\";}i:3;a:4:{s:4:\"name\";s:7:\"youtube\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Youtube\";}}'),(2404,304,'options','layouts','a:1:{i:0;a:6:{s:4:\"name\";s:12:\"layout_style\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"right-sidebar\";s:13:\"Right Sidebar\";s:12:\"left-sidebar\";s:12:\"Left Sidebar\";s:12:\"none-sidebar\";s:12:\"None Sidebar\";s:14:\"center-content\";s:14:\"Center Content\";}s:5:\"value\";a:4:{s:13:\"right-sidebar\";s:13:\"Right Sidebar\";s:12:\"left-sidebar\";s:12:\"Left Sidebar\";s:12:\"none-sidebar\";s:12:\"None Sidebar\";s:14:\"center-content\";s:14:\"Center Content\";}s:6:\"xvalue\";a:1:{s:7:\"default\";s:13:\"right-sidebar\";}s:5:\"label\";s:12:\"Layout Style\";}}'),(2405,304,'options','typography','a:7:{i:0;a:4:{s:4:\"name\";s:10:\"site_title\";s:5:\"label\";s:10:\"Site title\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"20px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"25px\";s:4:\"25px\";s:4:\"26px\";s:4:\"26px\";s:4:\"27px\";s:4:\"27px\";s:4:\"28px\";s:4:\"28px\";s:4:\"29px\";s:4:\"29px\";s:4:\"30px\";s:4:\"30px\";s:4:\"31px\";s:4:\"31px\";s:4:\"32px\";s:4:\"32px\";s:4:\"33px\";s:4:\"33px\";s:4:\"34px\";s:4:\"34px\";s:4:\"35px\";s:4:\"35px\";}}}}i:1;a:4:{s:4:\"name\";s:6:\"slogan\";s:5:\"label\";s:6:\"Slogan\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:2;a:4:{s:4:\"name\";s:4:\"page\";s:5:\"label\";s:4:\"Text\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:3;a:4:{s:4:\"name\";s:4:\"link\";s:5:\"label\";s:4:\"Link\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";}}i:3;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:11:\"Hover color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:4;a:4:{s:4:\"name\";s:6:\"button\";s:5:\"label\";s:6:\"Button\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:6:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:16:\"Text hover color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:2;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#f48100\";s:4:\"type\";s:11:\"colorpicker\";}i:4;a:4:{s:4:\"name\";s:22:\"background_hover_color\";s:5:\"label\";s:22:\"Background hover color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:5;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:5;a:4:{s:4:\"name\";s:6:\"header\";s:5:\"label\";s:6:\"Header\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:6;a:4:{s:4:\"name\";s:6:\"footer\";s:5:\"label\";s:6:\"Footer\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#fafafa\";s:4:\"type\";s:11:\"colorpicker\";}}}}'),(2406,305,'menu_position','menu-top',''),(2407,305,'menu_position','menu-bottom',''),(2408,305,'menu_position','menu-left',''),(2409,305,'menu_position','menu-right',''),(2410,305,'options','general','a:4:{i:0;a:4:{s:4:\"name\";s:4:\"logo\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:4:\"Logo\";}i:1;a:4:{s:4:\"name\";s:16:\"background_image\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:100:\"http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/uploads/creative-bookshelf-211-700.jpg\";s:5:\"label\";s:16:\"Background image\";}i:2;a:4:{s:4:\"name\";s:9:\"copyright\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:24:\"Copyright © 2016 ITLSVN\";s:5:\"label\";s:14:\"Copyright Text\";}i:3;a:4:{s:4:\"name\";s:9:\"customcss\";s:4:\"type\";s:8:\"textarea\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:10:\"Custom CSS\";}}'),(2411,305,'options','social_media','a:4:{i:0;a:4:{s:4:\"name\";s:8:\"facebook\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:8:\"Facebook\";}i:1;a:4:{s:4:\"name\";s:7:\"twitter\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Twitter\";}i:2;a:4:{s:4:\"name\";s:11:\"google_plus\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:11:\"Google Plus\";}i:3;a:4:{s:4:\"name\";s:7:\"youtube\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Youtube\";}}'),(2412,305,'options','layouts','a:1:{i:0;a:6:{s:4:\"name\";s:12:\"layout_style\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"right-sidebar\";s:13:\"Right Sidebar\";s:12:\"left-sidebar\";s:12:\"Left Sidebar\";s:12:\"none-sidebar\";s:12:\"None Sidebar\";s:14:\"center-content\";s:14:\"Center Content\";}s:5:\"value\";a:4:{s:13:\"right-sidebar\";s:13:\"right-sidebar\";s:12:\"left-sidebar\";s:12:\"left-sidebar\";s:12:\"none-sidebar\";s:12:\"none-sidebar\";s:14:\"center-content\";s:14:\"center-content\";}s:6:\"xvalue\";a:1:{s:7:\"default\";s:13:\"right-sidebar\";}s:5:\"label\";s:12:\"Layout Style\";}}'),(2413,305,'options','typography','a:7:{i:0;a:4:{s:4:\"name\";s:10:\"site_title\";s:5:\"label\";s:10:\"Site title\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#0015fc\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"35px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"25px\";s:4:\"25px\";s:4:\"26px\";s:4:\"26px\";s:4:\"27px\";s:4:\"27px\";s:4:\"28px\";s:4:\"28px\";s:4:\"29px\";s:4:\"29px\";s:4:\"30px\";s:4:\"30px\";s:4:\"31px\";s:4:\"31px\";s:4:\"32px\";s:4:\"32px\";s:4:\"33px\";s:4:\"33px\";s:4:\"34px\";s:4:\"34px\";s:4:\"35px\";s:4:\"35px\";}}}}i:1;a:4:{s:4:\"name\";s:6:\"slogan\";s:5:\"label\";s:6:\"Slogan\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:2;a:4:{s:4:\"name\";s:4:\"page\";s:5:\"label\";s:4:\"Text\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:3;a:4:{s:4:\"name\";s:4:\"link\";s:5:\"label\";s:4:\"Link\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";}}i:3;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:11:\"Hover color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:4;a:4:{s:4:\"name\";s:6:\"button\";s:5:\"label\";s:6:\"Button\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:6:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:16:\"Text hover color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:2;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#f48100\";s:4:\"type\";s:11:\"colorpicker\";}i:4;a:4:{s:4:\"name\";s:22:\"background_hover_color\";s:5:\"label\";s:22:\"Background hover color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:5;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:5;a:4:{s:4:\"name\";s:6:\"header\";s:5:\"label\";s:6:\"Header\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#8dced9\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:6;a:4:{s:4:\"name\";s:6:\"footer\";s:5:\"label\";s:6:\"Footer\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#87dbe6\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Italic\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#fafafa\";s:4:\"type\";s:11:\"colorpicker\";}}}}'),(2414,306,'menu_position','menu-top',''),(2415,306,'menu_position','menu-bottom',''),(2416,306,'menu_position','menu-left',''),(2417,306,'menu_position','menu-right',''),(2418,306,'options','general','a:4:{i:0;a:4:{s:4:\"name\";s:4:\"logo\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:4:\"Logo\";}i:1;a:4:{s:4:\"name\";s:16:\"background_image\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:16:\"Background image\";}i:2;a:4:{s:4:\"name\";s:9:\"copyright\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:28:\"Copyright © 2016 ITLSVN\";s:5:\"label\";s:14:\"Copyright Text\";}i:3;a:4:{s:4:\"name\";s:9:\"customcss\";s:4:\"type\";s:8:\"textarea\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:10:\"Custom CSS\";}}'),(2419,306,'options','social_media','a:4:{i:0;a:4:{s:4:\"name\";s:8:\"facebook\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:8:\"Facebook\";}i:1;a:4:{s:4:\"name\";s:7:\"twitter\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Twitter\";}i:2;a:4:{s:4:\"name\";s:11:\"google_plus\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:11:\"Google Plus\";}i:3;a:4:{s:4:\"name\";s:7:\"youtube\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Youtube\";}}'),(2420,306,'options','layouts','a:1:{i:0;a:6:{s:4:\"name\";s:12:\"layout_style\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"right-sidebar\";s:13:\"Right Sidebar\";s:12:\"left-sidebar\";s:12:\"Left Sidebar\";s:12:\"none-sidebar\";s:12:\"None Sidebar\";s:14:\"center-content\";s:14:\"Center Content\";}s:5:\"value\";a:4:{s:13:\"right-sidebar\";s:13:\"right-sidebar\";s:12:\"left-sidebar\";s:12:\"left-sidebar\";s:12:\"none-sidebar\";s:12:\"none-sidebar\";s:14:\"center-content\";s:14:\"center-content\";}s:6:\"xvalue\";a:1:{s:7:\"default\";s:13:\"right-sidebar\";}s:5:\"label\";s:12:\"Layout Style\";}}'),(2421,306,'options','typography','a:7:{i:0;a:4:{s:4:\"name\";s:10:\"site_title\";s:5:\"label\";s:10:\"Site title\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"25px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"25px\";s:4:\"25px\";s:4:\"26px\";s:4:\"26px\";s:4:\"27px\";s:4:\"27px\";s:4:\"28px\";s:4:\"28px\";s:4:\"29px\";s:4:\"29px\";s:4:\"30px\";s:4:\"30px\";s:4:\"31px\";s:4:\"31px\";s:4:\"32px\";s:4:\"32px\";s:4:\"33px\";s:4:\"33px\";s:4:\"34px\";s:4:\"34px\";s:4:\"35px\";s:4:\"35px\";}}}}i:1;a:4:{s:4:\"name\";s:6:\"slogan\";s:5:\"label\";s:6:\"Slogan\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:2;a:4:{s:4:\"name\";s:4:\"page\";s:5:\"label\";s:4:\"Text\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:3;a:4:{s:4:\"name\";s:4:\"link\";s:5:\"label\";s:4:\"Link\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";}}i:3;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:11:\"Hover color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:4;a:4:{s:4:\"name\";s:6:\"button\";s:5:\"label\";s:6:\"Button\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:6:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:16:\"Text hover color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:2;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#f48100\";s:4:\"type\";s:11:\"colorpicker\";}i:4;a:4:{s:4:\"name\";s:22:\"background_hover_color\";s:5:\"label\";s:22:\"Background hover color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:5;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:5;a:4:{s:4:\"name\";s:6:\"header\";s:5:\"label\";s:6:\"Header\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:6;a:4:{s:4:\"name\";s:6:\"footer\";s:5:\"label\";s:6:\"Footer\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#fafafa\";s:4:\"type\";s:11:\"colorpicker\";}}}}'),(2422,307,'menu_position','menu-top','main-menu'),(2423,307,'menu_position','menu-bottom',''),(2424,307,'menu_position','menu-left',''),(2425,307,'menu_position','menu-right',''),(2426,307,'options','general','a:4:{i:0;a:4:{s:4:\"name\";s:4:\"logo\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:87:\"http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/uploads/chrysanthemum.jpg\";s:5:\"label\";s:4:\"Logo\";}i:1;a:4:{s:4:\"name\";s:16:\"background_image\";s:4:\"type\";s:12:\"input_upload\";s:5:\"value\";s:100:\"http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/uploads/creative-bookshelf-211-700.jpg\";s:5:\"label\";s:16:\"Background image\";}i:2;a:4:{s:4:\"name\";s:9:\"copyright\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:24:\"Copyright © 2016 ITLSVN\";s:5:\"label\";s:14:\"Copyright Text\";}i:3;a:4:{s:4:\"name\";s:9:\"customcss\";s:4:\"type\";s:8:\"textarea\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:10:\"Custom CSS\";}}'),(2427,307,'options','social_media','a:4:{i:0;a:4:{s:4:\"name\";s:8:\"facebook\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:8:\"Facebook\";}i:1;a:4:{s:4:\"name\";s:7:\"twitter\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Twitter\";}i:2;a:4:{s:4:\"name\";s:11:\"google_plus\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:11:\"Google Plus\";}i:3;a:4:{s:4:\"name\";s:7:\"youtube\";s:4:\"type\";s:4:\"text\";s:5:\"value\";s:0:\"\";s:5:\"label\";s:7:\"Youtube\";}}'),(2428,307,'options','layouts','a:1:{i:0;a:6:{s:4:\"name\";s:12:\"layout_style\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"right-sidebar\";s:13:\"Right Sidebar\";s:12:\"left-sidebar\";s:12:\"Left Sidebar\";s:12:\"none-sidebar\";s:12:\"None Sidebar\";s:14:\"center-content\";s:14:\"Center Content\";}s:5:\"value\";a:4:{s:13:\"right-sidebar\";s:13:\"right-sidebar\";s:12:\"left-sidebar\";s:12:\"left-sidebar\";s:12:\"none-sidebar\";s:12:\"none-sidebar\";s:14:\"center-content\";s:14:\"center-content\";}s:6:\"xvalue\";a:1:{s:7:\"default\";s:13:\"right-sidebar\";}s:5:\"label\";s:12:\"Layout Style\";}}'),(2429,307,'options','typography','a:7:{i:0;a:4:{s:4:\"name\";s:10:\"site_title\";s:5:\"label\";s:10:\"Site title\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#f51128\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Italic\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"26px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"25px\";s:4:\"25px\";s:4:\"26px\";s:4:\"26px\";s:4:\"27px\";s:4:\"27px\";s:4:\"28px\";s:4:\"28px\";s:4:\"29px\";s:4:\"29px\";s:4:\"30px\";s:4:\"30px\";s:4:\"31px\";s:4:\"31px\";s:4:\"32px\";s:4:\"32px\";s:4:\"33px\";s:4:\"33px\";s:4:\"34px\";s:4:\"34px\";s:4:\"35px\";s:4:\"35px\";}}}}i:1;a:4:{s:4:\"name\";s:6:\"slogan\";s:5:\"label\";s:6:\"Slogan\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:12:\"Raleway-Bold\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:2;a:4:{s:4:\"name\";s:4:\"page\";s:5:\"label\";s:4:\"Text\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:3:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:3;a:4:{s:4:\"name\";s:4:\"link\";s:5:\"label\";s:4:\"Link\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"25px\";s:4:\"25px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";}}i:3;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:11:\"Hover color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:4;a:4:{s:4:\"name\";s:6:\"button\";s:5:\"label\";s:6:\"Button\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:6:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:4:{s:4:\"name\";s:11:\"hover_color\";s:5:\"label\";s:16:\"Text hover color\";s:5:\"value\";s:7:\"#222222\";s:4:\"type\";s:11:\"colorpicker\";}i:2;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Medium\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#f48100\";s:4:\"type\";s:11:\"colorpicker\";}i:4;a:4:{s:4:\"name\";s:22:\"background_hover_color\";s:5:\"label\";s:22:\"Background hover color\";s:5:\"value\";s:7:\"#ffffff\";s:4:\"type\";s:11:\"colorpicker\";}i:5;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"14px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:11:{s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";s:4:\"17px\";s:4:\"17px\";s:4:\"18px\";s:4:\"18px\";s:4:\"19px\";s:4:\"19px\";s:4:\"20px\";s:4:\"20px\";s:4:\"21px\";s:4:\"21px\";s:4:\"22px\";s:4:\"22px\";}}}}i:5;a:4:{s:4:\"name\";s:6:\"header\";s:5:\"label\";s:6:\"Header\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#8dced9\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:13:\"Raleway-Black\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#c2c7d1\";s:4:\"type\";s:11:\"colorpicker\";}}}i:6;a:4:{s:4:\"name\";s:6:\"footer\";s:5:\"label\";s:6:\"Footer\";s:4:\"type\";s:8:\"fieldset\";s:5:\"items\";a:4:{i:0;a:4:{s:4:\"name\";s:5:\"color\";s:5:\"label\";s:10:\"Text color\";s:5:\"value\";s:7:\"#87dbe6\";s:4:\"type\";s:11:\"colorpicker\";}i:1;a:5:{s:4:\"name\";s:11:\"font_family\";s:5:\"label\";s:11:\"Font family\";s:5:\"value\";s:14:\"Raleway-Italic\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:4:{s:13:\"Raleway-Black\";s:13:\"Raleway Black\";s:12:\"Raleway-Bold\";s:12:\"Raleway Bold\";s:14:\"Raleway-Medium\";s:14:\"Raleway Medium\";s:14:\"Raleway-Italic\";s:14:\"Raleway Italic\";}}i:2;a:5:{s:4:\"name\";s:9:\"font_size\";s:5:\"label\";s:9:\"Font size\";s:5:\"value\";s:4:\"12px\";s:4:\"type\";s:8:\"combobox\";s:7:\"options\";a:7:{s:4:\"10px\";s:4:\"10px\";s:4:\"11px\";s:4:\"11px\";s:4:\"12px\";s:4:\"12px\";s:4:\"13px\";s:4:\"13px\";s:4:\"14px\";s:4:\"14px\";s:4:\"15px\";s:4:\"15px\";s:4:\"16px\";s:4:\"16px\";}}i:3;a:4:{s:4:\"name\";s:16:\"background_color\";s:5:\"label\";s:16:\"Background color\";s:5:\"value\";s:7:\"#fafafa\";s:4:\"type\";s:11:\"colorpicker\";}}}}');
/*!40000 ALTER TABLE `theme_meta` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `theme_type`
--
DROP TABLE IF EXISTS `theme_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `theme_type` (
`theme_type_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`theme_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `theme_type`
--
LOCK TABLES `theme_type` WRITE;
/*!40000 ALTER TABLE `theme_type` DISABLE KEYS */;
INSERT INTO `theme_type` VALUES (1,'Simple Site',NULL,NULL,NULL,NULL),(2,'Medium Site',NULL,NULL,NULL,NULL),(3,'Default','Hidden in list of templates',NULL,NULL,NULL);
/*!40000 ALTER TABLE `theme_type` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `themes`
--
DROP TABLE IF EXISTS `themes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `themes` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`machine_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`parent_id` bigint(20) NOT NULL DEFAULT '0',
`is_publish` bigint(20) NOT NULL DEFAULT '0',
`theme_type_id` bigint(20) NOT NULL DEFAULT '1',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`version` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`author` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`author_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` longtext COLLATE utf8_unicode_ci NOT NULL,
`image_preview` longtext COLLATE utf8_unicode_ci NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=308 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `themes`
--
LOCK TABLES `themes` WRITE;
/*!40000 ALTER TABLE `themes` DISABLE KEYS */;
INSERT INTO `themes` VALUES (146,'',3,1,3,'smallpine','1.0.0','ITLSVN','https://www.facebook.com/hoainam.tran.355','Smallpine Theme','preview.jpg',0),(304,'Sanmax58ca5a5444f9c',0,1,1,'Sanmax Simple','1.0.0','Sanmax','#','site simple template','http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/themes/Sanmax58ca5a5444f9c/images/preview.jpg',0),(305,'Sanmax58ca5b2fc77c4',304,1,1,'simple_Xu 1','1.0.0','Sanmax','#','site simple template','http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/themes/Sanmax58ca5a5444f9c/images/preview.jpg',0),(306,'Sanmax58ca65d19f1c1',304,1,1,'simple_Xu test 2','1.0.0','Sanmax','#','site simple template','http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/themes/Sanmax58ca5a5444f9c/images/preview.jpg',0),(307,'Sanmax58ca6c6236618',304,1,1,'simple_Xu 12','1.0.0','Sanmax','#','site simple template','http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/themes/Sanmax58ca5a5444f9c/images/preview.jpg',1);
/*!40000 ALTER TABLE `themes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `translate`
--
DROP TABLE IF EXISTS `translate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `translate` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`trans_key` char(255) COLLATE utf8_unicode_ci NOT NULL,
`trans_meta` longtext COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `translate`
--
LOCK TABLES `translate` WRITE;
/*!40000 ALTER TABLE `translate` DISABLE KEYS */;
/*!40000 ALTER TABLE `translate` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_meta`
--
DROP TABLE IF EXISTS `user_meta`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_meta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`meta_value` longtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`meta_id`),
KEY `user_meta_user_id_index` (`user_id`),
KEY `user_meta_meta_key_index` (`meta_key`),
CONSTRAINT `user_meta_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=234 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_meta`
--
LOCK TABLES `user_meta` WRITE;
/*!40000 ALTER TABLE `user_meta` DISABLE KEYS */;
INSERT INTO `user_meta` VALUES (1,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-04 04:11:57\";s:4:\"desc\";s:20:\"Create page About Us\";}'),(2,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-04 04:12:22\";s:4:\"desc\";s:20:\"Update page About Us\";}'),(3,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:39:19\";s:4:\"desc\";s:20:\"Update page About Us\";}'),(4,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:46:29\";s:4:\"desc\";s:21:\"Create page Test site\";}'),(5,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:47:33\";s:4:\"desc\";s:21:\"Update page Test site\";}'),(6,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:47:58\";s:4:\"desc\";s:18:\"Create page PAge 1\";}'),(7,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:51:37\";s:4:\"desc\";s:20:\"Update page About Us\";}'),(8,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:52:27\";s:4:\"desc\";s:18:\"Delete page id :34\";}'),(9,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 02:52:55\";s:4:\"desc\";s:18:\"Delete page id :41\";}'),(10,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:02:03\";s:4:\"desc\";s:20:\"Create page About us\";}'),(11,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:02:12\";s:4:\"desc\";s:23:\"Create page Minh page 1\";}'),(12,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:04:59\";s:4:\"desc\";s:23:\"Create post Minh post 1\";}'),(13,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:06:23\";s:4:\"desc\";s:20:\"Update page About us\";}'),(14,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:09:15\";s:4:\"desc\";s:20:\"Update page About us\";}'),(15,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:11:17\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(16,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:12:32\";s:4:\"desc\";s:18:\"Delete page id :42\";}'),(17,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:26:46\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(18,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:29:58\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(19,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:35:18\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(20,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:36:00\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(21,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:36:19\";s:4:\"desc\";s:17:\"Delete post id :1\";}'),(22,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:36:35\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(23,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:36:45\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(24,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:36:55\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(25,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:37:03\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(26,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:37:57\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(27,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:38:13\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(28,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:38:53\";s:4:\"desc\";s:48:\"Update post Maiores voluptatem alias non et rem.\";}'),(29,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:41:31\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(30,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:42:05\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(31,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:42:40\";s:4:\"desc\";s:49:\"Create post QSoft Idol: Work hard, play...harder!\";}'),(32,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:56:34\";s:4:\"desc\";s:17:\"Delete post id :2\";}'),(33,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:57:15\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(34,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:57:30\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(35,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:57:47\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(36,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 03:59:58\";s:4:\"desc\";s:23:\"Update post Minh post 1\";}'),(37,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 04:02:31\";s:4:\"desc\";s:45:\"Delete post id :53,48,20,19,18,17,16,15,14,13\";}'),(38,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 04:23:40\";s:4:\"desc\";s:68:\"Update post Repellat autem et incidunt nulla temporibus consequatur.\";}'),(39,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 04:35:11\";s:4:\"desc\";s:40:\"Update post Quibusdam sequi nihil nobis.\";}'),(40,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 04:39:16\";s:4:\"desc\";s:68:\"Update post Qui totam nisi natus quaerat asperiores laboriosam modi.\";}'),(41,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:41:44\";s:4:\"desc\";s:22:\"Create page Contact us\";}'),(42,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:41:48\";s:4:\"desc\";s:23:\"Create post Minh post 2\";}'),(43,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:41:56\";s:4:\"desc\";s:23:\"Create post Minh post 2\";}'),(44,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:42:17\";s:4:\"desc\";s:22:\"Update page Contact us\";}'),(45,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:42:43\";s:4:\"desc\";s:23:\"Create post Minh post 2\";}'),(46,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:43:51\";s:4:\"desc\";s:21:\"Delete post id :77,75\";}'),(47,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 07:44:27\";s:4:\"desc\";s:30:\"Create page Client testimonial\";}'),(48,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 08:15:22\";s:4:\"desc\";s:16:\"Create page Blog\";}'),(49,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 08:15:42\";s:4:\"desc\";s:16:\"Create page Blog\";}'),(50,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 11:39:22\";s:4:\"desc\";s:18:\"Delete page id :88\";}'),(51,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 11:46:13\";s:4:\"desc\";s:16:\"Create page Home\";}'),(52,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 11:48:00\";s:4:\"desc\";s:18:\"Delete page id :92\";}'),(53,1,'user_log','a:2:{s:4:\"date\";s:19:\"2016-11-16 11:49:39\";s:4:\"desc\";s:18:\"Delete page id :89\";}'),(54,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-02-14 04:55:49\";s:4:\"desc\";s:30:\"Update page Client testimonial\";}'),(55,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-02-20 03:02:38\";s:4:\"desc\";s:30:\"Update page Client testimonial\";}'),(56,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-08 09:57:30\";s:4:\"desc\";s:40:\"Update post Quibusdam sequi nihil nobis.\";}'),(57,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-08 09:58:06\";s:4:\"desc\";s:40:\"Update post Quibusdam sequi nihil nobis.\";}'),(58,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-09 09:48:09\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(59,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-09 10:00:56\";s:4:\"desc\";s:28:\"Create page INFO FOR PATIENT\";}'),(60,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-09 11:23:46\";s:4:\"desc\";s:28:\"Update page INFO FOR PATIENT\";}'),(61,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-09 11:33:08\";s:4:\"desc\";s:23:\"Update page Minh page 1\";}'),(62,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 02:53:39\";s:4:\"desc\";s:28:\"Update page INFO FOR PATIENT\";}'),(63,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 02:54:00\";s:4:\"desc\";s:28:\"Update page INFO FOR PATIENT\";}'),(64,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 02:58:03\";s:4:\"desc\";s:21:\"Delete language id :1\";}'),(65,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:12:18\";s:4:\"desc\";s:18:\"Delete page id :46\";}'),(66,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:25:06\";s:4:\"desc\";s:16:\"Create page test\";}'),(67,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:27:00\";s:4:\"desc\";s:16:\"Update page test\";}'),(68,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:27:08\";s:4:\"desc\";s:16:\"Update page test\";}'),(69,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:27:21\";s:4:\"desc\";s:16:\"Update page test\";}'),(70,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:33:05\";s:4:\"desc\";s:19:\"Delete page id :148\";}'),(71,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:39:34\";s:4:\"desc\";s:21:\"Create page rose test\";}'),(72,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 03:49:25\";s:4:\"desc\";s:28:\"Update page INFO FOR PATIENT\";}'),(73,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 07:17:24\";s:4:\"desc\";s:28:\"Update page INFO FOR PATIENT\";}'),(74,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 07:18:46\";s:4:\"desc\";s:28:\"Update page INFO FOR PATIENT\";}'),(75,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 07:21:55\";s:4:\"desc\";s:16:\"Create page News\";}'),(76,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 08:12:00\";s:4:\"desc\";s:16:\"Create post rrrr\";}'),(77,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-10 08:12:04\";s:4:\"desc\";s:19:\"Delete post id :161\";}'),(78,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-13 08:42:43\";s:4:\"desc\";s:24:\"Delete translation id :1\";}'),(79,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 02:42:22\";s:4:\"desc\";s:16:\"Update page News\";}'),(80,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 08:31:05\";s:4:\"desc\";s:24:\"Delete translation id :3\";}'),(81,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 10:46:18\";s:4:\"desc\";s:36:\"Delete page id :150,149,144,79,74,45\";}'),(82,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 10:51:46\";s:4:\"desc\";s:16:\"Create page Home\";}'),(83,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 10:52:11\";s:4:\"desc\";s:12:\"Update page \";}'),(84,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:48:45\";s:4:\"desc\";s:12:\"Update page \";}'),(85,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:52:59\";s:4:\"desc\";s:21:\"Create page News page\";}'),(86,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:53:13\";s:4:\"desc\";s:12:\"Update page \";}'),(87,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:54:24\";s:4:\"desc\";s:39:\"Delete post id :76,12,11,10,9,8,7,6,5,4\";}'),(88,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:54:30\";s:4:\"desc\";s:17:\"Delete post id :3\";}'),(89,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:56:19\";s:4:\"desc\";s:12:\"Create post \";}'),(90,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 11:58:45\";s:4:\"desc\";s:12:\"Create post \";}'),(91,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 12:04:27\";s:4:\"desc\";s:12:\"Update post \";}'),(92,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 12:09:58\";s:4:\"desc\";s:12:\"Update page \";}'),(93,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-14 12:11:53\";s:4:\"desc\";s:28:\"Create page Info for patient\";}'),(94,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 01:27:10\";s:4:\"desc\";s:21:\"Delete language id :5\";}'),(95,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 01:27:17\";s:4:\"desc\";s:21:\"Delete language id :4\";}'),(96,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 01:28:00\";s:4:\"desc\";s:21:\"Delete language id :3\";}'),(97,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 01:28:34\";s:4:\"desc\";s:21:\"Delete language id :2\";}'),(98,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 01:30:50\";s:4:\"desc\";s:14:\"Create page CT\";}'),(99,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:31:58\";s:4:\"desc\";s:12:\"Create post \";}'),(100,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:33:10\";s:4:\"desc\";s:12:\"Update page \";}'),(101,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:33:51\";s:4:\"desc\";s:12:\"Create page \";}'),(102,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:34:44\";s:4:\"desc\";s:12:\"Update page \";}'),(103,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:35:42\";s:4:\"desc\";s:19:\"Delete page id :176\";}'),(104,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:36:02\";s:4:\"desc\";s:19:\"Delete post id :175\";}'),(105,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:46:19\";s:4:\"desc\";s:12:\"Update post \";}'),(106,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 02:46:50\";s:4:\"desc\";s:12:\"Update post \";}'),(107,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 03:10:55\";s:4:\"desc\";s:27:\"Delete language id :9,8,7,6\";}'),(108,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 03:11:02\";s:4:\"desc\";s:21:\"Delete language id :7\";}'),(109,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 04:32:10\";s:4:\"desc\";s:12:\"Update page \";}'),(110,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 06:36:32\";s:4:\"desc\";s:15:\"Create doctor 3\";}'),(111,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 06:36:49\";s:4:\"desc\";s:14:\"Update doctor \";}'),(112,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 06:37:04\";s:4:\"desc\";s:19:\"Delete page id :177\";}'),(113,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:06:18\";s:4:\"desc\";s:12:\"Update page \";}'),(114,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:06:59\";s:4:\"desc\";s:12:\"Create page \";}'),(115,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:16:23\";s:4:\"desc\";s:12:\"Update page \";}'),(116,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:16:34\";s:4:\"desc\";s:19:\"Delete page id :179\";}'),(117,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:17:04\";s:4:\"desc\";s:12:\"Create page \";}'),(118,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:18:05\";s:4:\"desc\";s:12:\"Create page \";}'),(119,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:18:24\";s:4:\"desc\";s:12:\"Update page \";}'),(120,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:22:41\";s:4:\"desc\";s:12:\"Update page \";}'),(121,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:23:04\";s:4:\"desc\";s:23:\"Delete page id :182,181\";}'),(122,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:34:42\";s:4:\"desc\";s:12:\"Update page \";}'),(123,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:34:56\";s:4:\"desc\";s:12:\"Create page \";}'),(124,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 08:43:49\";s:4:\"desc\";s:16:\"Create post dfgs\";}'),(125,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 09:24:56\";s:4:\"desc\";s:12:\"Update post \";}'),(126,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 09:33:49\";s:4:\"desc\";s:23:\"Create page rose german\";}'),(127,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 09:35:19\";s:4:\"desc\";s:12:\"Update post \";}'),(128,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 09:40:39\";s:4:\"desc\";s:19:\"Delete page id :184\";}'),(129,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 09:43:04\";s:4:\"desc\";s:22:\"Delete language id :10\";}'),(130,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 09:50:16\";s:4:\"desc\";s:24:\"Create post Xu post 1_Ge\";}'),(131,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:14:26\";s:4:\"desc\";s:19:\"Delete post id :193\";}'),(132,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:26:06\";s:4:\"desc\";s:12:\"Update post \";}'),(133,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:26:18\";s:4:\"desc\";s:12:\"Update post \";}'),(134,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:29:06\";s:4:\"desc\";s:12:\"Update post \";}'),(135,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:42:08\";s:4:\"desc\";s:16:\"Create doctor ge\";}'),(136,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:43:32\";s:4:\"desc\";s:24:\"Create page Test page_gr\";}'),(137,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:43:50\";s:4:\"desc\";s:12:\"Update page \";}'),(138,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:45:32\";s:4:\"desc\";s:24:\"Create post Post test_Gr\";}'),(139,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:45:41\";s:4:\"desc\";s:19:\"Delete page id :198\";}'),(140,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:46:04\";s:4:\"desc\";s:24:\"Create post Post test_Gr\";}'),(141,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:47:02\";s:4:\"desc\";s:12:\"Update post \";}'),(142,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 10:59:54\";s:4:\"desc\";s:22:\"Create doctor Xu Xu_gr\";}'),(143,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-15 11:33:33\";s:4:\"desc\";s:12:\"Update post \";}'),(144,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 03:21:38\";s:4:\"desc\";s:14:\"Create post ge\";}'),(145,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 03:22:16\";s:4:\"desc\";s:12:\"Update post \";}'),(146,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 05:55:44\";s:4:\"desc\";s:12:\"Update page \";}'),(147,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 05:56:15\";s:4:\"desc\";s:12:\"Update page \";}'),(148,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 05:56:48\";s:4:\"desc\";s:12:\"Update page \";}'),(149,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 06:51:55\";s:4:\"desc\";s:22:\"Delete language id :10\";}'),(150,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 07:56:52\";s:4:\"desc\";s:12:\"Create page \";}'),(151,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 07:57:02\";s:4:\"desc\";s:12:\"Update page \";}'),(152,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 07:57:37\";s:4:\"desc\";s:12:\"Update page \";}'),(153,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 07:57:52\";s:4:\"desc\";s:12:\"Update page \";}'),(154,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 07:58:53\";s:4:\"desc\";s:12:\"Update page \";}'),(155,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 07:59:29\";s:4:\"desc\";s:12:\"Update post \";}'),(156,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:01:10\";s:4:\"desc\";s:12:\"Update post \";}'),(157,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:05:23\";s:4:\"desc\";s:12:\"Create post \";}'),(158,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:05:27\";s:4:\"desc\";s:19:\"Delete post id :216\";}'),(159,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:05:30\";s:4:\"desc\";s:19:\"Delete post id :210\";}'),(160,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:06:14\";s:4:\"desc\";s:12:\"Create post \";}'),(161,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:06:55\";s:4:\"desc\";s:12:\"Create post \";}'),(162,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:10:52\";s:4:\"desc\";s:12:\"Create post \";}'),(163,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:13:29\";s:4:\"desc\";s:12:\"Create post \";}'),(164,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:15:17\";s:4:\"desc\";s:12:\"Create page \";}'),(165,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:15:29\";s:4:\"desc\";s:12:\"Update page \";}'),(166,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:15:40\";s:4:\"desc\";s:12:\"Update page \";}'),(167,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:18:28\";s:4:\"desc\";s:12:\"Create post \";}'),(168,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:18:45\";s:4:\"desc\";s:12:\"Update post \";}'),(169,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:19:37\";s:4:\"desc\";s:12:\"Create post \";}'),(170,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:20:32\";s:4:\"desc\";s:12:\"Create post \";}'),(171,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:20:39\";s:4:\"desc\";s:39:\"Delete post id :242,241,240,235,231,218\";}'),(172,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:21:03\";s:4:\"desc\";s:12:\"Create post \";}'),(173,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:21:07\";s:4:\"desc\";s:19:\"Delete post id :243\";}'),(174,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:25:23\";s:4:\"desc\";s:12:\"Create page \";}'),(175,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:48:01\";s:4:\"desc\";s:12:\"Update page \";}'),(176,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:48:08\";s:4:\"desc\";s:23:\"Delete page id :244,239\";}'),(177,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:48:18\";s:4:\"desc\";s:12:\"Update post \";}'),(178,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:48:25\";s:4:\"desc\";s:27:\"Delete page id :213,199,188\";}'),(179,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:51:16\";s:4:\"desc\";s:12:\"Create page \";}'),(180,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 08:52:42\";s:4:\"desc\";s:12:\"Create post \";}'),(181,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:12:47\";s:4:\"desc\";s:12:\"Update page \";}'),(182,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:18:55\";s:4:\"desc\";s:12:\"Update page \";}'),(183,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:19:05\";s:4:\"desc\";s:19:\"Delete post id :217\";}'),(184,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:19:18\";s:4:\"desc\";s:12:\"Update post \";}'),(185,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:20:01\";s:4:\"desc\";s:12:\"Update post \";}'),(186,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:20:22\";s:4:\"desc\";s:12:\"Update post \";}'),(187,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:21:38\";s:4:\"desc\";s:12:\"Update post \";}'),(188,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:23:09\";s:4:\"desc\";s:12:\"Update page \";}'),(189,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:39:38\";s:4:\"desc\";s:12:\"Update page \";}'),(190,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:52:05\";s:4:\"desc\";s:12:\"Update page \";}'),(191,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:52:59\";s:4:\"desc\";s:12:\"Create page \";}'),(192,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:54:27\";s:4:\"desc\";s:12:\"Update page \";}'),(193,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:54:33\";s:4:\"desc\";s:12:\"Update page \";}'),(194,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:54:45\";s:4:\"desc\";s:12:\"Update page \";}'),(195,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:55:00\";s:4:\"desc\";s:12:\"Update page \";}'),(196,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:55:08\";s:4:\"desc\";s:12:\"Update page \";}'),(197,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:55:20\";s:4:\"desc\";s:12:\"Update page \";}'),(198,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 09:57:12\";s:4:\"desc\";s:12:\"Update page \";}'),(199,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:05:44\";s:4:\"desc\";s:12:\"Create page \";}'),(200,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:06:22\";s:4:\"desc\";s:12:\"Update page \";}'),(201,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:10:21\";s:4:\"desc\";s:12:\"Update page \";}'),(202,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:29:14\";s:4:\"desc\";s:14:\"Update doctor \";}'),(203,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:34:38\";s:4:\"desc\";s:14:\"Create doctor \";}'),(204,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:36:17\";s:4:\"desc\";s:23:\"Delete page id :250,248\";}'),(205,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-16 10:49:18\";s:4:\"desc\";s:12:\"Create page \";}'),(206,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 05:02:30\";s:4:\"desc\";s:12:\"Update page \";}'),(207,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:10:36\";s:4:\"desc\";s:12:\"Update page \";}'),(208,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:22:31\";s:4:\"desc\";s:23:\"Delete page id :265,251\";}'),(209,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:22:49\";s:4:\"desc\";s:19:\"Delete page id :174\";}'),(210,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:24:21\";s:4:\"desc\";s:19:\"Delete page id :168\";}'),(211,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:25:40\";s:4:\"desc\";s:22:\"Delete language id :10\";}'),(212,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:28:06\";s:4:\"desc\";s:19:\"Delete page id :163\";}'),(213,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:28:09\";s:4:\"desc\";s:19:\"Delete page id :162\";}'),(214,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:28:18\";s:4:\"desc\";s:39:\"Delete post id :249,201,200,187,165,164\";}'),(215,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:28:41\";s:4:\"desc\";s:23:\"Delete page id :261,203\";}'),(216,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:29:16\";s:4:\"desc\";s:22:\"Delete language id :10\";}'),(217,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:29:21\";s:4:\"desc\";s:28:\"Delete language id :10,9,8,7\";}'),(218,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:29:45\";s:4:\"desc\";s:30:\"Delete translation id :2,4,5,6\";}'),(219,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:29:52\";s:4:\"desc\";s:28:\"Delete language id :10,9,8,7\";}'),(220,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:30:58\";s:4:\"desc\";s:14:\"Create doctor \";}'),(221,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:31:03\";s:4:\"desc\";s:19:\"Delete page id :285\";}'),(222,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:31:14\";s:4:\"desc\";s:12:\"Create post \";}'),(223,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:31:18\";s:4:\"desc\";s:19:\"Delete post id :286\";}'),(224,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:33:05\";s:4:\"desc\";s:23:\"Delete language id :8,7\";}'),(225,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:35:06\";s:4:\"desc\";s:19:\"Create page Home_GR\";}'),(226,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:36:04\";s:4:\"desc\";s:22:\"Create page Contact_Du\";}'),(227,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:37:32\";s:4:\"desc\";s:12:\"Create page \";}'),(228,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:40:35\";s:4:\"desc\";s:19:\"Delete page id :289\";}'),(229,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:45:08\";s:4:\"desc\";s:12:\"Update page \";}'),(230,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:45:38\";s:4:\"desc\";s:12:\"Create page \";}'),(231,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:52:48\";s:4:\"desc\";s:12:\"Create page \";}'),(232,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 07:53:17\";s:4:\"desc\";s:28:\"Delete language id :10,9,8,7\";}'),(233,1,'user_log','a:2:{s:4:\"date\";s:19:\"2017-03-17 08:03:20\";s:4:\"desc\";s:12:\"Create post \";}');
/*!40000 ALTER TABLE `user_meta` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`photo` longtext COLLATE utf8_unicode_ci NOT NULL,
`description` longtext COLLATE utf8_unicode_ci NOT NULL,
`is_admin` int(11) NOT NULL DEFAULT '0',
`provider` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'local',
`remember_token` varchar(100) COLLATE utf8_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`),
KEY `users_role_id_foreign` (`role_id`),
CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,1,'Administrator','<EMAIL>','$2y$10$SFiklwUL/XTbA6pIO73.vOdzuM0wjgYSWdw6aUQx1nW5mKBbWW5yC','default-user.png','',1,'local','LxfLYGFflZUJET5DuDOn3RpZVCC3ShvzKDwa8BsEl3YerpcciyyxDX0Gq5PC',NULL,'2017-03-16 02:53:16'),(3,3,'<NAME>','<EMAIL>','$2y$10$ZNQuXE8MBDfBMv5ijR90huOq5Dx0CzowQqlKPFzcxtWvyUezb0wzu','http://52.221.247.51/uploads/logo.jpg','This is normal user',0,'local',NULL,'2016-11-03 15:16:02','2016-11-04 04:48:08'),(4,1,'Hoai','<EMAIL>','$2y$10$IozdjoG.DGA53fndIfTBHORfO6bTPh7kqtK9POTD617pRN7FGqjJK','','',0,'local',NULL,'2017-02-08 08:51:12','2017-02-08 08:51:12'),(5,1,'thuongnt','<EMAIL>','$2y$10$orNjTDKw6DjyG9JkULLLs.gBzKoq8TLEtYBCCRDji0LvPpvFkiF3O','','Test',0,'local','k4Zt28sPY7eVMxaX7wJk2glnwzTJKJDNDpqsGb6p0f0rSac2erqNRXQwpBLx','2017-03-15 02:05:04','2017-03-15 02:08:47');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `widget_groups`
--
DROP TABLE IF EXISTS `widget_groups`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widget_groups` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`theme_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `widget_groups_theme_id_index` (`theme_id`),
CONSTRAINT `widget_groups_theme_id_foreign` FOREIGN KEY (`theme_id`) REFERENCES `themes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=362 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `widget_groups`
--
LOCK TABLES `widget_groups` WRITE;
/*!40000 ALTER TABLE `widget_groups` DISABLE KEYS */;
INSERT INTO `widget_groups` VALUES (147,146,'post_slider'),(148,146,'sidebar'),(350,304,'post_slider'),(351,304,'left_sidebar'),(352,304,'right_sidebar'),(353,305,'post_slider'),(354,305,'left_sidebar'),(355,305,'right_sidebar'),(356,306,'post_slider'),(357,306,'left_sidebar'),(358,306,'right_sidebar'),(359,307,'post_slider'),(360,307,'left_sidebar'),(361,307,'right_sidebar');
/*!40000 ALTER TABLE `widget_groups` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `widgets`
--
DROP TABLE IF EXISTS `widgets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widgets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`group_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`class_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`options` longtext COLLATE utf8_unicode_ci NOT NULL,
`order` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `widgets_group_id_index` (`group_id`),
CONSTRAINT `widgets_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `widget_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `widgets`
--
LOCK TABLES `widgets` WRITE;
/*!40000 ALTER TABLE `widgets` DISABLE KEYS */;
INSERT INTO `widgets` VALUES (14,147,'App\\Widgets\\defaultWidget\\PostSlider','a:4:{s:6:\"baseID\";s:10:\"wxuJLA1XzW\";s:5:\"title\";s:18:\"Post Slider Widget\";s:4:\"type\";s:7:\"gallery\";s:10:\"gallery_id\";s:1:\"1\";}',1),(15,148,'App\\Widgets\\defaultWidget\\PostSlider','a:4:{s:5:\"title\";s:18:\"Post Slider Widget\";s:4:\"type\";s:13:\"featured-post\";s:10:\"gallery_id\";s:0:\"\";s:6:\"baseID\";s:10:\"ZmPaT1V5kK\";}',1),(17,147,'App\\Widgets\\defaultWidget\\RecentPostWidget','a:4:{s:5:\"title\";s:18:\"Recent Post Widget\";s:4:\"show\";s:1:\"3\";s:11:\"description\";s:0:\"\";s:6:\"baseID\";s:10:\"MWD9uOZUyu\";}',3),(35,355,'App\\Widgets\\Sanmax58ca5a5444f9c\\MakeAppointmentWidget','a:6:{s:6:\"baseID\";s:10:\"CLuPASaI7u\";s:5:\"title\";s:23:\"Make Appointment Widget\";s:6:\"avatar\";s:82:\"http://ec2-52-221-247-51.ap-southeast-1.compute.amazonaws.com/uploads/doctor-2.jpg\";s:16:\"make_appointment\";s:103:\"https://docs.google.com/spreadsheets/d/12TqGO2d8co7OxvhT_Q7ll6GOPVl94w5rC6SW5EzZvvc/edit#gid=1986204890\";s:4:\"name\";s:9:\"rose test\";s:11:\"description\";s:13:\"random doctor\";}',0),(36,353,'App\\Widgets\\Sanmax58ca5a5444f9c\\LightSliderWidget','a:4:{s:6:\"baseID\";s:10:\"tErMIHFxPG\";s:5:\"title\";s:19:\"Light Slider Widget\";s:4:\"type\";s:13:\"featured-post\";s:10:\"gallery_id\";s:1:\"1\";}',0),(38,359,'App\\Widgets\\defaultWidget\\PostSlider','a:4:{s:6:\"baseID\";s:10:\"oQFtoaQUSz\";s:5:\"title\";s:4:\"Rose\";s:4:\"type\";s:2:\"50\";s:10:\"gallery_id\";s:1:\"1\";}',1),(41,359,'App\\Widgets\\Sanmax58ca5a5444f9c\\LightSliderWidget','a:4:{s:6:\"baseID\";s:10:\"OAkRnGj2DH\";s:5:\"title\";s:4:\"Rose\";s:4:\"type\";s:7:\"gallery\";s:10:\"gallery_id\";s:1:\"1\";}',3),(43,361,'App\\Widgets\\defaultWidget\\TextWidget','a:3:{s:6:\"baseID\";s:10:\"Z5vSmrxbSX\";s:5:\"title\";s:11:\"Text Widget\";s:4:\"text\";s:458:\"Release Notes:\r\n- moved hardcoded style to css class- more sensible view handling - view location got cached and caused issues- more sensible css logicKnown bugs:\r\n- please note that the free_html widget is sometimes flakey due to problems with tinymce and dynamic content. If it\'s not working, move the widget to a wide column and refresh the page.\r\nAlso note - widget manager has a setting to allow Admins to submit unfiltered HTML in the free_html widget\";}',1),(44,361,'App\\Widgets\\defaultWidget\\PostSlider','a:4:{s:6:\"baseID\";s:10:\"KQuuZkm7je\";s:5:\"title\";s:11:\"Latest News\";s:4:\"type\";s:11:\"recent-post\";s:10:\"gallery_id\";s:1:\"1\";}',2),(45,360,'App\\Widgets\\Sanmax58ca5a5444f9c\\LightSliderWidget','a:4:{s:6:\"baseID\";s:10:\"5mIsi0mkHB\";s:5:\"title\";s:22:\"rose test light slider\";s:4:\"type\";s:7:\"gallery\";s:10:\"gallery_id\";s:1:\"1\";}',0);
/*!40000 ALTER TABLE `widgets` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-03-17 8:08:40
|
CREATE TABLE events
(
aggregate_type text NOT NULL,
aggregate_id text NOT NULL,
sequence bigint CHECK (sequence >= 0) NOT NULL,
payload jsonb NOT NULL,
metadata jsonb NOT NULL,
timestamp timestamp with time zone DEFAULT (CURRENT_TIMESTAMP),
PRIMARY KEY (aggregate_type, aggregate_id, sequence)
);
CREATE TABLE account_query
(
query_instance_id text NOT NULL,
version bigint CHECK (version >= 0) NOT NULL,
payload jsonb NOT NULL,
PRIMARY KEY (query_instance_id)
);
CREATE USER demo_user WITH ENCRYPTED PASSWORD '<PASSWORD>';
GRANT ALL PRIVILEGES ON DATABASE postgres TO demo_user;
|
<reponame>kev93/xceed-test
INSERT INTO xceed.player_registration (team_registration_id, player_id, created_at, updated_at) VALUES (1, 1, '2017-04-27 18:22:22', '2017-04-27 18:22:22');
INSERT INTO xceed.player_registration (team_registration_id, player_id, created_at, updated_at) VALUES (5, 1, '2017-04-27 18:22:22', '2017-04-27 18:22:22');
|
CREATE USER ozon_root WITH password '<PASSWORD>';
DROP DATABASE IF EXISTS ozon_auth_db;
CREATE DATABASE ozon_auth_db
WITH OWNER ozon_root
ENCODING 'utf8';
GRANT ALL PRIVILEGES ON database ozon_auth_db TO ozon_root;
\connect ozon_auth_db;
DROP TABLE IF EXISTS auth_users CASCADE;
CREATE TABLE auth_users (
id SERIAL NOT NULL PRIMARY KEY,
email TEXT UNIQUE NOT NULL,
password BYTEA NOT NULL
);
GRANT ALL PRIVILEGES ON TABLE auth_users TO ozon_root;
|
<reponame>marcelojoras/Gestao-Salas
SELECT e.first_name, e.last_name, dp.dept_name, max(de.to_date - de.from_date) as dias_trabalhados
FROM employees e
INNER JOIN dept_emp de ON e.emp_no = de.emp_no
INNER JOIN departments dp ON de.dept_no = dp.dept_no
LIMIT 10;
|
<reponame>drobbe/angelEmail<filename>prisma/migrations/20220217194218_test/migration.sql
/*
Warnings:
- Added the required column `base64Image` to the `Template` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `template` ADD COLUMN `base64Image` VARCHAR(191) NOT NULL;
|
<reponame>arshadShahoriar/APWT-laravel-sec--A<filename>shopmanagement.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 19, 2020 at 10:59 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `shopmanagement`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`phoneno` varchar(100) NOT NULL,
`address` varchar(100) NOT NULL,
`Password` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `phoneno`, `address`, `Password`) VALUES
(2, 'arshad', '<PASSWORD>', 'gg', '$2y$10$<PASSWORD>Tm/q9CAqOwDsyW8.w7Ao97IrYLfp4qA3F.Piw9E6tR7CkD6'),
(3, '<NAME>', '<PASSWORD>', 'gg', '$2y$10$Y.B5Ab7ID0fkMYYlgjKguOlz0UM6Rags39W8/mP5zl7B6uGKeqlg2'),
(4, 'works1', '1233211230', 'gg', '1'),
(5, '<NAME>', '1233211230', 'gg', '23'),
(6, 'Shahoriar**', '1233211230', 'gg', '0');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>hashito/docker
create database jaywalking;
use jaywalking
create table users (id int not null auto_increment,name varchar(10),primary key (id));
insert into users(name)values("test1");
insert into users(name)values("test2");
insert into users(name)values("test3");
insert into users(name)values("test4");
insert into users(name)values("test5");
create table comment (user_id int,texts text,foreign key (user_id) references users(id));
insert into comment(user_id,texts)values(1,"test comment1");
insert into comment(user_id,texts)values(2,"test comment2");
insert into comment(user_id,texts)values(1,"test comment3");
insert into comment(user_id,texts)values(2,"test comment4");
insert into comment(user_id,texts)values(2,"test comment5");
insert into comment(user_id,texts)values(2,"test comment6");
ALTER TABLE comment DROP FOREIGN KEY `comment_ibfk_1`;
alter table comment MODIFY user_id varchar(100);
update comment set user_id="1,2,3" where user_id="1" limit 1;
update comment set user_id="1,3" where user_id="1" limit 1;
select * from comment where user_id like '%2%';
select * from comment where user_id like '%1%';
select * from comment where user_id REGEXP '[[:<:]]1[[:>:]]';
select * from comment where user_id REGEXP '[[:<:]]3[[:>:]]';
select * from comment INNER JOIN users on comment.user_id REGEXP CONCAT('[[:<:]]',users.id,'[[:>:]]') where users.id=1;
# indexが無効
# userが削除IDが更新された場合の処理が面倒
# user_idに別の文字列が入ってもわからない。
# 文字列長の長さに限界がある場合がある
# 解決策 交差テーブルを利用しましょう
|
<reponame>z3ugma/mimic-ccda
INSERT INTO fhir.patients
(
ID,
BIRTHDATE,
DEATHDATE,
SSN,
DRIVERS,
PASSPORT,
PREFIX,
FIRST,
LAST,
SUFFIX,
MAIDEN,
MARITAL,
RACE,
ETHNICITY,
GENDER,
BIRTHPLACE,
ADDRESS,
CITY,
STATE,
ZIP
)
WITH
patients AS (
SELECT
ROW_ID
, SUBJECT_ID
, GENDER
, DOB
, DOD
, DOD_HOSP
, DOD_SSN
-- , EXPIRE_FLAG
FROM mimic.PATIENTS
),
admissions as (
SELECT
distinct SUBJECT_ID
, ADMITTIME
, ETHNICITY
FROM mimic.ADMISSIONS
)
patient_id_mapper AS (
SELECT
SUBJECT_ID,
PATIENT
FROM fhir.PatientMappingTable
),
row_to_insert AS (
SELECT
PATIENT as ID,
DOB as BIRTHDATE,
DOD as DEATHDATE,
'00000000' as SSN,
null as DRIVERS,
null as PASSPORT,
null as PREFIX,
'First' as FIRST,
'Last' as LAST,
null as SUFFIX,
null as MAIDEN,
null as MARITAL,
'0000-0' as RACE, -- Asian
'0000-0' as ETHNICITY, -- Not Hispanic or Latino
GENDER,
'' as BIRTHPLACE,
'' as ADDRESS,
'' as CITY,
'' as STATE,
null as ZIP
FROM patients
LEFT JOIN admissions USING (SUBJECT_ID)
LEFT JOIN patient_id_mapper USING (SUBJECT_ID)
)
SELECT
distinct ID,
BIRTHDATE,
DEATHDATE,
SSN,
DRIVERS,
PASSPORT,
PREFIX,
FIRST,
LAST,
SUFFIX,
MAIDEN,
MARITAL,
RACE,
ETHNICITY,
GENDER,
BIRTHPLACE,
ADDRESS,
CITY,
STATE,
ZIP
FROM row_to_insert;
|
-- Add down migration script here
DROP TABLE IF EXISTS public.users;
|
<reponame>Shuttl-Tech/antlr_psql
-- file:join.sql ln:36 expect:true
INSERT INTO J2_TBL VALUES (0, NULL)
|
<reponame>darmie/pgsql-parser
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT ON TABLES TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT ALL ON TABLES TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT ALL ON SEQUENCES TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT ALL ON FUNCTIONS TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT USAGE, SELECT ON SEQUENCES TO grantee_name;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO your_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA schema_name TO your_user;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA schema_name TO your_user;
|
<filename>LeetCode/others/615_Average_Salary_Departments_VS_Company.sql
WITH full_table AS
(SELECT
s.*
,e.department_id
FROM salary AS s
JOIN employee AS e
ON s.employee_id = e.employee_id)
,department_monthly AS
(SELECT
department_id
,pay_date
,AVG(amount) AS dept_avg
FROM full_table
GROUP BY department_id, pay_date)
,company_monthly AS
(SELECT
pay_date
,AVG(amount) AS company_avg
FROM full_table
GROUP BY pay_date)
SELECT
DISTINCT
DATE_FORMAT(d.pay_date, '%Y-%m') AS pay_month
,d.departmend_id
,CASE
WHEN d.dept_avg < c.company_avg THEN "lower"
WHEN d.dept_avg = c.company_avg THEN "same"
WHEN d.dept_avg > c.company_avg THEN "higher"
END AS comparison
FROM department_monthly d
JOIN company_monthly c
ON d.pay_date = c.pay_date
ORDER BY d.pay_date DESC, d.department_id ASC;
-- complication: employees can have different pay-dates
SELECT
a.pay_month
,a.department_id,
CASE
WHEN a.dept_avg_sal < b.corp_avg_sal THEN "lower"
WHEN a.dept_avg_sal = b.corp_avg_sal THEN "same"
ELSE "higher"
END AS comparison
FROM
(SELECT
date_format(pay_date, '%Y-%m') as pay_month
,e.department_id
,AVG(amount) AS dept_avg_sal
FROM salary AS s
JOIN employee AS e
ON s.employee_id = e.employee_id
GROUP BY pay_month, e.department_id
) AS a
JOIN
(SELECT
date_format(pay_date, '%Y-%m') as pay_month
,AVG(amount) AS corp_avg_sal
FROM salary GROUP BY pay_month
) AS b
ON a.pay_month = b.pay_month
ORDER BY pay_month, a.department_id;
|
SELECT 'a';
|
<filename>src/MailCheck.Dkim.Migration/Scripts/2018-12-13-1628-update-dkim-history-table.sql
ALTER TABLE `dkim_entity_history`
RENAME TO `dkim_entity_history_old` ;
CREATE TABLE `dkim_entity_history` (
`id` varchar(255) NOT NULL,
`state` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
CREATE TABLE `standing` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uuid` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
`group_id` int(11) DEFAULT NULL,
`team_id` int(11) DEFAULT NULL,
`games` int(11) DEFAULT NULL,
`wins` int(11) DEFAULT NULL,
`draws` int(11) DEFAULT NULL,
`loses` int(11) DEFAULT NULL,
`goals_for` int(11) DEFAULT NULL,
`goals_against` int(11) DEFAULT NULL,
`goals_diff` int(11) DEFAULT NULL,
`points` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK4awhvl2ehgj44wlnqswxkc5b7` (`group_id`),
KEY `FKk0dfm7sbpoa92k84uygyb1iax` (`team_id`),
CONSTRAINT `FK4awhvl2ehgj44wlnqswxkc5b7` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`),
CONSTRAINT `FKk0dfm7sbpoa92k84uygyb1iax` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 1, 8, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 1, 15, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 1, 22, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 2, 19, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 2, 11, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 2, 25, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 2, 3, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 3, 18, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 3, 31, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 3, 32, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 3, 30, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 4, 20, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 4, 16, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 4, 28, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 4, 12, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 5, 2, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 5, 27, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 5, 13, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 5, 17, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 6, 9, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 6, 5, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 6, 29, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 6, 7, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 7, 6, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 7, 23, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 7, 26, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 7, 10, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 8, 14, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 8, 24, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 8, 21, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT IGNORE INTO standing(uuid, group_id, team_id, games, wins, draws, loses, goals_for, goals_against, goals_diff, points) VALUES(UUID(), 8, 4, 0, 0, 0, 0, 0, 0, 0, 0);
|
ALTER TABLE posts ALTER COLUMN inserted_date SET NOT NULL
|
<reponame>digital-guard/preserv
-- INGEST STEP1
-- Inicialização do Módulo Ingest dos prjetos Digital-Guard.
--
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS adminpack;
CREATE EXTENSION IF NOT EXISTS file_fdw;
CREATE SERVER IF NOT EXISTS files FOREIGN DATA WRAPPER file_fdw;
-- old CREATE SCHEMA IF NOT EXISTS ingest;
DROP SCHEMA IF EXISTS ingest CASCADE; -- important to clean!
CREATE SCHEMA ingest;
CREATE SCHEMA IF NOT EXISTS tmp_orig;
CREATE SCHEMA IF NOT EXISTS api;
CREATE SCHEMA IF NOT EXISTS download;
CREATE EXTENSION IF NOT EXISTS file_fdw;
CREATE SERVER IF NOT EXISTS files
FOREIGN DATA WRAPPER file_fdw
;
CREATE EXTENSION IF NOT EXISTS postgres_fdw;
CREATE SERVER IF NOT EXISTS foreign_server_dl03
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (dbname 'dl03t_main')
;
CREATE USER MAPPING FOR PUBLIC SERVER foreign_server_dl03;
-- -- --
-- SQL and bash generators (optim-ingest submodule)
CREATE FUNCTION ingest.fdw_csv_paths(
p_name text, p_context text DEFAULT 'br', p_path text DEFAULT NULL
) RETURNS text[] AS $f$
SELECT array[
fpath, -- /tmp/pg_io/digital-preservation-XX
concat(fpath,'/', iIF(p_context IS NULL,''::text,p_context||'-'), p_name, '.csv')
]
FROM COALESCE(p_path,'/tmp/pg_io') t(fpath)
$f$ language SQL;
CREATE FUNCTION ingest.fdw_generate_direct_csv(
p_file text, -- path+filename+ext
p_fdwname text, -- nome da tabela fwd
p_delimiter text DEFAULT ',',
p_addtxtype boolean DEFAULT true,
p_header boolean DEFAULT true
) RETURNS text AS $f$
DECLARE
fpath text;
cols text[];
sepcols text;
BEGIN
sepcols := iIF(p_addtxtype, '" text,"'::text, '","'::text);
cols := pg_csv_head(p_file, p_delimiter);
EXECUTE
format(
'DROP FOREIGN TABLE IF EXISTS %s; CREATE FOREIGN TABLE %s (%s%s%s)',
p_fdwname, p_fdwname, '"', array_to_string(cols,sepcols), iIF(p_addtxtype, '" text'::text, '"')
) || format(
'SERVER files OPTIONS (filename %L, format %L, header %L, delimiter %L)',
p_file, 'csv', p_header::text, p_delimiter
);
RETURN p_fdwname;
END;
$f$ language PLpgSQL;
COMMENT ON FUNCTION ingest.fdw_generate_direct_csv
IS 'Generates a FOREIGN TABLE for simples and direct CSV ingestion.'
;
CREATE FUNCTION ingest.fdw_generate(
p_name text, -- table name and CSV input filename
p_context text DEFAULT 'br', -- or null
p_schemaname text DEFAULT 'optim',
p_columns text[] DEFAULT NULL, -- mais importante! nao poderia ser null
p_addtxtype boolean DEFAULT false, -- add " text"
p_path text DEFAULT NULL, -- default based on ids
p_delimiter text DEFAULT ',',
p_header boolean DEFAULT true
) RETURNS text AS $f$
DECLARE
fdwname text;
fpath text;
f text;
sepcols text;
BEGIN
-- usar ingest.fdw_csv_paths!
fpath := COALESCE(p_path,'/tmp/pg_io'); -- /tmp/pg_io/digital-preservation-XX
f := concat(fpath,'/', iIF(p_context IS NULL,''::text,p_context||'-'), p_name, '.csv');
p_context := iIF(p_context IS NULL, ''::text, '_'|| p_context);
fdwname := 'tmp_orig.fdw_'|| iIF(p_schemaname='optim', ''::text, p_schemaname||'_') || p_name || p_context;
-- poderia otimizar por chamada (alter table option filename), porém não é paralelizável.
sepcols := iIF(p_addtxtype, '" text,"'::text, '","'::text);
-- if delimiter = tab, format = tsv
EXECUTE
format(
'DROP FOREIGN TABLE IF EXISTS %s; CREATE FOREIGN TABLE %s (%s%s%s)',
fdwname, fdwname, '"', array_to_string(p_columns,sepcols), iIF(p_addtxtype, '" text'::text, '"')
) || format(
'SERVER files OPTIONS (filename %L, format %L, header %L, delimiter %L)',
f, 'csv', p_header::text, p_delimiter
);
return ' '|| fdwname || E' was created!\n source: '||f|| ' ';
END;
$f$ language PLpgSQL;
COMMENT ON FUNCTION ingest.fdw_generate
IS 'Generates a structure FOREIGN TABLE for ingestion.'
;
CREATE FUNCTION ingest.fdw_generate_getCSV(
p_name text, -- table name and CSV input filename
p_context text DEFAULT 'br', -- or null
p_path text DEFAULT NULL, -- default based on ids
p_delimiter text DEFAULT ','
) RETURNS text AS $f$
SELECT ingest.fdw_generate(p_name, p_context, 'optim', pg_csv_head(p[2],p_delimiter), true, p_path, p_delimiter)
FROM ingest.fdw_csv_paths(p_name,p_context,p_path) t(p)
$f$ language SQL;
-- select ingest.fdw_generate_getCSV('enderecos','br_mg_bho');
-- creates tmp_orig.fdw_enderecos_br_mg_bho by source: /tmp/pg_io/br_mg_bho-enderecos.csv
CREATE FUNCTION ingest.fdw_generate_getclone(
-- foreign-data wrapper generator
p_tablename text, -- cloned-table name
p_context text DEFAULT 'br', -- or null
p_schemaname text DEFAULT 'optim',
p_ignore text[] DEFAULT NULL, -- colunms to be ignored.
p_add text[] DEFAULT NULL, -- colunms to be added.
p_path text DEFAULT NULL -- default based on ids
) RETURNS text AS $wrap$
SELECT ingest.fdw_generate(
$1,$2,$3,
pg_tablestruct_dump_totext(p_schemaname||'.'||p_tablename,p_ignore,p_add),
true, -- p_addtxtype
p_path
)
$wrap$ language SQL;
COMMENT ON FUNCTION ingest.fdw_generate_getclone
IS 'Generates a clone-structure FOREIGN TABLE for ingestion. Wrap for fdw_generate().'
;
------------
-- GEOMETRIAS
/* !REVISAR CONTROLE DE IDs!
CREATE TABLE ingest.addr_point(
?file_id,
pack_id int, -- each donated package have only 1 set of points. E.g. pk012 of BR_MG_BHO.
vianame text, -- official name in the origin
housenum text, -- supply by origin
-- is_informal boolean default false, -- non-official. E.g. closed condominim.
geom geometry(Point,4326) NOT NULL,
UNIQUE(pack_id,vianame,housenum),
UNIQUE(pack_id,geom)
);
COMMENT ON TABLE ingest.addr_point
IS 'Ingested address points of one or more packages, temporary data (not need package-version).'
;
*/
CREATE TABLE ingest.via_line(
pck_id real NOT NULL, -- REFERENCES optim.donatedPack(pck_id),
vianame text,
is_informal boolean default false, -- non-official name (loteametos com ruas ainda sem nome)
geom geometry,
info JSONb,
UNIQUE(pck_id,geom)
);
COMMENT ON TABLE ingest.via_line
IS 'Ingested via lines (street axis) of one or more packages, temporary data (not need package-version).'
;
---------
DROP FOREIGN TABLE IF EXISTS ingest.fdw_foreign_jurisdiction_geom cascade;
CREATE FOREIGN TABLE ingest.fdw_foreign_jurisdiction_geom (
osm_id bigint,
jurisd_base_id integer,
jurisd_local_id integer,
name text,
parent_abbrev text,
abbrev text,
wikidata_id bigint,
lexlabel text,
isolabel_ext text,
ddd integer,
info jsonb,
jtags jsonb,
housenumber_system_type text,
lex_urn text,
geom geometry(Geometry,4326)
) SERVER foreign_server_dl03
OPTIONS (schema_name 'optim', table_name 'jurisdiction_geom')
;
CREATE TABLE optim.donor (
id integer NOT NULL PRIMARY KEY CHECK (id = country_id*1000000+local_serial), -- by trigger!
country_id int NOT NULL CHECK(country_id>0), -- ISO
local_serial int NOT NULL CHECK(local_serial>0), -- byu contry
scope_osm_id bigint NOT NULL REFERENCES optim.jurisdiction(osm_id),
kx_scope_label text, -- city code or country code
shortname text, -- abreviation or acronym (local)
vat_id text, -- in the Brazilian case is "CNPJ:number"
legalName text NOT NULL, -- in the Brazilian case is Razao Social
wikidata_id bigint, -- without "Q" prefix
url text, -- official home page of the organization
info JSONb, -- all other information using controlled keys
kx_vat_id text, -- cache for normalized vat_id
UNIQUE(country_id,local_serial),
UNIQUE(country_id,kx_vat_id),
UNIQUE(country_id,legalName),
UNIQUE(country_id,kx_scope_label,shortname)
);
DROP FOREIGN TABLE IF EXISTS ingest.fdw_donor;
CREATE FOREIGN TABLE ingest.fdw_donor (
id integer,
country_id integer,
local_serial integer,
scope_osm_id bigint,
kx_scope_label text,
shortname text,
vat_id text,
legalname text,
wikidata_id bigint,
url text,
info jsonb,
kx_vat_id text
) SERVER foreign_server_dl03
OPTIONS (schema_name 'optim', table_name 'donor');
DROP FOREIGN TABLE IF EXISTS ingest.fdw_donated_PackTpl;
CREATE FOREIGN TABLE ingest.fdW_donated_PackTpl (
id bigint,
donor_id integer,
user_resp text,
pk_count integer,
original_tpl text,
make_conf_tpl jsonb,
kx_num_files integer,
info jsonb
) SERVER foreign_server_dl03
OPTIONS (schema_name 'optim', table_name 'donated_packtpl');
DROP FOREIGN TABLE IF EXISTS ingest.fdw_donated_PackFileVers;
CREATE FOREIGN TABLE ingest.fdw_donated_PackFileVers (
id bigint,
hashedfname text,
pack_id bigint,
pack_item integer,
pack_item_accepted_date date,
kx_pack_item_version integer,
user_resp text,
info jsonb
) SERVER foreign_server_dl03
OPTIONS (schema_name 'optim', table_name 'donated_packfilevers');
DROP FOREIGN TABLE IF EXISTS ingest.fdw_feature_type;
CREATE FOREIGN TABLE ingest.fdw_feature_type (
ftid smallint,
ftname text,
geomtype text,
need_join boolean,
description text,
info jsonb
) SERVER foreign_server_dl03
OPTIONS (schema_name 'optim', table_name 'feature_type');
CREATE TABLE ingest.donated_PackComponent(
-- Tabela similar a ingest.layer_file, armazena sumários descritivos de cada layer. Equivale a um subfile do hashedfname.
id bigserial NOT NULL PRIMARY KEY, -- layerfile_id
--packvers_id bigint NOT NULL REFERENCES ingest.t_donated_PackFileVers(id),
--ftid smallint NOT NULL REFERENCES ingest.t_feature_type(ftid),
packvers_id bigint NOT NULL,
ftid smallint NOT NULL,
is_evidence boolean default false,
hash_md5 text NOT NULL, -- or "size-md5" as really unique string
proc_step int DEFAULT 1, -- current status of the "processing steps", 1=started, 2=loaded, ...=finished
file_meta jsonb,
feature_asis_summary jsonb,
feature_distrib jsonb,
UNIQUE(packvers_id,ftid,hash_md5)
--UNIQUE(packvers_id,ftid,is_evidence) -- conferir como será o controle de múltiplos files ingerindo no mesmo layer.
);
DROP VIEW IF EXISTS ingest.vwall CASCADE;
CREATE VIEW ingest.vwall AS
SELECT pc.id, dn.kx_scope_label, j.housenumber_system_type
FROM ingest.donated_PackComponent pc
LEFT JOIN ingest.fdw_donated_packfilevers pf
ON pc.packvers_id=pf.id
LEFT JOIN ingest.fdw_donated_PackTpl pt
ON pf.pack_id=pt.id
LEFT JOIN ingest.fdw_donor dn
ON pt.donor_id=dn.id
LEFT JOIN ingest.fdw_foreign_jurisdiction_geom j
ON dn.scope_osm_id=j.osm_id
;
/* LIXO
DROP TABLE ingest.layer_file;
CREATE TABLE ingest.layer_file (
file_id serial NOT NULL PRIMARY KEY,
pck_id real NOT NULL CHECK( dg_preserv.packid_isvalid(pck_id) ), -- package file ID, not controled here. Talvez seja packVers (package and version) ou pck_id com real
pck_fileref_sha256 text NOT NULL CHECK( pck_fileref_sha256 ~ '^[0-9a-f]{64,64}\.[a-z0-9]+$' ),
ftid smallint NOT NULL REFERENCES ingest.fdw_feature_type(ftid),
file_type text, -- csv, geojson, shapefile, etc.
proc_step int DEFAULT 1, -- current status of the "processing steps", 1=started, 2=loaded, ...=finished
hash_md5 text NOT NULL, -- or "size-md5" as really unique string
file_meta jsonb,
feature_asis_summary jsonb,
feature_distrib jsonb,
UNIQUE(ftid,hash_md5) -- or size-MD5 or (ftid,hash_md5)? não faz sentido usar duas vezes se existe _full.
);
CREATE TABLE ingest.feature_asis_report (
file_id int NOT NULL REFERENCES ingest.donated_PackComponent(id) ON DELETE CASCADE,
feature_id int NOT NULL,
info jsonb,
UNIQUE(file_id,feature_id)
);
*/
CREATE TABLE ingest.tmp_geojson_feature (
file_id bigint NOT NULL REFERENCES ingest.donated_PackComponent(id) ON DELETE CASCADE,
feature_id int,
feature_type text,
properties jsonb,
jgeom jsonb,
UNIQUE(file_id,feature_id)
); -- to be feature_asis after GeoJSON ingestion.
CREATE TABLE ingest.feature_asis (
file_id bigint NOT NULL REFERENCES ingest.donated_PackComponent(id) ON DELETE CASCADE,
feature_id int NOT NULL,
properties jsonb,
geom geometry NOT NULL CHECK ( st_srid(geom)=4326 ),
UNIQUE(file_id,feature_id)
);
CREATE TABLE ingest.cadastral_asis (
file_id bigint NOT NULL REFERENCES ingest.donated_PackComponent(id) ON DELETE CASCADE,
cad_id int NOT NULL,
properties jsonb NOT NULL,
UNIQUE(file_id,cad_id)
);
-- -- -- --
-- VIEWS:
DROP VIEW IF EXISTS ingest.vw01info_feature_type CASCADE;
CREATE VIEW ingest.vw01info_feature_type AS
SELECT ftid, ftname, geomtype, need_join, description,
COALESCE(f.info,'{}'::jsonb) || (
SELECT to_jsonb(t2) FROM (
SELECT c.ftid as class_ftid, c.ftname as class_ftname,
c.description as class_description,
c.info as class_info
FROM ingest.fdw_feature_type c
WHERE c.geomtype='class' AND c.ftid = 10*round(f.ftid/10)
) t2
) AS info
FROM ingest.fdw_feature_type f
WHERE f.geomtype!='class'
;
COMMENT ON VIEW ingest.vw01info_feature_type
IS 'Adds class_ftname, class_description and class_info to ingest.fdw_feature_type.info.'
;
DROP VIEW IF EXISTS ingest.vw02simple_feature_asis CASCADE;
CREATE VIEW ingest.vw02simple_feature_asis AS
-- Pending: validar fazendo count(*) comparativo entre a view e a tabela.
WITH dump AS (
SELECT *, (ST_DUMP(geom)).geom AS geometry
FROM ingest.feature_asis
)
SELECT file_id, feature_id, properties, geometry::geometry(POLYGON,4326) AS geom
FROM dump
WHERE GeometryType(geom)='MULTIPOLYGON'
UNION
SELECT file_id, feature_id, properties, geometry::geometry(LINESTRING,4326)
FROM dump
WHERE GeometryType(geom)='MULTILINESTRING'
UNION
SELECT file_id, feature_id, properties, geom
FROM dump
WHERE GeometryType(geom) NOT IN ('MULTILINESTRING','MULTIPOLYGON')
;
COMMENT ON VIEW ingest.vw02simple_feature_asis
IS 'Normalize (and simplify) geometries of ingest.feature_asis, when it is a redundant multi-geometry.'
;
-- Homologando o uso do feature_id como gid, n=n2:
-- SELECT count(*) n, count(distinct feature_id::text||','||file_id::text) n2 FROM ingest.feature_asis;
DROP VIEW IF EXISTS ingest.vw03full_layer_file CASCADE;
CREATE VIEW ingest.vw03full_layer_file AS
SELECT lf.*, ft.ftname, ft.geomtype, ft.need_join, ft.description, ft.info AS ft_info
FROM ingest.donated_PackComponent lf INNER JOIN ingest.vw01info_feature_type ft
ON lf.ftid=ft.ftid
;
DROP VIEW IF EXISTS ingest.vw04simple_layer_file CASCADE;
CREATE VIEW ingest.vw04simple_layer_file AS
--SELECT id, geomtype, proc_step, ftid, ftname, file_type,
SELECT id, geomtype, proc_step, ftid, ftname,
round((file_meta->'size')::int/2014^2) file_mb,
substr(hash_md5,1,7) as md5_prefix
FROM ingest.vw03full_layer_file
;
DROP VIEW IF EXISTS ingest.vw05test_feature_asis CASCADE;
CREATE VIEW ingest.vw05test_feature_asis AS
SELECT v.packvers_id, v.ft_info->>'class_ftname' as class_ftname, t.file_id,
v.file_meta->>'file' as file,
t.n, t.n_feature_ids,
CASE WHEN t.n=t.n_feature_ids THEN 'ok' ELSE '!BUG!' END AS is_ok_msg,
t.n=t.n_feature_ids AS is_ok
FROM (
SELECT file_id, COUNT(*) n, COUNT(DISTINCT feature_id) n_feature_ids
FROM ingest.feature_asis
GROUP BY 1
) t INNER JOIN ingest.vw03full_layer_file v
ON v.id = t.file_id
ORDER BY 1,2,3
;
/*
DROP VIEW IF EXISTS ingest.vw06simple_layer CASCADE;
CREATE VIEW ingest.vw06simple_layer AS
SELECT t.*, (SELECT COUNT(*) FROM ingest.feature_asis WHERE file_id=t.file_id) AS n_items
FROM ingest.vw04simple_layer_file t
; */
----------------
----------------
-- Ingest AS-IS
CREATE FUNCTION ingest.donated_PackComponent_geomtype(
p_file_id bigint
) RETURNS text[] AS $f$
-- ! pendente revisão para o caso shortname multiplingual, aqui usando só 'pt'
SELECT array[geomtype, ftname, info->>'class_ftname', info->'class_info'->>'shortname_pt']
FROM ingest.vw01info_feature_type
WHERE ftid = (
SELECT ftid
FROM ingest.donated_PackComponent
WHERE id = p_file_id
)
$f$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.donated_PackComponent_geomtype(bigint)
IS '[Geomtype,ftname,class_ftname,shortname_pt] of a layer_file.'
;
CREATE FUNCTION ingest.feature_asis_geohashes(
p_file_id bigint, -- ID at ingest.donated_PackComponent
ghs_size integer DEFAULT 5
) RETURNS jsonb AS $f$
WITH scan AS (
SELECT ghs, COUNT(*) n
FROM (
SELECT
ST_Geohash(
CASE WHEN t1a.gtype='point' THEN geom ELSE ST_PointOnSurface(geom) END
,ghs_size
) as ghs
FROM ingest.feature_asis,
(SELECT (ingest.donated_PackComponent_geomtype(p_file_id))[1] AS gtype) t1a
WHERE file_id=p_file_id
) t2
GROUP BY 1
ORDER BY 1
)
SELECT jsonb_object_agg( ghs,n )
FROM scan
$f$ LANGUAGE SQL;
CREATE FUNCTION ingest.feature_asis_assign_volume(
p_file_id bigint, -- ID at ingest.donated_PackComponent
p_usemedian boolean DEFAULT false
) RETURNS jsonb AS $f$
WITH get_layer_type AS (SELECT (ingest.donated_PackComponent_geomtype(p_file_id))[1] AS gtype)
SELECT to_jsonb(t3)
FROM (
SELECT n, CASE gtype
WHEN 'poly' THEN 'polygons'
WHEN 'line' THEN 'segments'
WHEN 'point' THEN 'points'
END n_unit,
size, CASE gtype
WHEN 'poly' THEN 'km2'
WHEN 'line' THEN 'km'
ELSE ''
END size_unit,
bbox_km2,
size_mdn
FROM (
SELECT gtype, n, CASE gtype
WHEN 'poly' THEN round( ST_Area(geom,true)/1000000.0)::int
WHEN 'line' THEN round( ST_Length(geom,true)/1000.0)::int
ELSE null::int
END size,
round( (ST_Area(ST_OrientedEnvelope(geom),true)/1000000)::numeric, 1)::int AS bbox_km2,
round(size_mdn::numeric,3) AS size_mdn
FROM (
SELECT count(*) n, st_collect(geom) as geom, CASE gtype --(gtype||iif(p_usemedian,'','_no'::text))
WHEN 'poly' THEN percentile_disc (0.5) WITHIN GROUP(ORDER BY ST_Area(geom,true)) /1000000.0
WHEN 'line' THEN percentile_disc (0.5) WITHIN GROUP(ORDER BY ST_Length(geom,true)) /1000.0
ELSE null::float
END size_mdn
FROM ingest.feature_asis, get_layer_type
WHERE file_id=p_file_id
GROUP BY gtype
) t1a, get_layer_type
) t2
) t3
$f$ LANGUAGE SQL;
CREATE FUNCTION ingest.feature_asis_assign(
p_file_id bigint -- ID at ingest.donated_PackComponent
) RETURNS jsonb AS $f$
SELECT ingest.feature_asis_assign_volume(p_file_id,true)
|| jsonb_build_object(
'distribution',
hcode_distribution_reduce(ingest.feature_asis_geohashes(p_file_id,ghs_size), 2, 1, 500, 5000, 2)
)
FROM (
SELECT CASE WHEN (ingest.donated_PackComponent_geomtype(p_file_id))[1]='poly' THEN 5 ELSE 6 END AS ghs_size
) t
$f$ LANGUAGE SQL;
CREATE FUNCTION ingest.feature_asis_assign_format(
p_file_id bigint, -- ID at ingest.donated_PackComponent
p_layer_type text DEFAULT NULL,
p_layer_name text DEFAULT '',
p_glink text DEFAULT '' -- ex. http://git.AddressForAll.org/out-BR2021-A4A/blob/main/data/SP/RibeiraoPreto/_pk058/
) RETURNS text AS $f$
SELECT format(
$$<tr>
<td><b>%s</b><br/>(%s)</td>
<td><b>Quantity</b>: %s %s     bbox_km2: %s     %s
<br/><b>Distribution</b>: %s.
<br/><b>Package</b> file: <code>%s</code>
<br/>Sub-file: <b>%s</b> with MD5 <code>%s</code> (%s bytes modifyed in %s)
</td>
</tr>$$,
CASE WHEN p_layer_type IS NULL THEN layerinfo[2] ELSE p_layer_type END,
CASE WHEN p_layer_name>'' OR layerinfo[4] IS NULL THEN p_layer_name ELSE layerinfo[4] END,
feature_asis_summary->>'n',
feature_asis_summary->>'n_unit',
feature_asis_summary->>'bbox_km2',
CASE WHEN feature_asis_summary?'size' THEN 'Total size: '||(feature_asis_summary->>'size') ||' '|| (feature_asis_summary->>'size_unit') END,
hcode_distribution_format(feature_asis_summary->'distribution', true, p_glink|| layerinfo[3] ||'_'),
--pck_fileref_sha256,
--file_type,
hash_md5,
file_meta->>'size',
substr(file_meta->>'modification',1,10)
) as htmltabline
FROM ingest.donated_PackComponent, (SELECT ingest.donated_PackComponent_geomtype(p_file_id) as layerinfo) t
WHERE id=p_file_id
$f$ LANGUAGE SQL;
CREATE FUNCTION ingest.package_layers_summary(
p_pck_id real,
p_caption text DEFAULT 'Package XX version YY, jurisdiction ZZ',
p_glink text DEFAULT '' -- ex. http://git.AddressForAll.org/out-BR2021-A4A/blob/main/data/SP/RibeiraoPreto/_pk058/
) RETURNS xml AS $f$
SELECT xmlelement(
name table,
xmlelement(name caption, p_caption),
xmlagg( trinfo::xml ORDER BY trinfo )
)
FROM (
SELECT ingest.feature_asis_assign_format(id, null, '', p_glink) AS trinfo
FROM ingest.donated_PackComponent
WHERE packvers_id=p_pck_id
) t
$f$ LANGUAGE SQL;
-- SELECT volat_file_write( '/tmp/pg_io/pk'||floor(pck_id)::text||'readme_table.txt', ingest.package_layers_summary(pck_id)::text ) FROM (select distinct pck_id from ingest.donated_PackComponent) t;
-----
CREATE FUNCTION ingest.geojson_load(
p_file text, -- absolute path and filename, test with '/tmp/pg_io/EXEMPLO3.geojson'
p_ftid int, -- REFERENCES ingest.fdw_feature_type(ftid)
p_pck_id real,
p_pck_fileref_sha256 text,
p_ftype text DEFAULT NULL,
p_to4326 boolean DEFAULT true
) RETURNS text AS $f$
DECLARE
q_file_id integer;
jins_count bigint;
q_ret text;
BEGIN
INSERT INTO ingest.donated_PackComponent(p_pck_id,ftid,/*file_type,*/file_meta/*,pck_fileref_sha256*/)
SELECT p_pck_id, p_ftid::smallint,
COALESCE( p_ftype, substring(p_file from '[^\.]+$') ),
geojson_readfile_headers(p_file)/*,*/
--p_pck_fileref_sha256
RETURNING file_id INTO q_file_id;
WITH jins AS (
INSERT INTO ingest.tmp_geojson_feature
SELECT *
FROM geojson_readfile_features_jgeom(p_file, q_file_id )
RETURNING 1
)
SELECT COUNT(*) FROM jins INTO jins_count;
WITH ins2 AS (
INSERT INTO ingest.feature_asis
SELECT file_id, feature_id, properties,
CASE WHEN p_to4326 AND ST_SRID(geom)!=4326 THEN ST_Transform(geom,4326) ELSE geom END
FROM (
SELECT file_id, feature_id, properties,
ST_GeomFromGeoJSON(jgeom) geom
FROM ingest.tmp_geojson_feature
WHERE file_id = q_file_id
) t
RETURNING 1
)
SELECT 'Inserted in tmp '|| jins_count ||' items from file_id '|| q_file_id
||E'.\nInserted in feature '|| (SELECT COUNT(*) FROM ins2) ||' items.'
INTO q_ret;
DELETE FROM ingest.tmp_geojson_feature WHERE file_id = q_file_id;
RETURN q_ret;
END;
$f$ LANGUAGE PLpgSQL;
CREATE FUNCTION ingest.getmeta_to_file(
p_file text,
p_ftid int,
p_pck_id bigint,
p_pck_fileref_sha256 text,
p_ftype text DEFAULT NULL
-- proc_step = 1
-- ,p_size_min int DEFAULT 5
) RETURNS bigint AS $f$
-- with ... check
WITH filedata AS (
SELECT p_pck_id, p_ftid, /*ftype,*/
CASE
WHEN (fmeta->'size')::int<5 OR (fmeta->>'hash_md5')='' THEN NULL --guard
ELSE fmeta->>'hash_md5'
END AS hash_md5,
(fmeta - 'hash_md5') AS fmeta
FROM (
SELECT /*COALESCE( p_ftype, lower(substring(p_file from '[^\.]+$')) ) as ftype,*/
jsonb_pg_stat_file(p_file,true) as fmeta
) t
),
file_exists AS (
SELECT id,proc_step
FROM ingest.donated_PackComponent
WHERE packvers_id=p_pck_id AND hash_md5=(SELECT hash_md5 FROM filedata)
), ins AS (
INSERT INTO ingest.donated_PackComponent(packvers_id,ftid,/*file_type,*/hash_md5,file_meta/*,pck_fileref_sha256*/)
--SELECT * , p_pck_fileref_sha256 FROM filedata
SELECT * FROM filedata
ON CONFLICT DO NOTHING
RETURNING id
)
SELECT id FROM (
SELECT id, 1 as proc_step FROM ins
UNION ALL
SELECT id, proc_step FROM file_exists
) t WHERE proc_step=1
$f$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.getmeta_to_file(text,int,bigint,text,text)
IS 'Reads file metadata and inserts it into ingest.donated_PackComponent. If proc_step=1 returns valid ID else NULL.'
;
CREATE FUNCTION ingest.getmeta_to_file(
p_file text, -- 1.
p_ftname text, -- 2. define o layer... um file pode ter mais de um layer??
p_pck_id bigint,
p_pck_fileref_sha256 text,
p_ftype text DEFAULT NULL -- 5
) RETURNS bigint AS $wrap$
SELECT ingest.getmeta_to_file(
$1,
(SELECT ftid::int FROM ingest.fdw_feature_type WHERE ftname=lower($2)),
$3, $4, $5
);
$wrap$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.getmeta_to_file(text,text,bigint,text,text)
IS 'Wrap para ingest.getmeta_to_file() usando ftName ao invés de ftID.'
;
-- ex. select ingest.getmeta_to_file('/tmp/a.csv',3,555);
-- ex. select ingest.getmeta_to_file('/tmp/b.shp','geoaddress_full',555);
/* ver VIEW
CREATE FUNCTION ingest.fdw_feature_type_refclass_tab(
p_ftid integer
) RETURNS TABLE (like ingest.fdw_feature_type) AS $f$
SELECT *
FROM ingest.fdw_feature_type
WHERE ftid = 10*round(p_ftid/10)
$f$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.fdw_feature_type_refclass_tab(integer)
IS 'Feature class of a feature_type, returing it as table.'
;
CREATE FUNCTION ingest.fdw_feature_type_refclass_jsonb(
p_ftid integer
) RETURNS JSONB AS $wrap$
SELECT to_jsonb(t)
FROM ingest.fdw_feature_type_refclass_tab($1) t
$wrap$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.fdw_feature_type_refclass_jsonb(integer)
IS 'Feature class of a feature_type, returing it as JSONb.'
;
*/
CREATE FUNCTION ingest.any_load_debug(
p_method text, -- 1.; shp/csv/etc.
p_fileref text, -- apenas referencia para ingest.donated_PackComponent
p_ftname text, -- featureType of layer... um file pode ter mais de um layer??
p_tabname text, -- tabela temporária de ingestáo
p_pck_id text, -- 5. id do package da Preservação.
p_pck_fileref_sha256 text,
p_tabcols text[] DEFAULT NULL, -- 7. array[]=tudo, senão lista de atributos de p_tabname, ou só geometria
p_geom_name text DEFAULT 'geom',
p_to4326 boolean DEFAULT true -- 9. on true converts SRID to 4326 .
) RETURNS JSONb AS $f$
SELECT to_jsonb(t)
FROM ( SELECT $1 AS method, $2 AS fileref, $3 AS ftname, $4 AS tabname, $5 AS pck_id,
$6 pck_fileref_sha256, $7 tabcols, $8 geom_name, $9 to4326
) t
$f$ LANGUAGE SQL;
CREATE FUNCTION ingest.any_load(
p_method text, -- shp/csv/etc.
p_fileref text, -- apenas referencia para ingest.donated_PackComponent
p_ftname text, -- featureType of layer... um file pode ter mais de um layer??
p_tabname text, -- tabela temporária de ingestáo
p_pck_id bigint, -- id do package da Preservação.
p_pck_fileref_sha256 text,
p_tabcols text[] DEFAULT NULL, -- array[]=tudo, senão lista de atributos de p_tabname, ou só geometria
p_geom_name text DEFAULT 'geom',
p_to4326 boolean DEFAULT true -- on true converts SRID to 4326 .
) RETURNS text AS $f$
DECLARE
q_file_id integer;
q_query text;
q_query_cad text;
feature_id_col text;
use_tabcols boolean;
msg_ret text;
num_items bigint;
BEGIN
--IF p_method='csv2sql' THEN
--p_fileref := p_fileref || '.csv';
---- other checks
--ELSE
--p_fileref := regexp_replace(p_fileref,'\.shp$', '') || '.shp';
--END IF;
q_file_id := ingest.getmeta_to_file(p_fileref,p_ftname,p_pck_id,p_pck_fileref_sha256); -- not null when proc_step=1. Ideal retornar array.
IF q_file_id IS NULL THEN
RETURN format('ERROR: file-read problem or data ingested before, see %s.',p_fileref);
END IF;
IF p_tabcols=array[]::text[] THEN -- condição para solicitar todas as colunas
p_tabcols = rel_columns(p_tabname);
END IF;
IF 'gid'=ANY(p_tabcols) THEN
feature_id_col := 'gid';
p_tabcols := array_remove(p_tabcols,'gid');
ELSE
feature_id_col := 'row_number() OVER () AS gid';
END IF;
-- RAISE NOTICE E'\n===tabcols:\n %\n===END tabcols\n', array_to_string(p_tabcols,',');
IF p_tabcols is not NULL AND array_length(p_tabcols,1)>0 THEN
p_tabcols := sql_parse_selectcols(p_tabcols); -- clean p_tabcols
use_tabcols := true;
ELSE
use_tabcols := false;
END IF;
IF 'geom'=ANY(p_tabcols) THEN
p_tabcols := array_remove(p_tabcols,'geom');
END IF;
q_query := format(
$$
WITH
scan AS (
SELECT %s, gid, properties,
CASE
WHEN ST_SRID(geom)=0 THEN ST_SetSRID(geom,4326)
WHEN %s AND ST_SRID(geom)!=4326 THEN ST_Transform(geom,4326)
ELSE geom
END AS geom
FROM (
SELECT %s, -- feature_id_col
%s as properties,
%s -- geom
FROM %s %s
) t
),
ins AS (
INSERT INTO ingest.feature_asis
SELECT *
FROM scan WHERE geom IS NOT NULL AND ST_IsValid(geom)
RETURNING 1
)
SELECT COUNT(*) FROM ins
$$,
q_file_id,
iif(p_to4326,'true'::text,'false'), -- decide ST_Transform
feature_id_col,
iIF( use_tabcols, 'to_jsonb(subq)'::text, E'\'{}\'::jsonb' ), -- properties
CASE WHEN lower(p_geom_name)='geom' THEN 'geom' ELSE p_geom_name||' AS geom' END,
p_tabname,
iIF( use_tabcols, ', LATERAL (SELECT '|| array_to_string(p_tabcols,',') ||') subq', ''::text )
);
q_query_cad := format(
$$
WITH
scan AS (
SELECT %s, gid, properties
FROM (
SELECT %s, -- feature_id_col
%s as properties
FROM %s %s
) t
),
ins AS (
INSERT INTO ingest.cadastral_asis
SELECT *
FROM scan WHERE properties IS NOT NULL
RETURNING 1
)
SELECT COUNT(*) FROM ins
$$,
q_file_id,
feature_id_col,
iIF( use_tabcols, 'to_jsonb(subq)'::text, E'\'{}\'::jsonb' ), -- properties
p_tabname,
iIF( use_tabcols, ', LATERAL (SELECT '|| array_to_string(p_tabcols,',') ||') subq', ''::text )
);
IF (SELECT ftid::int FROM ingest.fdw_feature_type WHERE ftname=lower(p_ftname))<20 THEN -- feature_type id
EXECUTE q_query_cad INTO num_items;
ELSE
EXECUTE q_query INTO num_items;
END IF;
msg_ret := format(
E'From file_id=%s inserted type=%s\nin feature_asis %s items.',
q_file_id, p_ftname, num_items
);
IF num_items>0 THEN
UPDATE ingest.donated_PackComponent
SET proc_step=2, -- if insert process occurs after q_query.
feature_asis_summary= ingest.feature_asis_assign(q_file_id)
WHERE id=q_file_id;
END IF;
RETURN msg_ret;
END;
$f$ LANGUAGE PLpgSQL;
COMMENT ON FUNCTION ingest.any_load(text,text,text,text,bigint,text,text[],text,boolean)
IS 'Load (into ingest.feature_asis) shapefile or any other non-GeoJSON, of a separated table.'
;
-- posto ipiranga logo abaixo.. sorvetorua.
-- ex. SELECT ingest.any_load('/tmp/pg_io/NRO_IMOVEL.shp','geoaddress_none','pk027_geoaddress1',27,array['gid','textstring']);
CREATE FUNCTION ingest.any_load(
p_method text, -- 1. shp/csv/etc.
p_fileref text, -- 2. apenas referencia para ingest.donated_PackComponent
p_ftname text, -- 3. featureType of layer... um file pode ter mais de um layer??
p_tabname text, -- 4. tabela temporária de ingestáo
p_pck_id text, -- 5. id do package da Preservação no formato "a.b".
p_pck_fileref_sha256 text, -- 6
p_tabcols text[] DEFAULT NULL, -- 7. lista de atributos, ou só geometria
p_geom_name text DEFAULT 'geom', -- 8
p_to4326 boolean DEFAULT true -- 9. on true converts SRID to 4326 .
) RETURNS text AS $wrap$
SELECT ingest.any_load($1, $2, $3, $4, to_bigint($5), $6, $7, $8, $9)
$wrap$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.any_load(text,text,text,text,text,text,text[],text,boolean)
IS 'Wrap to ingest.any_load(1,2,3,4=real) using string format DD_DD.'
;
CREATE FUNCTION ingest.osm_load(
p_fileref text, -- apenas referencia para ingest.donated_PackComponent
p_ftname text, -- featureType of layer... um file pode ter mais de um layer??
p_tabname text, -- tabela temporária de ingestáo
p_pck_id bigint, -- id do package da Preservação.
p_pck_fileref_sha256 text,
p_tabcols text[] DEFAULT NULL, -- array[]=tudo, senão lista de atributos de p_tabname, ou só geometria
p_geom_name text DEFAULT 'way',
p_to4326 boolean DEFAULT false -- on true converts SRID to 4326 .
) RETURNS text AS $f$
DECLARE
q_file_id integer;
q_query text;
feature_id_col text;
use_tabcols boolean;
msg_ret text;
num_items bigint;
BEGIN
q_file_id := ingest.getmeta_to_file(p_fileref,p_ftname,p_pck_id,p_pck_fileref_sha256); -- not null when proc_step=1. Ideal retornar array.
IF q_file_id IS NULL THEN
RETURN format('ERROR: file-read problem or data ingested before, see %s.',p_fileref);
END IF;
IF p_tabcols=array[]::text[] THEN -- condição para solicitar todas as colunas
p_tabcols = rel_columns(p_tabname);
END IF;
IF 'gid'=ANY(p_tabcols) THEN
feature_id_col := 'gid';
p_tabcols := array_remove(p_tabcols,'gid');
ELSE
feature_id_col := 'row_number() OVER () AS gid';
END IF;
IF p_geom_name=ANY(p_tabcols) THEN
p_tabcols := array_remove(p_tabcols,p_geom_name);
END IF;
IF p_tabcols is not NULL AND array_length(p_tabcols,1)>1 THEN
p_tabcols := sql_parse_selectcols(p_tabcols); -- clean p_tabcols
use_tabcols := true;
ELSE
use_tabcols := false;
END IF;
q_query := format(
$$
WITH
scan AS (
SELECT %s, gid, properties,
CASE
WHEN ST_SRID(geom)=0 THEN ST_SetSRID(geom,4326)
WHEN %s AND ST_SRID(geom)!=4326 THEN ST_Transform(geom,4326)
ELSE geom
END AS geom
FROM (
SELECT %s, -- feature_id_col
%s as properties,
%s -- geom
FROM %s %s
) t
),
ins AS (
INSERT INTO ingest.feature_asis
SELECT *
FROM scan WHERE geom IS NOT NULL AND ST_IsValid(geom)
RETURNING 1
)
SELECT COUNT(*) FROM ins
$$,
q_file_id,
iif(p_to4326,'true'::text,'false'), -- decide ST_Transform
feature_id_col,
iIF( use_tabcols, $$to_jsonb(subq) - 'tags' || (subq).tags $$::text, $$tags$$ ), -- properties
CASE WHEN lower(p_geom_name)='geom' THEN 'geom' ELSE p_geom_name||' AS geom' END,
p_tabname,
iIF( use_tabcols, ', LATERAL (SELECT '|| array_to_string(p_tabcols,',') ||') subq', ''::text )
);
RAISE NOTICE E'\n===q_query:\n %\n===END q_query\n', q_query;
EXECUTE q_query INTO num_items;
msg_ret := format(
E'From file_id=%s inserted type=%s\nin feature_asis %s items.',
q_file_id, p_ftname, num_items
);
IF num_items>0 THEN
UPDATE ingest.donated_PackComponent
SET proc_step=2, -- if insert process occurs after q_query.
feature_asis_summary= ingest.feature_asis_assign(q_file_id)
WHERE id=q_file_id;
END IF;
RETURN msg_ret;
END;
$f$ LANGUAGE PLpgSQL;
CREATE FUNCTION ingest.osm_load(
p_fileref text, -- 1. apenas referencia para ingest.donated_PackComponent
p_ftname text, -- 2. featureType of layer... um file pode ter mais de um layer??
p_tabname text, -- 3. tabela temporária de ingestáo
p_pck_id text, -- 4. id do package da Preservação no formato "a.b".
p_pck_fileref_sha256 text, -- 5
p_tabcols text[] DEFAULT NULL, -- 6. lista de atributos, ou só geometria
p_geom_name text DEFAULT 'way', -- 7
p_to4326 boolean DEFAULT false -- 8. on true converts SRID to 4326 .
) RETURNS text AS $wrap$
SELECT ingest.osm_load($1, $2, $3, to_bigint($4), $5, $6, $7, $8)
$wrap$ LANGUAGE SQL;
COMMENT ON FUNCTION ingest.osm_load(text,text,text,text,text,text[],text,boolean)
IS 'Wrap to ingest.osm_load(1,2,3,4=real) using string format DD_DD.'
;
-----
CREATE FUNCTION ingest.qgis_vwadmin_feature_asis(
p_mode text -- 'create' or 'drop'
) RETURNS text AS $f$
DECLARE
q_query text;
BEGIN
SELECT string_agg( format(
CASE p_mode
WHEN 'drop' THEN 'DROP VIEW IF EXISTS vw_asis_pk%s_f%s_%s; -- %s.'
ELSE 'CREATE VIEW vw_asis_pk%s_f%s_%s AS SELECT feature_id AS gid, properties, geom FROM ingest.feature_asis WHERE file_id=%s;'
END
,dg_preserv.packid_to_str(pck_id,true)
,file_id
,feature_asis_summary->>'n_unit'
,file_id
), E' \n' )
INTO q_query
FROM ingest.donated_PackComponent;
EXECUTE q_query;
RETURN E'\n(check before NO BUGs with SELECT * FROM ingest.vw05test_feature_asis)\n---\nok! all '||p_mode||E'\nCheck on psql by \\dv vw_asis_*';
END;
$f$ LANGUAGE PLpgSQL;
-- select ingest.qgis_vwadmin_feature_asis('create');
----
CREATE FUNCTION ingest.donated_PackComponent_distribution_prefixes(
p_file_id int
) RETURNS text[] AS $f$
SELECT array_agg(p ORDER BY length(p) desc, p) FROM (
SELECT jsonb_object_keys(feature_asis_summary->'distribution') p
FROM ingest.donated_PackComponent WHERE id=p_file_id
) t
$f$ LANGUAGE SQL;
-- for use with geohash_checkprefix()
-- select file_id, ingest.donated_PackComponent_distribution_prefixes(file_id)as prefixes FROM ingest.donated_PackComponent
------------------------
------------------------
CREATE FUNCTION ingest.feature_asis_export(p_file_id bigint)
RETURNS TABLE (ghs9 text, gid int, info jsonb, geom geometry(Point,4326)) AS $f$
SELECT ghs, gid,
CASE
WHEN n=1 THEN jsonb_build_object('address',addresses[1])
WHEN n>1 AND cardinality(via_names)=1 THEN
jsonb_build_object('via_name',via_names[1], 'house_numbers',to_jsonb(house_numbers))
ELSE jsonb_build_object('addresses',addresses)
END as info,
CASE n WHEN 1 THEN geoms[1] ELSE ST_Centroid(ST_Collect(geoms)) END AS geom
FROM (
SELECT ghs,
MIN(row_id)::int as gid,
COUNT(*) n,
array_agg(geom) as geoms,
array_agg(DISTINCT via_name||', '||house_number) addresses,
array_agg(DISTINCT via_name) via_names,
array_agg(DISTINCT house_number) house_numbers,
max(DISTINCT is_compl::text)::boolean house_numbers_has_complement
FROM (
SELECT file_id, geom,
CASE
WHEN (SELECT housenumber_system_type FROM ingest.vwall WHERE id=p_file_id)='metric' THEN
ROW_NUMBER() OVER(ORDER BY properties->>'via_name', to_bigint(properties->>'house_number'))
WHEN (SELECT housenumber_system_type FROM ingest.vwall WHERE id=p_file_id)='teste' THEN
ROW_NUMBER() OVER(ORDER BY properties->>'via_name', NULLIF(regexp_replace(properties->>'house_number', '\D', '', 'g'), '')::int, regexp_replace(properties->>'house_number', '[^[:alpha:]]', '', 'g') )
ELSE
ROW_NUMBER() OVER(ORDER BY properties->>'via_name', to_bigint(properties->>'house_number'))
--ROW_NUMBER() OVER(ORDER BY properties->>'address'))
-- or (properties->>'via_name')||'#'||properties->>'house_number'
END AS row_id,
COALESCE(nullif(properties->'is_complemento_provavel','null')::boolean,false) as is_compl,
properties->>'via_name' as via_name,
properties->>'house_number' as house_number,
st_geohash(geom,9) ghs
FROM ingest.feature_asis
WHERE file_id=p_file_id
) t1
GROUP BY 1
) t2
WHERE cardinality(via_names)<3
ORDER BY gid
$f$ LANGUAGE SQL IMMUTABLE;
-- SELECT * FROM ingest.feature_asis_export(1) t LIMIT 1000;
-- ----------------------------
DROP TABLE IF EXISTS ingest.publicating_geojsons_p3exprefix;
CREATE TABLE ingest.publicating_geojsons_p3exprefix(
ghs9 text,
prefix text,
gid integer,
info jsonb,
geom geometry
);
DROP TABLE IF EXISTS ingest.publicating_geojsons_p2distrib;
CREATE TABLE ingest.publicating_geojsons_p2distrib(
hcode text,
n_items integer,
geom geometry
);
CREATE FUNCTION ingest.publicating_geojsons_p1(
p_file_id bigint, -- e.g. 1, see ingest.donated_PackComponent
p_isolabel_ext text -- e.g. 'BR-MG-BeloHorizonte', see jurisdiction_geom
) RETURNS text AS $f$
DELETE FROM ingest.publicating_geojsons_p3exprefix;
INSERT INTO ingest.publicating_geojsons_p3exprefix
SELECT ghs9, NULL::text, gid, info, geom
FROM ingest.feature_asis_export(p_file_id) t
;
SELECT 'p1';
$f$ language SQL VOLATILE; --fim p1
CREATE FUNCTION ingest.publicating_geojsons_p2(
p_file_id bigint, -- e.g. 1, see ingest.donated_PackComponent
p_isolabel_ext text -- e.g. 'BR-MG-BeloHorizonte', see jurisdiction_geom
) RETURNS text AS $f$
UPDATE ingest.donated_PackComponent
SET feature_distrib = geocode_distribution_generate('ingest.publicating_geojsons_p3exprefix',7)
WHERE id= p_file_id
;
SELECT 'p2';
$f$ language SQL VOLATILE; --fim p2
CREATE FUNCTION ingest.publicating_geojsons_p3(
p_file_id bigint, -- e.g. 1, see ingest.donated_PackComponent
p_isolabel_ext text, -- e.g. 'BR-MG-BeloHorizonte', see jurisdiction_geom
p_fileref text --
) RETURNS text AS $f$
DELETE FROM ingest.publicating_geojsons_p2distrib;
INSERT INTO ingest.publicating_geojsons_p2distrib
SELECT t.hcode, t.n_items, -- length(t.hcode) AS len,
ST_Intersection(
ST_SetSRID( ST_geomFromGeohash(replace(t.hcode, '*', '')) , 4326),
(SELECT geom FROM ingest.fdw_foreign_jurisdiction_geom WHERE isolabel_ext=p_isolabel_ext)
) AS geom
FROM hcode_distribution_reduce_recursive_raw(
(SELECT feature_distrib FROM ingest.donated_PackComponent WHERE id= p_file_id),
1,
(SELECT length(st_geohash(geom)) FROM ingest.fdw_foreign_jurisdiction_geom WHERE isolabel_ext=p_isolabel_ext),
750, 8000, 3
) t
;
SELECT pg_catalog.pg_file_unlink(p_fileref || '/pts_*.geojson');
UPDATE ingest.publicating_geojsons_p3exprefix
SET prefix=t4.prefix
FROM (
WITH t1 (prefix_regex) as (
SELECT hcode_prefixset_parse( array_agg(hcode) )
FROM ingest.publicating_geojsons_p2distrib
)
SELECT hcode_prefixset_element(t.ghs9,'^(?:'|| t1.prefix_regex ||')') AS prefix, t.gid
FROM ingest.publicating_geojsons_p3exprefix t, t1
) t4
WHERE t4.gid = publicating_geojsons_p3exprefix.gid
;
UPDATE ingest.donated_PackComponent
SET feature_distrib = (SELECT jsonb_object_agg(hcode, n_items) FROM ingest.publicating_geojsons_p2distrib)
WHERE id= p_file_id
;
DELETE FROM ingest.publicating_geojsons_p2distrib; -- limpa
SELECT 'p3';
$f$ language SQL VOLATILE; --fim p3
CREATE FUNCTION ingest.publicating_geojsons_p4(
p_file_id bigint, -- e.g. 1, see ingest.donated_PackComponent
p_isolabel_ext text, -- e.g. 'BR-MG-BeloHorizonte', see jurisdiction_geom
p_fileref text
) RETURNS text AS $f$
WITH prefs AS ( SELECT DISTINCT prefix FROM ingest.publicating_geojsons_p3exprefix ORDER BY 1 )
SELECT write_geojsonb_Features(
format('SELECT * FROM ingest.publicating_geojsons_p3exprefix WHERE prefix=%L ORDER BY gid',prefix),
format('%s/pts_%s.geojson',p_fileref,prefix),
't1.geom',
'info::jsonb',
NULL, -- p_cols_orderby
NULL, -- col_id
2
) FROM prefs;
DELETE FROM ingest.publicating_geojsons_p3exprefix; -- limpa
SELECT 'Arquivos de file_id='|| p_file_id::text || ' publicados em ' || p_file_id::text || '/pts_*.geojson'
;
$f$ language SQL VOLATILE; -- fim p4
CREATE FUNCTION ingest.publicating_geojsons(
p_file_id bigint, -- e.g. 1, see ingest.donated_PackComponent
p_isolabel_ext text, -- e.g. 'BR-MG-BeloHorizonte', see jurisdiction_geom
p_fileref text
) RETURNS text AS $f$
SELECT ingest.publicating_geojsons_p1($1,$2);
SELECT ingest.publicating_geojsons_p2($1,$2);
SELECT ingest.publicating_geojsons_p3($1,$2,$3);
SELECT ingest.publicating_geojsons_p4($1,$2,$3);
SELECT 'fim';
$f$ language SQL VOLATILE; -- need be a sequential PLpgSQL to neatly COMMIT?
-- Ver id em ingest.donated_PackComponent
-- SELECT ingest.publicating_geojsons(X,'BR-MG-BeloHorizonte','/tmp/pg_io');
--------------------
--------------------
-- OSM lib
-- only for ingest OSM
CREATE EXTENSION IF NOT EXISTS hstore; -- to make osm
CREATE EXTENSION IF NOT EXISTS unaccent; -- to normalize
CREATE SCHEMA IF NOT EXISTS lib; -- lib geral, que não é public mas pode fazer drop/create sem medo.
CREATE or replace FUNCTION lib.osm_to_jsonb_remove() RETURNS text[] AS $f$
SELECT array['osm_uid','osm_user','osm_version','osm_changeset','osm_timestamp'];
$f$ LANGUAGE SQL IMMUTABLE;
CREATE or replace FUNCTION lib.osm_to_jsonb(
p_input text[], p_strip boolean DEFAULT false
) RETURNS jsonb AS $f$
SELECT CASE WHEN p_strip THEN jsonb_strip_nulls(x,true) ELSE x END
FROM (
SELECT jsonb_object($1) - lib.osm_to_jsonb_remove()
) t(x)
$f$ LANGUAGE sql IMMUTABLE;
CREATE or replace FUNCTION lib.osm_to_jsonb(
p_input public.hstore, p_strip boolean DEFAULT false
) RETURNS jsonb AS $f$
SELECT CASE WHEN p_strip THEN jsonb_strip_nulls(x,true) ELSE x END
FROM (
SELECT hstore_to_jsonb_loose($1) - lib.osm_to_jsonb_remove()
) t(x)
$f$ LANGUAGE sql IMMUTABLE;
CREATE or replace FUNCTION lib.name2lex_pre(
p_name text -- 1
,p_normalize boolean DEFAULT true -- 2
,p_cut boolean DEFAULT true -- 3
,p_unaccent boolean DEFAULT false -- 4
) RETURNS text AS $f$
SELECT
CASE WHEN p_unaccent THEN lower(unaccent(x)) ELSE x END
FROM (
-- old SELECT CASE WHEN p_normalize THEN stable.normalizeterm2($1,p_cut) ELSE $1 END
SELECT CASE WHEN p_normalize THEN $1 ELSE $1 END
) t(x)
$f$ LANGUAGE SQL IMMUTABLE;
CREATE or replace FUNCTION lib.name2lex(
p_name text -- 1
,p_normalize boolean DEFAULT true -- 2
,p_cut boolean DEFAULT true -- 3
,p_flag boolean DEFAULT false -- 4
) RETURNS text AS $f$
SELECT trim(replace(
regexp_replace(
lib.name2lex_pre($1,$2,$3,$4),
E' d[aeo] | d[oa]s | com | para |^d[aeo] | / .+| [aeo]s | [aeo] |\-d\'| d\'|[\-\' ]',
'.',
'g'
),
'..',
'.'
),'.')
$f$ LANGUAGE SQL IMMUTABLE;
-------------------------------------------------
-- Armazena arquivos make_conf.yaml
CREATE TABLE ingest.lix_conf_yaml (
jurisdiction text NOT NULL, -- jurisdição, por exemplo: BR
t text, -- versão texto de make_conf.yaml.
y jsonb -- arquivo make_conf.yaml. Pode ser substituído por make_conf_tpl de optim.donated_PackTpl. Tornando essa tabela desnecessária.
);
CREATE UNIQUE INDEX ON ingest.lix_conf_yaml (jurisdiction,(y->>'pack_id'));
-- Armazena templates para geração de makefile
CREATE TABLE ingest.lix_mkme_srcTpl (
tplInputSchema_id text NOT NULL, -- identificador do template. por exemplo: ref027a
y text, -- template, por exemplo make_ref027a.mustache.mk
UNIQUE(tplInputSchema_id)
);
-- Armazena conteúdos de arquivos referentes a uma jurisdição, para geração de makefile.
-- Pode ser absorvida por optim.jurisdiction
CREATE TABLE ingest.lix_jurisd_tpl (
jurisdiction text NOT NULL, -- jurisdição, por exemplo: BR
tpl_last text, -- commomLast.mustache.mk
first_yaml jsonb, -- commomFirst.yaml da jurisdição.
readme_mk text, -- template mustache para readme.
UNIQUE(jurisdiction)
);
CREATE or replace FUNCTION ingest.lix_insert(
file text
) RETURNS void AS $wrap$
DECLARE
yl jsonb;
conf jsonb;
t text;
aux text;
p_type text;
jurisd text;
BEGIN
SELECT (regexp_matches(file, '([^/]*)$'))[1] INTO p_type;
SELECT (regexp_matches(file, '.*-([^/-]*)/.*$'))[1] INTO jurisd;
IF jurisd IS NULL
THEN
jurisd := 'INT';
END IF;
RAISE NOTICE 'ext orig_filename_ext : %', p_type;
RAISE NOTICE 'ext orig_filename_ext : %', jurisd;
CASE p_type
WHEN 'make_conf.yaml' THEN
aux:= pg_read_file(file);
conf:= yaml_to_jsonb(aux);
INSERT INTO ingest.lix_conf_yaml (jurisdiction,t,y) VALUES (jurisd,aux,conf)
ON CONFLICT (jurisdiction,(y->>'pack_id')) DO UPDATE SET y = conf, t = aux;
WHEN (select (regexp_matches(p_type, 'make_ref[0-9]+[a-z]\.mustache.mk'))[1]) THEN
t:= pg_read_file(file);
INSERT INTO ingest.lix_mkme_srcTpl VALUES (SUBSTRING(file,'(ref[0-9]{1,3}[a-z])'),t)
ON CONFLICT (tplInputSchema_id) DO UPDATE SET tplInputSchema_id = t;
WHEN 'commomFirst.yaml' THEN
yl:= yamlfile_to_jsonb(file);
INSERT INTO ingest.lix_jurisd_tpl (jurisdiction, first_yaml) VALUES (jurisd,yl)
ON CONFLICT (jurisdiction) DO UPDATE SET first_yaml = yl;
WHEN 'commomLast.mustache.mk' THEN
t:= pg_read_file(file);
INSERT INTO ingest.lix_jurisd_tpl (jurisdiction, tpl_last) VALUES (jurisd,t)
ON CONFLICT (jurisdiction) DO UPDATE SET tpl_last = t;
WHEN 'readme.mustache' THEN
t:= pg_read_file(file);
INSERT INTO ingest.lix_jurisd_tpl (jurisdiction, readme_mk) VALUES (jurisd,t)
ON CONFLICT (jurisdiction) DO UPDATE SET readme_mk = t;
END CASE;
END;
$wrap$ LANGUAGE PLpgSQL;
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-BR/src/maketemplates/commomFirst.yaml');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-BR/src/maketemplates/readme.mustache');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-PE/src/maketemplates/commomFirst.yaml');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-PE/src/maketemplates/readme.mustache');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-CO/src/maketemplates/commomFirst.yaml');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-CO/src/maketemplates/readme.mustache');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv/src/maketemplates/make_ref027a.mustache.mk');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv/src/maketemplates/commomLast.mustache.mk');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv/src/maketemplates/commomFirst.yaml');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-BR/data/RJ/Niteroi/_pk0016.01/make_conf.yaml');
--SELECT ingest.lix_insert('/var/gits/_dg/preserv-BR/data/MG/BeloHorizonte/_pk0008.01/make_conf.yaml');
CREATE or replace FUNCTION ingest.jsonb_mustache_prepare(
dict jsonb, -- input
p_type text DEFAULT 'make_conf'
) RETURNS jsonb AS $f$
DECLARE
packvers_id bigint;
key text;
method text;
sql_select text;
sql_view text;
bt jsonb := 'true'::jsonb;
bf jsonb := 'false'::jsonb;
codec_value text[];
orig_filename_ext text[];
orig_filename_string text;
multiple_files jsonb;
codec_desc_global jsonb;
codec_desc0 jsonb DEFAULT NULL;
codec_desc_default0 jsonb DEFAULT NULL;
codec_desc_sobre0 jsonb DEFAULT NULL;
codec_extension0 text DEFAULT NULL;
codec_descr_mime0 jsonb DEFAULT NULL;
codec_desc jsonb;
codec_desc_default jsonb;
codec_desc_sobre jsonb;
codec_extension text;
codec_descr_mime jsonb;
BEGIN
CASE p_type -- preparing types
WHEN 'make_conf', NULL THEN
IF dict?'pack_id'
THEN
dict := jsonb_set( dict, array['pack_id'], replace(dict->>'pack_id','.','')::jsonb);
RAISE NOTICE 'pack_id : %', dict->>'pack_id';
END IF;
IF dict?'codec:descr_encode'
THEN
codec_desc_global := jsonb_object(regexp_split_to_array ( dict->>'codec:descr_encode','(;|=)'));
-- Compatibilidade com sql_view de BR-MG-BeloHorizonte/_pk0008.01
dict := dict || codec_desc_global;
RAISE NOTICE 'codec_desc_global : %', codec_desc_global;
END IF;
IF dict?'openstreetmap'
THEN
IF codec_desc_global IS NOT NULL
THEN
dict := jsonb_set( dict, array['openstreetmap','sha256file'] , to_jsonb(jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.openstreetmap.file)')::jsonpath )->0->>'file'));
dict := jsonb_set( dict, array['openstreetmap'], (dict->>'openstreetmap')::jsonb || codec_desc_global::jsonb );
END IF;
END IF;
FOREACH key IN ARRAY jsonb_object_keys_asarray(dict->'layers')
LOOP
method := dict->'layers'->key->>'method';
RAISE NOTICE 'layer : %, method: %', key, method;
codec_desc := codec_desc0;
codec_desc_default := codec_desc_default0;
codec_desc_sobre := codec_desc_sobre0;
codec_extension := codec_extension0;
codec_descr_mime := codec_descr_mime0;
dict := jsonb_set( dict, array['layers',key,'isCsv'], IIF(method='csv2sql',bt,bf) );
dict := jsonb_set( dict, array['layers',key,'isOgr'], IIF(method='ogr2ogr',bt,bf) );
dict := jsonb_set( dict, array['layers',key,'isOgrWithShp'], IIF(method='ogrWshp',bt,bf) );
dict := jsonb_set( dict, array['layers',key,'isShp'], IIF(method='shp2sql',bt,bf) );
dict := jsonb_set( dict, array['layers',key,'isOsm'], IIF(method='osm2sql',bt,bf) );
dict := jsonb_set( dict, array['layers',key,'isGdb'], IIF(method='gdb2sql',bt,bf) );
dict := jsonb_set( dict, array['layers',key,'sha256file'] , to_jsonb(jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.layers.'|| key ||'.file)')::jsonpath )->0->>'file'));
dict := jsonb_set( dict, array['layers',key,'sha256file_name'] , to_jsonb(jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.layers.'|| key ||'.file)')::jsonpath )->0->>'name'));
SELECT id FROM ingest.fdw_donated_packfilevers WHERE hashedfname = dict->'layers'->key->>'sha256file' INTO packvers_id;
dict := jsonb_set( dict, array['layers',key,'fullPkID'] , to_jsonb(packvers_id));
dict := jsonb_set( dict, array['layers',key,'layername_root'] , to_jsonb(key));
dict := jsonb_set( dict, array['layers',key,'layername'] , to_jsonb(key || '_' || (dict->'layers'->key->>'subtype') ));
dict := jsonb_set( dict, array['layers',key,'tabname'] , to_jsonb('pk' || (dict->'layers'->key->>'fullPkID') || '_p' || (dict->'layers'->key->>'file') || '_' || key));
IF dict?'orig'
THEN
dict := jsonb_set( dict, array['layers',key,'sha256file_path'] , to_jsonb((dict->>'orig') || '/' || (dict->'layers'->key->>'sha256file') ));
END IF;
-- Caso de BR-PR-Araucaria/_pk0061.01
IF jsonb_typeof(dict->'layers'->key->'orig_filename') = 'array'
THEN
SELECT to_jsonb(array_agg(jsonb_build_object('name_item',n, 'sql_select_item',s))) FROM unnest(ARRAY(SELECT jsonb_array_elements_text(dict->'layers'->key->'orig_filename')),ARRAY(SELECT jsonb_array_elements(dict->'layers'->key->'sql_select'))) t(n,s) INTO multiple_files;
RAISE NOTICE 'multiple_files_array : %', multiple_files;
dict := jsonb_set( dict, array['layers',key,'multiple_files'], 'true'::jsonb );
dict := jsonb_set( dict, array['layers',key,'multiple_files_array'], multiple_files );
SELECT string_agg($$'*$$ || trim(txt::text, $$"$$) || $$*'$$, ' ') FROM jsonb_array_elements(dict->'layers'->key->'orig_filename') AS txt INTO orig_filename_string;
dict := jsonb_set( dict, array['layers',key,'orig_filename_string_extract'], to_jsonb(orig_filename_string) );
SELECT $$\( $$ || string_agg($$-iname '*$$ || trim(txt::text, $$"$$) || $$*.shp'$$, ' -o ') || $$ \)$$ FROM jsonb_array_elements(dict->'layers'->key->'orig_filename') AS txt INTO orig_filename_string;
dict := jsonb_set( dict, array['layers',key,'orig_filename_string_find'], to_jsonb(orig_filename_string) );
END IF;
IF dict->'layers'->key?'sql_select'
THEN
sql_select := replace(dict->'layers'->key->>'sql_select',$$\"$$,E'\u130C9');
dict := jsonb_set( dict, array['layers',key,'sql_select'], sql_select::jsonb );
END IF;
IF dict->'layers'->key?'sql_view'
THEN
sql_view := replace(dict->'layers'->key->>'sql_view',$$"$$,E'\u130C9');
dict := jsonb_set( dict, array['layers',key,'sql_view'], to_jsonb(sql_view) );
END IF;
-- obtem codec a partir da extensão do arquivo
IF jsonb_typeof(dict->'layers'->key->'orig_filename') <> 'array'
THEN
orig_filename_ext := regexp_matches(dict->'layers'->key->>'orig_filename','\.(\w+)$');
IF orig_filename_ext IS NOT NULL
THEN
SELECT extension, descr_mime, descr_encode FROM ingest.codec_type WHERE (array[extension] = orig_filename_ext) INTO codec_extension, codec_descr_mime, codec_desc_default;
dict := jsonb_set( dict, array['layers',key,'orig_filename_with_extension'], 'true'::jsonb );
RAISE NOTICE 'orig_filename_ext : %', orig_filename_ext;
RAISE NOTICE 'codec_desc_default from extension: %', codec_desc_default;
END IF;
END IF;
IF dict->'layers'->key?'codec'
THEN
-- 1. Extensão, variação e sobrescrição. Descarta a variação.
IF EXISTS (SELECT 1 FROM regexp_matches(dict->'layers'->key->>'codec','^(.*)~(.*);(.*)$'))
THEN
SELECT extension, descr_mime, descr_encode FROM ingest.codec_type WHERE (extension = lower(split_part(dict->'layers'->key->>'codec', '~', 1)) AND variant IS NULL) INTO codec_extension, codec_descr_mime, codec_desc_default;
codec_desc_sobre := jsonb_object(regexp_split_to_array (split_part(regexp_replace(dict->'layers'->key->>'codec', ';','~'),'~',3),'(;|=)'));
RAISE NOTICE '1. codec_desc_default : %', codec_desc_default;
RAISE NOTICE '1. codec_desc_sobre : %', codec_desc_sobre;
END IF;
-- 2. Extensão e sobrescrição, sem variação
IF EXISTS (SELECT 1 FROM regexp_matches(dict->'layers'->key->>'codec','^([^;~]*);(.*)$'))
THEN
SELECT extension, descr_mime, descr_encode FROM ingest.codec_type WHERE (extension = lower(split_part(dict->'layers'->key->>'codec', ';', 1)) AND variant IS NULL) INTO codec_extension, codec_descr_mime, codec_desc_default;
codec_desc_sobre := jsonb_object(regexp_split_to_array (split_part(regexp_replace(dict->'layers'->key->>'codec', ';','~'),'~',2),'(;|=)'));
RAISE NOTICE '2. codec_desc_default : %', codec_desc_default;
RAISE NOTICE '2. codec_desc_sobre : %', codec_desc_sobre;
END IF;
-- 3. Extensão e variação ou apenas extensão, sem sobrescrição
IF EXISTS (SELECT 1 FROM regexp_matches(dict->'layers'->key->>'codec','^(.*)~([^;]*)$')) OR EXISTS (SELECT 1 FROM regexp_matches(dict->'layers'->key->>'codec','^([^~;]*)$'))
THEN
codec_value := regexp_split_to_array( dict->'layers'->key->>'codec' ,'(~)');
SELECT extension, descr_mime, descr_encode FROM ingest.codec_type WHERE (array[upper(extension), variant] = codec_value AND cardinality(codec_value) = 2) OR (array[upper(extension)] = codec_value AND cardinality(codec_value) = 1 AND variant IS NULL) INTO codec_extension, codec_descr_mime, codec_desc_default;
RAISE NOTICE '3. codec_desc_default : %', codec_desc_default;
END IF;
dict := jsonb_set( dict, array['layers',key,'isXlsx'], IIF(lower(codec_extension) = 'xlsx',bt,bf) );
END IF;
-- codec resultante
-- global sobrescreve default e é sobrescrito por sobre
IF codec_desc_default IS NOT NULL
THEN
codec_desc := codec_desc_default;
IF codec_desc_global IS NOT NULL
THEN
codec_desc := codec_desc || codec_desc_global;
END IF;
IF codec_desc_sobre IS NOT NULL
THEN
codec_desc := codec_desc || codec_desc_sobre;
END IF;
ELSE
IF codec_desc_global IS NOT NULL
THEN
codec_desc := codec_desc_global;
END IF;
IF codec_desc_sobre IS NOT NULL
THEN
codec_desc := codec_desc || codec_desc_sobre;
END IF;
END IF;
IF codec_desc IS NOT NULL
THEN
dict := jsonb_set( dict, array['layers',key], (dict->'layers'->>key)::jsonb || codec_desc::jsonb );
RAISE NOTICE 'codec resultante : %', codec_desc;
END IF;
IF codec_extension IS NOT NULL
THEN
dict := jsonb_set( dict, array['layers',key,'extension'], to_jsonb(codec_extension) );
RAISE NOTICE 'codec_extension : %', codec_extension;
ELSE
CASE method
WHEN 'csv2sql' THEN dict := jsonb_set( dict, array['layers',key,'extension'], to_jsonb('csv'::text) );
WHEN 'shp2sql' THEN dict := jsonb_set( dict, array['layers',key,'extension'], to_jsonb('shp'::text) );
ELSE
-- do nothing
END CASE;
RAISE NOTICE 'codec_extension from method: %', dict->'layers'->key->'extension';
END IF;
IF codec_descr_mime IS NOT NULL
THEN
dict := jsonb_set( dict, array['layers',key], (dict->'layers'->>key)::jsonb || codec_descr_mime::jsonb );
END IF;
IF codec_descr_mime?'mime' AND codec_descr_mime->>'mime' = 'application/zip' OR codec_descr_mime->>'mime' = 'application/gzip'
THEN
dict := jsonb_set( dict, array['layers',key,'multiple_files'], 'true'::jsonb );
dict := jsonb_set( dict, array['layers',key,'extension'], to_jsonb((regexp_matches(codec_extension,'(.*)\.\w+$'))[1]) );
END IF;
IF key='address' OR key='cadparcel' OR key='cadvia'
THEN
dict := jsonb_set( dict, array['layers',key,'isCadLayer'], 'true'::jsonb );
END IF;
IF dict->'layers'?key AND dict->'layers'?('cad'||key)
AND dict->'layers'->key->>'subtype' = 'ext'
AND dict->'layers'->('cad'||key)->>'subtype' = 'cmpl'
AND dict->'layers'->key?'join_column' AND dict->'layers'->('cad'||key)?'join_column'
THEN
dict := jsonb_set( dict, '{joins}', '{}'::jsonb );
dict := jsonb_set( dict, array['joins',key] , jsonb_build_object(
'layer', key || '_ext'
,'cadLayer', 'cad' || key || '_cmpl'
,'layerColumn', dict->'layers'->key->'join_column'
,'cadLayerColumn', dict->'layers'->('cad'||key)->'join_column'
,'layerFile', jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.layers.'|| key ||'.file)')::jsonpath )->0->>'file'
,'cadLayerFile', jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.layers.cad'|| key ||'.file)')::jsonpath )->0->>'file'
-- check by dict @? ('$.files[*].p ? (@ == $.layers.'|| key ||'.file)')
));
END IF;
IF key='geoaddress' AND dict->'layers'?'address'
AND dict->'layers'->key->>'subtype' = 'ext'
AND dict->'layers'->'address'->>'subtype' = 'cmpl'
AND dict->'layers'->key?'join_column'
AND dict->'layers'->'address'?'join_column'
THEN
dict := jsonb_set( dict, '{joins}', '{}'::jsonb );
dict := jsonb_set( dict, array['joins',key] , jsonb_build_object(
'layer', key || '_ext'
,'cadLayer', 'address_cmpl'
,'layerColumn', dict->'layers'->key->'join_column'
,'cadLayerColumn', dict->'layers'->'address'->'join_column'
,'layerFile', jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.layers.'|| key ||'.file)')::jsonpath )->0->>'file'
,'cadLayerFile', jsonb_path_query_array( dict, ('$.files[*] ? (@.p == $.layers.address.file)')::jsonpath )->0->>'file'
));
END IF;
END LOOP;
IF jsonb_array_length(to_jsonb(jsonb_object_keys_asarray(dict->'joins'))) > 0
THEN
dict := dict || jsonb_build_object( 'joins_keys', jsonb_object_keys_asarray(dict->'joins') );
END IF;
dict := dict || jsonb_build_object( 'layers_keys', jsonb_object_keys_asarray(dict->'layers') );
dict := jsonb_set( dict, array['pkversion'], to_jsonb(to_char((dict->>'pkversion')::int,'fm000')) );
dict := jsonb_set( dict, '{files,-1,last}','true'::jsonb);
-- CASE ELSE ...?
END CASE;
RETURN dict;
END;
$f$ language PLpgSQL;
-- SELECT ingest.jsonb_mustache_prepare( yamlfile_to_jsonb('/var/gits/_dg/preserv-BR/data/RJ/Niteroi/_pk0016.01/make_conf.yaml') );
-- SELECT ingest.jsonb_mustache_prepare( yamlfile_to_jsonb('/var/gits/_dg/preserv-BR/data/MG/BeloHorizonte/_pk0008.01/make_conf.yaml') );
-- SELECT ingest.jsonb_mustache_prepare( yamlfile_to_jsonb('/var/gits/_dg/preserv-PE/data/CUS/Cusco/_pk001/make_conf.yaml');
-- SELECT ingest.jsonb_mustache_prepare( yamlfile_to_jsonb('/var/gits/_dg/preserv-BR/data/SP/SaoPaulo/_pk0033.01/make_conf.yaml') );
-- SELECT ingest.jsonb_mustache_prepare( yamlfile_to_jsonb('/var/gits/_dg/preserv-BR/data/PR/Araucaria/_pk0061.01/make_conf.yaml') );
-- SELECT ingest.jsonb_mustache_prepare( yamlfile_to_jsonb('/var/gits/_dg/preserv-BR/data/_pk0004.01/make_conf.yaml') );
-- new ingest.make_conf_yaml2jsonb() = ? read file
CREATE or replace FUNCTION ingest.insert_bytesize(
dict jsonb -- input
) RETURNS jsonb AS $f$
DECLARE
a text;
sz bigint;
BEGIN
FOR i in 0..(select jsonb_array_length(dict->'files')-1)
LOOP
a := format($$ {files,%s,file} $$, i )::text[];
SELECT size::bigint FROM pg_stat_file(concat('/var/www/preserv.addressforall.org/download/',dict#>>a::text[])) INTO sz;
a := format($$ {files,%s,size} $$, i );
dict := jsonb_set( dict, a::text[],to_jsonb(sz));
END LOOP;
RETURN dict;
END;
$f$ language PLpgSQL;
--SELECT ingest.insert_bytesize( yamlfile_to_jsonb('/var/gits/_dg/preserv-BR/data/RS/SantaMaria/_pk0019.01/make_conf.yaml') );
CREATE or replace FUNCTION ingest.lix_generate_make_conf_with_size(
jurisd text,
pack_id text
) RETURNS text AS $f$
DECLARE
q_query text;
conf_yaml jsonb;
conf_yaml_t text;
f_yaml jsonb;
output_file text;
BEGIN
SELECT y, t FROM ingest.lix_conf_yaml WHERE jurisdiction = jurisd AND (y->>'pack_id') = pack_id INTO conf_yaml, conf_yaml_t;
SELECT first_yaml FROM ingest.lix_jurisd_tpl WHERE jurisdiction = jurisd INTO f_yaml;
SELECT f_yaml->>'pg_io' || '/make_conf_' || jurisd || pack_id INTO output_file;
--SELECT jsonb_to_yaml(ingest.insert_bytesize(conf_yaml)::text) INTO q_query;
SELECT regexp_replace( conf_yaml_t , '\n*files: *(\n *\-[^\n]*|\n[\t ]+[^\n]+)+\n*', E'\n\n' || jsonb_to_yaml((jsonb_build_object('files',ingest.insert_bytesize(conf_yaml)->'files'))::text) || E'\n', 'n') INTO q_query;
SELECT volat_file_write(output_file,q_query) INTO q_query;
RETURN q_query;
END;
$f$ LANGUAGE PLpgSQL;
-- SELECT ingest.lix_generate_make_conf_with_size('BR','19.1');
CREATE or replace FUNCTION ingest.lix_generate_make_conf_with_license(
jurisd text,
pack_id text
) RETURNS text AS $f$
DECLARE
q_query text;
conf_yaml jsonb;
conf_yaml_t text;
f_yaml jsonb;
output_file text;
license_evidences jsonb;
definition jsonb;
BEGIN
SELECT y, t FROM ingest.lix_conf_yaml WHERE jurisdiction = jurisd AND (y->>'pack_id') = pack_id INTO conf_yaml, conf_yaml_t;
SELECT first_yaml FROM ingest.lix_jurisd_tpl WHERE jurisdiction = jurisd INTO f_yaml;
SELECT f_yaml->>'pg_io' || '/make_conf_' || jurisd || pack_id INTO output_file;
SELECT to_jsonb(ARRAY[name, family, url]) FROM tmp_pack_licenses WHERE tmp_pack_licenses.pack_id = (to_char(substring(conf_yaml->>'pack_id','^([^\.]*)')::int,'fm000') || to_char(substring(conf_yaml->>'pack_id','([^\.]*)$')::int,'fm00')) INTO definition;
--conf_yaml := jsonb_set( conf_yaml, array['files_license'], files_license);
--SELECT jsonb_to_yaml(conf_yaml::text) INTO q_query;
IF conf_yaml?'license_evidences'
THEN
license_evidences := conf_yaml->'license_evidences' || jsonb_build_object('definition',definition);
ELSE
license_evidences := jsonb_build_object('license_evidences',jsonb_build_object('definition',definition));
--license_evidences := jsonb_set( '{}'::jsonb, array['license_evidences','definition'], definition );
END IF;
SELECT conf_yaml_t || jsonb_to_yaml(license_evidences::text)::text INTO q_query;
--SELECT volat_file_write(output_file,q_query) INTO q_query;
RETURN q_query;
END;
$f$ LANGUAGE PLpgSQL;
-- SELECT ingest.lix_generate_make_conf_with_license('BR','16.1');
CREATE FUNCTION ingest.lix_generate_makefile(
jurisd text,
pack_id text
) RETURNS text AS $f$
DECLARE
q_query text;
conf_yaml jsonb;
f_yaml jsonb;
mkme_srcTplLast text;
mkme_srcTpl text;
output_file text;
BEGIN
SELECT y FROM ingest.lix_conf_yaml WHERE jurisdiction = jurisd AND (y->>'pack_id') = pack_id INTO conf_yaml;
SELECT y FROM ingest.lix_mkme_srcTpl WHERE tplInputSchema_id = conf_yaml->>'schemaId_template' INTO mkme_srcTpl;
SELECT first_yaml FROM ingest.lix_jurisd_tpl WHERE jurisdiction = jurisd INTO f_yaml;
SELECT tpl_last FROM ingest.lix_jurisd_tpl WHERE jurisdiction = 'INT' INTO mkme_srcTplLast;
SELECT f_yaml->>'pg_io' || '/makeme_' || jurisd || pack_id INTO output_file;
conf_yaml := jsonb_set( conf_yaml, array['jurisdiction'], to_jsonb(jurisd) );
SELECT replace(jsonb_mustache_render(mkme_srcTpl || mkme_srcTplLast, ingest.jsonb_mustache_prepare(f_yaml || conf_yaml)),E'\u130C9',$$\"$$) INTO q_query; -- "
SELECT volat_file_write(output_file,q_query) INTO q_query;
RETURN q_query;
END;
$f$ LANGUAGE PLpgSQL;
-- SELECT ingest.lix_generate_makefile('BR','16.1');
-- SELECT ingest.lix_generate_makefile('PE','1');
CREATE FUNCTION ingest.lix_generate_readme(
jurisd text,
pack_id text
) RETURNS text AS $f$
DECLARE
q_query text;
conf_yaml jsonb;
f_yaml jsonb;
readme text;
output_file text;
BEGIN
SELECT y FROM ingest.lix_conf_yaml WHERE jurisdiction = jurisd AND (y->>'pack_id') = pack_id INTO conf_yaml;
SELECT first_yaml FROM ingest.lix_jurisd_tpl WHERE jurisdiction = jurisd INTO f_yaml;
SELECT readme_mk FROM ingest.lix_jurisd_tpl WHERE jurisdiction = jurisd INTO readme;
SELECT f_yaml->>'pg_io' || '/README-draft_' || jurisd || pack_id INTO output_file;
SELECT jsonb_mustache_render(readme, conf_yaml) INTO q_query;
SELECT volat_file_write(output_file,q_query) INTO q_query;
RETURN q_query;
END;
$f$ LANGUAGE PLpgSQL;
-- SELECT ingest.lix_generate_readme('/var/gits/_dg/','BR','16.1');
-- ----------------------------
CREATE TABLE download.redirects (
donor_id text,
filename_original text,
package_path text,
fhash text NOT NULL PRIMARY KEY, -- de_sha256
furi text NOT NULL, -- para_url
UNIQUE (fhash, furi)
);
CREATE or replace VIEW api.redirects AS SELECT * FROM download.redirects;
CREATE FUNCTION ingest.join(
p_ftname_layer text,
p_join_col_layer text,
p_fileref_layer_sha256 text,
p_ftname_cad text,
p_join_col_cad text,
p_fileref_cad_sha256 text
) RETURNS text AS $f$
DECLARE
q_query text;
msg_ret text;
num_items bigint;
BEGIN
q_query := format(
$$
WITH
cadis AS
(
SELECT *
FROM ingest.cadastral_asis
WHERE file_id IN
(
SELECT id
FROM ingest.donated_PackComponent
WHERE ftid IN
(
SELECT ftid::int
FROM ingest.fdw_feature_type
WHERE ftname=lower('%s')
)
--AND pck_fileref_sha256 = '%s'
AND packvers_id = (SELECT id FROM ingest.fdw_donated_PackFileVers WHERE hashedfname = '%s')
)
),
duplicate_keys AS (
SELECT asis.properties->'%s'
FROM
(
SELECT *
FROM ingest.feature_asis
WHERE file_id IN
(
SELECT id
FROM ingest.donated_PackComponent
WHERE ftid IN
(
SELECT ftid::int
FROM ingest.fdw_feature_type
WHERE ftname=lower('%s')
)
--AND pck_fileref_sha256 = '%s'
AND packvers_id = (SELECT id FROM ingest.fdw_donated_PackFileVers WHERE hashedfname = '%s')
)
) AS asis
INNER JOIN
cadis
ON asis.properties->'%s' = cadis.properties->'%s'
GROUP BY asis.properties->'%s'
HAVING COUNT(*)>1
),
layer_features AS (
UPDATE ingest.feature_asis l
SET properties = l.properties || c.properties-'%s'
FROM cadis AS c
WHERE l.properties->'%s' = c.properties->'%s'
AND l.file_id IN
(
SELECT id
FROM ingest.donated_PackComponent
WHERE ftid IN
(
SELECT ftid::int
FROM ingest.fdw_feature_type
WHERE ftname=lower('%s')
)
--AND pck_fileref_sha256 = '%s'
AND packvers_id = (SELECT id FROM ingest.fdw_donated_PackFileVers WHERE hashedfname = '%s')
)
AND l.properties->'%s' NOT IN ( SELECT * FROM duplicate_keys )
RETURNING 1
)
SELECT COUNT(*) FROM layer_features
$$,
p_ftname_cad,
p_fileref_cad_sha256,
p_join_col_layer,
p_ftname_layer,
p_fileref_layer_sha256,
p_join_col_layer,
p_join_col_cad,
p_join_col_layer,
p_join_col_cad,
p_join_col_layer,
p_join_col_cad,
p_ftname_layer,
p_fileref_layer_sha256,
p_join_col_layer
);
EXECUTE q_query INTO num_items;
msg_ret := format(
E'Join %s items.',
num_items
);
RETURN msg_ret;
END;
$f$ LANGUAGE PLpgSQL;
COMMENT ON FUNCTION ingest.join(text,text,text,text,text,text)
IS 'Join layer and cadlayer.'
;
CREATE TABLE ingest.codec_type (
extension text,
variant text,
descr_mime jsonb,
descr_encode jsonb,
UNIQUE(extension,variant)
);
CREATE FUNCTION ingest.load_codec_type(
p_file text, -- path+filename+ext
p_delimiter text DEFAULT ',',
p_fdwname text DEFAULT 'tmp_codec_type' -- nome da tabela fwd
) RETURNS text AS $f$
DECLARE
q_query text;
BEGIN
SELECT ingest.fdw_generate_direct_csv(p_file,p_fdwname,p_delimiter) INTO q_query;
DELETE FROM ingest.codec_type;
EXECUTE format($$INSERT INTO ingest.codec_type (extension,variant,descr_mime,descr_encode) SELECT lower(extension), variant, jsonb_object(regexp_split_to_array ('mime=' || descr_mime,'(;|=)')), jsonb_object(regexp_split_to_array ( descr_encode,'(;|=)')) FROM %s$$, p_fdwname);
EXECUTE format('DROP FOREIGN TABLE IF EXISTS %s;',p_fdwname);
UPDATE ingest.codec_type
SET descr_encode = jsonb_set(descr_encode, '{delimiter}', to_jsonb(str_urldecode(descr_encode->>'delimiter')), true)
WHERE descr_encode->'delimiter' IS NOT NULL;
RETURN ' '|| E'Load codec_type from: '||p_file|| ' ';
END;
$f$ language PLpgSQL;
COMMENT ON FUNCTION ingest.load_codec_type
IS 'Load codec_type.csv.'
;
|
create temp table prev as
select distinct user_id
from
gha_pull_requests
where
created_at >= date '{{from}}' - '3 months'::interval
and created_at < '{{from}}'
;
create temp table prev_cnt as
select user_id, count(distinct id) as cnt
from
gha_pull_requests
where
created_at < '{{from}}'
group by
user_id
;
select
'episodic_contributors;All;contributors,prs' as name,
round(count(distinct pr.user_id) / {{n}}, 2) as contributors,
round(count(distinct pr.id) / {{n}}, 2) as prs
from
gha_pull_requests pr
left join
prev_cnt pc
on
pc.user_id = pr.user_id
where
pr.created_at >= '{{from}}'
and pr.created_at < '{{to}}'
and pr.user_id not in (select user_id from prev)
and (pc.user_id is null or pc.cnt <= 12)
union select sub.name,
round(count(distinct sub.user_id) / {{n}}, 2) as contributors,
round(count(distinct sub.id) / {{n}}, 2) as prs
from (
select 'episodic_contributors;' || coalesce(ecf.repo_group, r.repo_group) || ';contributors,prs' as name,
pr.user_id,
pr.id
from
gha_repos r,
gha_pull_requests pr
left join
gha_events_commits_files ecf
on
ecf.event_id = pr.event_id
left join
prev_cnt pc
on
pc.user_id = pr.user_id
where
pr.dup_repo_id = r.id
and pr.created_at >= '{{from}}'
and pr.created_at < '{{to}}'
and pr.user_id not in (select user_id from prev)
and (pc.user_id is null or pc.cnt <= 12)
) sub
where
sub.name is not null
group by
sub.name
order by
prs desc,
name asc
;
drop table prev_cnt;
drop table prev;
|
{{
config(
sort='inferred_user_id',
dist='inferred_user_id',
unique_key='inferred_user_id'
)
}}
{% set timezone = var('snowplow:timezone', 'UTC') %}
with initiate_checkout as (
select * from {{ var('snowplow:initiate_checkout') }}
),
event_to_user_map as (
select * from {{ ref('snowplow_event_to_user_map') }}
),
web_page_context as (
select event_id, page_view_id from {{ ref('snowplow_web_page_context') }}
),
web_events_time as (
select * from {{ ref('snowplow_web_events_time') }}
),
web_events_scroll_depth as (
select * from {{ ref('snowplow_web_events_scroll_depth') }}
),
initiate_checkout_with_user_id as (
select
m.inferred_user_id,
count(e.*) as initiate_checkout_count,
SUM(t.pv_count) AS initiate_checkout_pv_count,
SUM(t.pp_count) AS initiate_checkout_pp_count,
SUM(t.time_engaged_in_s) AS initiate_checkout_time_engaged_in_s,
{{convert_timezone("'UTC'", "'" ~ timezone ~ "'", 'MIN(t.min_tstamp)')}} as initiate_checkout_first_time,
MAX(d.vmax) AS initiate_checkout_vertical_pixels_scrolled,
MAX(d.br_viewheight) AS initiate_checkout_viewport_length,
round(initiate_checkout_vertical_pixels_scrolled / NULLIF(initiate_checkout_viewport_length, 0), 2) + 1 AS initiate_checkout_viewports_consumed,
MAX(d.doc_height) AS initiate_checkout_page_height
from event_to_user_map as m
inner join initiate_checkout as e on m.event_id = e.event_id
left join web_page_context as c on e.event_id = c.event_id
left join web_events_time as t on c.page_view_id = t.page_view_id
left join web_events_scroll_depth as d on c.page_view_id = d.page_view_id
group by
m.inferred_user_id
)
select * from initiate_checkout_with_user_id
|
-------------------------------------------------------------------------------
-- sendsms config
-------------------------------------------------------------------------------
CREATE TABLE SENDSMS_CONFIG(
ID BIGINT,
NAME VARCHAR(50),
HOST VARCHAR(200),
USERNAME VARCHAR(200),
PASSWORD VARCHAR(200),
APP_ID VARCHAR(50),
DESCRIPTION VARCHAR(200),
MOBILE_FIELD_NAME VARCHAR(50),
MESSAGE_FIELD_NAME VARCHAR(50),
TENANT_ID VARCHAR(50),
CONSTRAINT PK_SENDSMS_CONFIG PRIMARY KEY(ID)
);
|
-- This script represents the latest schema.
create table currency (
currency_id smallint auto_increment not null,
currency_name varchar(50),
rounding_amount decimal(6,3),
currency_code varchar(3),
primary key(currency_id)
)
engine=innodb character set utf8;
create table lookup_entity (
entity_id smallint auto_increment not null,
entity_name varchar(100) not null,
-- Is this used for anything? It seems like it should just be removed.
description varchar(200),
primary key(entity_id)
)
engine=innodb character set utf8;
create index lookup_entityname_idx on lookup_entity (entity_name);
create table country (
country_id smallint not null,
country_name varchar(100),
country_short_name varchar(10),
primary key(country_id)
)
engine=innodb character set utf8;
-- TODO: drop this table and move data to "coa" table
create table gl_code (
glcode_id smallint auto_increment not null,
glcode_value varchar(50) not null,
primary key(glcode_id)
)
engine=innodb character set utf8;
-- enforce uniqueness for GLCODE_VALUE
create unique index glcode_value_idx on gl_code (glcode_value);
create table lookup_value (
lookup_id integer auto_increment not null,
entity_id smallint,
lookup_name varchar(100),
primary key(lookup_id),
foreign key(entity_id)
references lookup_entity(entity_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index lookup_value_idx on lookup_value (entity_id);
create unique index lookup_name_idx on lookup_value (lookup_name);
create table activity (
activity_id smallint auto_increment not null,
parent_id smallint,
activity_name_lookup_id integer not null,
description_lookup_id integer not null,
primary key(activity_id),
foreign key(parent_id)
references activity (activity_id)
on delete no action
on update no action,
foreign key(activity_name_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(description_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table recurrence_type (
recurrence_id smallint auto_increment not null,
recurrence_name varchar(50),
description varchar(200) not null,
primary key(recurrence_id)
)
engine=innodb character set utf8;
create table meeting_type (
meeting_type_id smallint auto_increment not null,
meeting_purpose varchar(50),
description varchar(200) not null,
primary key(meeting_type_id)
)
engine=innodb character set utf8;
create table language (
lang_id smallint not null,
lang_name varchar(100),
lang_short_name varchar(10),
lookup_id integer not null,
primary key(lang_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table fee_type (
fee_type_id smallint not null,
fee_lookup_id smallint,
flat_or_rate smallint,
formula varchar(100),
primary key(fee_type_id),
foreign key(fee_lookup_id)
references lookup_entity(entity_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table freq_of_deposits (
freq_of_deposits_id smallint auto_increment not null,
lookup_id integer not null,
primary key(freq_of_deposits_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table fee_payment (
fee_payment_id smallint auto_increment not null,
fee_payment_lookup_id integer,
primary key (fee_payment_id),
foreign key (fee_payment_lookup_id)
references lookup_value (lookup_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table fund_code (
fundcode_id smallint auto_increment not null,
fundcode_value varchar(50) not null,
primary key(fundcode_id)
)
engine=innodb character set utf8;
create table fund (
fund_id smallint auto_increment not null,
fund_name varchar(100),
version_no integer,
fundcode_id smallint not null,
primary key(fund_id),
foreign key(fundcode_id)
references fund_code(fundcode_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table interest_calculation_types (
interest_calculation_type_id smallint auto_increment not null,
interest_calculation_lookup_id integer not null,
description varchar(100),
primary key(interest_calculation_type_id),
foreign key(interest_calculation_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table grace_period_type (
grace_period_type_id smallint auto_increment not null,
lookup_id integer not null,
primary key(grace_period_type_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_type (
prd_type_id smallint auto_increment not null,
prd_type_lookup_id integer not null,
lateness_days smallint,
dormancy_days smallint,
version_no integer,
primary key(prd_type_id),
foreign key(prd_type_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_type (
account_type_id smallint auto_increment not null,
lookup_id integer not null,
description varchar(50),
primary key(account_type_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table recommended_amnt_unit (
recommended_amnt_unit_id smallint auto_increment not null,
lookup_id integer not null,
primary key(recommended_amnt_unit_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_category_status (
prd_category_status_id smallint auto_increment not null,
lookup_id integer not null,
primary key(prd_category_status_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_state (
prd_state_id smallint auto_increment not null,
prd_state_lookup_id integer,
primary key(prd_state_id),
foreign key(prd_state_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_action (
account_action_id smallint not null,
lookup_id integer not null,
primary key(account_action_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table yes_no_master (
yes_no_master_id smallint auto_increment not null,
lookup_id integer not null,
primary key(yes_no_master_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table savings_type (
savings_type_id smallint auto_increment not null,
lookup_id integer not null,
primary key(savings_type_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel_level (
level_id smallint not null,
level_name_id integer not null,
parent_level_id smallint,
interaction_flag smallint,
primary key(level_id),
foreign key(parent_level_id)
references personnel_level(level_id)
on delete no action
on update no action,
foreign key(level_name_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office_level (
level_id smallint not null,
parent_level_id smallint,
level_name_id smallint,
interaction_flag smallint,
configured smallint not null,
version_no integer,
primary key(level_id),
foreign key(parent_level_id)
references office_level(level_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table payment_type (
payment_type_id smallint auto_increment not null,
payment_type_lookup_id integer,
primary key(payment_type_id),
foreign key(payment_type_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_applicable_master (
prd_applicable_master_id smallint auto_increment not null,
lookup_id integer not null,
primary key(prd_applicable_master_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_category (
prd_category_id smallint auto_increment not null,
prd_type_id smallint not null,
global_prd_offering_num varchar(50) not null,
prd_category_name varchar(100) not null,
created_date date,
created_by integer,
office_id smallint,
updated_by integer,
udpated_date date,
state smallint not null,
description varchar(500),
version_no integer,
primary key(prd_category_id),
foreign key(prd_type_id)
references prd_type(prd_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table position (
position_id integer auto_increment not null,
lookup_id integer not null,
primary key(position_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table category_type (
category_id smallint not null,
category_lookup_id integer not null,
primary key(category_id),
foreign key(category_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_level (
level_id smallint not null,
parent_level_id smallint,
level_name_id smallint not null,
interaction_flag smallint,
max_child_count smallint not null,
max_instance_count smallint not null,
primary key(level_id),
foreign key(parent_level_id)
references customer_level(level_id)
on delete no action
on update no action,
foreign key(level_name_id)
references lookup_entity(entity_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_state (
account_state_id smallint auto_increment not null,
lookup_id integer not null,
prd_type_id smallint not null,
currently_in_use smallint not null,
status_description varchar(200),
primary key(account_state_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_status (
offering_status_id smallint auto_increment not null,
prd_state_id smallint not null,
prd_type_id smallint not null,
currently_in_use smallint not null,
version_no integer not null,
primary key(offering_status_id),
foreign key(prd_type_id)
references prd_type(prd_type_id)
on delete no action
on update no action,
foreign key(prd_state_id)
references prd_state(prd_state_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table interest_types (
interest_type_id smallint auto_increment not null,
lookup_id integer not null,
category_id smallint not null,
descripton varchar(50),
primary key(interest_type_id),
foreign key(category_id)
references prd_type(prd_type_id)
on delete no action
on update no action,
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_state (
status_id smallint auto_increment not null,
status_lookup_id integer not null,
level_id smallint not null,
description varchar(200),
currently_in_use smallint not null,
primary key(status_id),
foreign key(level_id)
references customer_level(level_id)
on delete no action
on update no action,
foreign key(status_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table supported_locale (
locale_id smallint not null,
country_id smallint,
lang_id smallint,
locale_name varchar(50),
default_locale smallint,
primary key(locale_id),
foreign key(country_id)
references country(country_id)
on delete no action
on update no action,
foreign key(lang_id)
references language(lang_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table fee_payments_categories_type (
fee_payments_category_type_id smallint not null,
fee_payment_id smallint,
category_id smallint,
fee_type_id smallint,
primary key(fee_payments_category_type_id),
foreign key(category_id)
references category_type(category_id)
on delete no action
on update no action,
foreign key(fee_payment_id)
references fee_payment(fee_payment_id)
on delete no action
on update no action,
foreign key(fee_type_id)
references fee_type(fee_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table interest_calc_rule (
interest_calc_rule_id smallint auto_increment not null,
lookup_id integer not null,
primary key(interest_calc_rule_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office_status(
status_id smallint auto_increment not null,
lookup_id int not null,
primary key (status_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office_code(
code_id smallint auto_increment not null,
lookup_id int not null,
primary key (code_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office (
office_id smallint auto_increment not null,
global_office_num varchar(100) not null,
office_level_id smallint not null,
search_id varchar(100) not null,
max_child_count integer not null,
local_remote_flag smallint not null,
display_name varchar(200) not null,
created_by smallint,
created_date date,
updated_by smallint,
updated_date date,
office_short_name varchar(4) not null,
parent_office_id smallint default null,
status_id smallint not null,
version_no integer not null,
office_code_id smallint default null,
primary key(office_id),
unique(global_office_num),
foreign key(office_level_id)
references office_level(level_id)
on delete no action
on update no action,
foreign key(parent_office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(status_id)
references office_status(status_id)
on delete no action
on update no action,
foreign key(office_code_id)
references office_code(code_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create unique index office_global_idx on office (global_office_num);
create table office_address (
office_address_id smallint auto_increment not null,
office_id smallint not null,
address_1 varchar(200) default null,
address_2 varchar(200) default null,
address_3 varchar(200) default null,
city varchar(100) default null,
state varchar(100) default null,
country varchar(100) default null,
zip varchar(20) default null,
telephone varchar(20) default null,
primary key (office_address_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office_custom_field (
office_custom_field_id integer auto_increment not null,
office_id smallint not null,
field_id smallint not null,
field_value varchar(200) default null,
primary key(office_custom_field_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table mfi_attribute (
attribute_id smallint not null,
office_id smallint not null,
attribute_name varchar(100) not null,
attribute_value varchar(200) not null,
primary key(attribute_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table repayment_rule (
repayment_rule_id smallint auto_increment not null,
repayment_rule_lookup_id integer,
primary key(repayment_rule_id),
foreign key(repayment_rule_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table holiday (
holiday_from_date date not null,
holiday_thru_date date,
holiday_name varchar(100),
repayment_rule_id smallint not null,
holiday_changes_applied_flag smallint default 1,
holiday_id int auto_increment not null,
primary key(holiday_id),
constraint holiday_ibfk_2
foreign key (repayment_rule_id)
references repayment_rule(repayment_rule_id)
on delete no action
on update no action,
key repayment_rule_id(repayment_rule_id)
)
engine=innodb character set utf8;
create table office_holiday (
office_id smallint,
holiday_id int,
primary key(office_id, holiday_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(holiday_id)
references holiday(holiday_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table branch_ho_update (
office_id smallint not null,
last_updated_date date,
primary key(office_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table lookup_value_locale (
lookup_value_id integer auto_increment not null,
locale_id smallint not null,
lookup_id integer not null,
lookup_value varchar(300),
primary key(lookup_value_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(locale_id)
references supported_locale(locale_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table lookup_label (
label_id integer auto_increment not null,
entity_id smallint,
locale_id smallint,
entity_name varchar(200),
primary key(label_id),
foreign key(entity_id)
references lookup_entity(entity_id)
on delete no action
on update no action,
foreign key(locale_id)
references supported_locale(locale_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_state_flag (
flag_id smallint not null,
flag_lookup_id integer not null,
status_id smallint not null,
flag_description varchar(200) not null,
isblacklisted smallint,
primary key(flag_id),
foreign key(status_id)
references customer_state(status_id)
on delete no action
on update no action,
foreign key(flag_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table program (
program_id integer auto_increment not null,
office_id smallint not null,
lookup_id integer not null,
glcode_id smallint,
program_name varchar(100),
start_date date not null,
end_date date,
confidentiality smallint,
primary key(program_id),
foreign key(glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel (
personnel_id smallint auto_increment not null,
level_id smallint not null,
global_personnel_num varchar(100),
office_id smallint,
title integer,
personnel_status smallint,
preferred_locale smallint,
search_id varchar(100),
max_child_count integer,
password blob(250),
login_name varchar(200),
email_id varchar(255),
password_changed smallint not null,
display_name varchar(200),
created_by smallint not null,
created_date date,
updated_by smallint,
updated_date date,
last_login date,
locked smallint not null,
no_of_tries smallint not null,
version_no integer not null,
primary key(personnel_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(level_id)
references personnel_level(level_id)
on delete no action
on update no action,
foreign key(preferred_locale)
references supported_locale(locale_id)
on delete no action
on update no action,
foreign key(title)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create unique index personnel_global_idx on personnel (global_personnel_num);
create unique index personnel_search_idx on personnel (search_id);
create index personnel_office_idx on personnel (office_id);
create unique index personnel_login_idx on personnel (login_name);
-- Seems not to be used by anything
create table fee_update_type (
fee_update_type_id smallint auto_increment not null ,
lookup_id integer not null,
primary key (fee_update_type_id),
foreign key (lookup_id) references lookup_value(lookup_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table fee_formula_master (
formulaid smallint auto_increment not null,
forumla_lookup_id integer not null ,
primary key (formulaid),
foreign key (forumla_lookup_id) references lookup_value(lookup_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table fee_status (
status_id smallint auto_increment not null,
status_lookup_id integer not null ,
primary key (status_id),
foreign key (status_lookup_id)
references lookup_value (lookup_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table fees (
fee_id smallint auto_increment not null,
global_fee_num varchar(50),
fee_name varchar(50) not null,
fee_payments_category_type_id smallint,
office_id smallint not null,
glcode_id smallint not null,
status smallint not null,
category_id smallint not null,
rate_or_amount decimal(16,5),
rate_or_amount_currency_id smallint,
rate_flat_falg smallint,
created_date date not null,
created_by smallint not null,
updated_date date,
updated_by smallint,
update_flag smallint,
formula_id smallint,
default_admin_fee varchar(10),
fee_amount decimal(21,4) ,
fee_amount_currency_id smallint,
rate decimal(16,5),
version_no integer not null,
discriminator varchar(20),
primary key (fee_id),
foreign key (glcode_id)
references gl_code (glcode_id)
on delete no action
on update no action,
foreign key (category_id)
references category_type (category_id)
on delete no action
on update no action,
foreign key (status)
references fee_status (status_id)
on delete no action
on update no action,
foreign key (office_id)
references office (office_id)
on delete no action
on update no action,
foreign key (created_by)
references personnel (personnel_id)
on delete no action
on update no action,
foreign key (updated_by)
references personnel (personnel_id)
on delete no action
on update no action,
foreign key (formula_id)
references fee_formula_master (formulaid)
on delete no action
on update no action,
foreign key(rate_or_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create unique index fee_global_idx on fees (global_fee_num);
create index fee_pmnt_catg_idx on fees (fee_payments_category_type_id);
create index fee_office_idx on fees (office_id);
create table feelevel (
feelevel_id smallint auto_increment not null,
fee_id smallint not null,
level_id smallint not null,
primary key(feelevel_id),
foreign key(fee_id)
references fees(fee_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table fee_frequency_type (
fee_frequency_id smallint auto_increment not null,
lookup_id integer not null,
primary key (fee_frequency_id),
foreign key (lookup_id) references lookup_value(lookup_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table personnel_hierarchy (
hierarchy_id integer not null,
parent_id smallint not null,
personnel_id smallint,
status smallint,
start_date date,
end_date date not null,
updated_by smallint,
updated_date date,
primary key(hierarchy_id),
foreign key(parent_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index personnel_hierarchy_idx on personnel_hierarchy (personnel_id, status);
create table role (
role_id smallint not null,
role_name varchar(50) not null,
version_no integer not null,
created_by smallint,
created_date date,
updated_by smallint,
updated_date date,
primary key(role_id),
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table penalty (
penalty_id smallint not null,
global_penalty_num varchar(100),
penalty_type varchar(100),
office_id smallint,
category_id smallint,
glcode_id smallint not null,
lookup_id integer,
rate decimal(13, 10) not null,
formula varchar(100),
primary key(penalty_id),
foreign key(category_id)
references category_type(category_id)
on delete no action
on update no action,
foreign key(glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office_action_payment_type (
office_id smallint,
prd_type_id smallint,
account_action_id smallint not null,
payment_type_id smallint,
foreign key(account_action_id)
references account_action(account_action_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(payment_type_id)
references payment_type(payment_type_id)
on delete no action
on update no action,
foreign key(prd_type_id)
references prd_type(prd_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer (
customer_id integer auto_increment not null,
customer_level_id smallint not null,
global_cust_num varchar(100),
loan_officer_id smallint,
customer_formedby_id smallint,
status_id smallint,
branch_id smallint,
display_name varchar(200),
first_name varchar(200),
last_name varchar(200),
second_last_name varchar(200),
display_address varchar(500),
external_id varchar(50),
date_of_birth date,
group_flag smallint,
trained smallint,
trained_date date,
parent_customer_id integer,
created_date date,
updated_date date,
/* We could have a UNIQUE constraint on the combination
of SEARCH_ID and BRANCH_ID if we want (search ID's are
only unique within a branch). */
search_id varchar(100),
max_child_count integer,
ho_updated smallint,
client_confidential smallint,
mfi_joining_date date,
government_id varchar(50),
customer_activation_date date,
created_by smallint,
updated_by smallint,
blacklisted smallint,
discriminator varchar(20),
version_no integer not null,
primary key(customer_id),
foreign key(customer_level_id)
references customer_level(level_id)
on delete no action
on update no action,
foreign key(status_id)
references customer_state(status_id)
on delete no action
on update no action,
foreign key(branch_id)
references office(office_id)
on delete no action
on update no action,
foreign key(loan_officer_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(customer_formedby_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(parent_customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create unique index cust_global_idx on customer (global_cust_num);
create index cust_search_idx on customer (search_id);
create index cust_government_idx on customer (government_id);
create index cust_lo_idx on customer (loan_officer_id, branch_id);
create index customer_lo_name_idx
on customer (loan_officer_id, customer_level_id,display_name(15),
first_name(15),last_name(15),second_last_name(15));
create index customer_name_idx
on customer (customer_level_id,
first_name(15),last_name(15),second_last_name(15));
create index customer_branch_search_idx on customer (branch_id,search_id);
create index customer_dob_status_idx on customer (date_of_birth,status_id);
create table cust_perf_history (
customer_id integer not null,
loan_cycle_counter smallint,
last_loan_amnt decimal(21,4),
active_loans_count smallint,
total_savings_amnt decimal(21,4),
delinquint_portfolio decimal(21,4),
primary key(customer_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_detail (
customer_id integer not null,
ethinicity integer,
citizenship integer,
handicapped integer,
business_activities integer,
marital_status integer,
education_level integer,
num_children smallint,
gender smallint,
date_started date,
handicapped_details varchar(200),
poverty_status integer,
poverty_lhood_pct decimal(21,4),
primary key(customer_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(citizenship)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(education_level)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(ethinicity)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(handicapped)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(marital_status)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(poverty_status)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_offering (
prd_offering_id smallint auto_increment not null,
prd_applicable_master_id smallint not null,
global_prd_offering_num varchar(50) not null,
prd_category_id smallint not null,
prd_type_id smallint,
office_id smallint,
start_date date not null,
end_date date,
glcode_id smallint,
prd_offering_name varchar(50) not null,
prd_offering_short_name varchar(50) not null,
offering_status_id smallint,
description varchar(200),
created_date date not null,
created_by integer not null,
updated_date date,
updated_by integer,
version_no integer,
prd_mix_flag smallint,
currency_id smallint,
primary key(prd_offering_id),
foreign key(glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(prd_category_id)
references prd_category(prd_category_id)
on delete no action
on update no action,
foreign key(offering_status_id)
references prd_status(offering_status_id)
on delete no action
on update no action,
foreign key(prd_type_id)
references prd_type(prd_type_id)
on delete no action
on update no action,
foreign key(prd_applicable_master_id)
references prd_applicable_master(prd_applicable_master_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create unique index prd_offering_global_idx on prd_offering (global_prd_offering_num);
create unique index prd_offering_name_idx on prd_offering (prd_offering_name);
create unique index prd_offering_short_name_idx on prd_offering (prd_offering_short_name);
create index prd_offering_office_idx on prd_offering (office_id);
create index prd_type_idx on prd_offering (prd_type_id);
create table variable_installment_details (
id smallint auto_increment not null,
min_gap_in_days smallint,
max_gap_in_days smallint,
min_loan_amount decimal(21,4),
min_loan_amount_currency_id smallint,
primary key(id)
)
engine=innodb character set utf8;
create table cash_flow_detail (
id smallint auto_increment not null,
cash_flow_threshold decimal(13, 10),
indebtedness_ratio decimal(13, 10),
repayment_capacity decimal(13, 10),
primary key(id)
)
engine=innodb character set utf8;
create table loan_offering (
prd_offering_id smallint not null,
interest_type_id smallint not null,
interest_calc_rule_id smallint,
penalty_id smallint,
min_loan_amount decimal(21,4) default null,
min_loan_amount_currency_id smallint,
max_loan_amnt decimal(21,4) default null,
max_loan_amnt_currency_id smallint,
default_loan_amount decimal(21,4) default null,
default_loan_amount_currency_id smallint,
graceperiod_type_id smallint,
max_interest_rate decimal(13, 10) not null,
min_interest_rate decimal(13, 10) not null,
def_interest_rate decimal(13, 10) not null,
max_no_installments smallint default null,
min_no_installments smallint default null,
def_no_installments smallint default null,
penalty_grace smallint,
loan_counter_flag smallint,
int_ded_disbursement_flag smallint not null,
prin_due_last_inst_flag smallint not null,
penalty_rate decimal(13,10),
grace_period_duration smallint,
principal_glcode_id smallint not null,
interest_glcode_id smallint not null,
penalties_glcode_id smallint,
interest_waiver_flag smallint default 0,
variable_installment_flag smallint default 0,
variable_installment_details_id smallint,
cash_flow_comparison_flag smallint default 0,
cash_flow_detail_id smallint,
primary key(prd_offering_id),
foreign key(principal_glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
foreign key(interest_glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
constraint loan_offering_penalty_glcode foreign key(penalties_glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
foreign key(graceperiod_type_id)
references grace_period_type(grace_period_type_id)
on delete no action
on update no action,
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action,
constraint loan_offering_penalty foreign key(penalty_id)
references penalty(penalty_id)
on delete no action
on update no action,
constraint loan_offering_interest_calc_rule foreign key(interest_calc_rule_id)
references interest_calc_rule(interest_calc_rule_id)
on delete no action
on update no action,
foreign key(interest_type_id)
references interest_types(interest_type_id)
on delete no action
on update no action,
foreign key(min_loan_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(max_loan_amnt_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(default_loan_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(variable_installment_details_id)
references variable_installment_details(id)
on delete no action
on update no action,
foreign key(cash_flow_detail_id)
references cash_flow_detail(id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table savings_offering (
prd_offering_id smallint not null,
interest_calculation_type_id smallint not null,
savings_type_id smallint not null,
recommended_amnt_unit_id smallint,
recommended_amount decimal(21,4),
recommended_amount_currency_id smallint,
interest_rate decimal(13, 10) not null,
max_amnt_withdrawl decimal(21,4),
max_amnt_withdrawl_currency_id smallint,
min_amnt_for_int decimal(21,4),
min_amnt_for_int_currency_id smallint,
deposit_glcode_id smallint not null,
interest_glcode_id smallint not null,
primary key(prd_offering_id),
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action,
foreign key(recommended_amnt_unit_id)
references recommended_amnt_unit(recommended_amnt_unit_id)
on delete no action
on update no action,
foreign key(savings_type_id)
references savings_type(savings_type_id)
on delete no action
on update no action,
foreign key(interest_calculation_type_id)
references interest_calculation_types(interest_calculation_type_id)
on delete no action
on update no action,
foreign key(recommended_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(max_amnt_withdrawl_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(min_amnt_for_int_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(deposit_glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action,
foreign key(interest_glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table product_offering_mandatory_savings (
product_offering_mandatory_savings_id smallint not null,
product_offering_mandatory_savings_type smallint,
prd_offering_id smallint,
product_offering_mandatory_savings_value smallint,
product_offering_mandatory_savings_range smallint,
primary key (product_offering_mandatory_savings_id),
foreign key (prd_offering_id) references prd_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table insurance_offering (
prd_offering_id smallint not null,
primary key(prd_offering_id),
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel_details (
personnel_id smallint not null ,
first_name varchar(100) not null,
middle_name varchar(100),
second_last_name varchar(100),
last_name varchar(100),
government_id_number varchar(50),
dob date not null,
marital_status integer,
gender integer not null,
date_of_joining_mfi date,
date_of_joining_branch date,
date_of_leaving_branch date,
address_1 varchar(200),
address_2 varchar(200),
address_3 varchar(200),
city varchar(100),
state varchar(100),
country varchar(100),
postal_code varchar(100),
telephone varchar(20),
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(gender)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(marital_status)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel_movement (
personnel_movement_id smallint auto_increment not null,
personnel_id smallint,
office_id smallint not null,
status smallint,
start_date date,
end_date date,
updated_by smallint,
updated_date date ,
primary key(personnel_movement_id),
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index personnel_movement_idx on personnel_movement (personnel_id);
create table personnel_notes (
comment_id integer auto_increment not null,
personnel_id smallint not null,
comment_date date not null,
comments varchar(500) not null,
officer_id smallint,
primary key(comment_id),
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(officer_id)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel_status (
personnel_status_id smallint auto_increment not null,
lookup_id integer not null,
primary key(personnel_status_id),
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table entity_master (
entity_type_id smallint auto_increment not null,
entity_type varchar(100) not null,
primary key (entity_type_id)
)engine=innodb character set utf8;
create table custom_field_definition (
field_id smallint auto_increment not null,
entity_id smallint not null,
level_id smallint,
field_type smallint,
entity_type smallint not null,
mandatory_flag smallint not null,
default_value varchar(200),
primary key(field_id),
foreign key(level_id)
references customer_level(level_id)
on delete no action
on update no action,
foreign key(entity_id)
references lookup_entity(entity_id)
on delete no action
on update no action,
foreign key(entity_type)
references entity_master(entity_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table change_log (
change_log_id integer auto_increment not null,
changed_by smallint not null,
modifier_name varchar(50) not null,
entity_id integer default null,
entity_type smallint default null,
changed_date date default null,
fields_changed varchar(250) default null,
primary key (change_log_id),
foreign key(changed_by)
references personnel(personnel_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create index change_log_idx
on change_log (entity_type, entity_id, changed_date);
create table customer_picture (
picture_id integer auto_increment not null,
customer_id integer not null,
picture blob,
primary key(picture_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_historical_data (
historical_id smallint auto_increment not null,
customer_id integer not null,
product_name varchar(100),
loan_amount decimal(21,4),
loan_amount_currency_id smallint,
total_amount_paid decimal(21,4),
total_amount_paid_currency_id smallint,
interest_paid decimal(21,4),
interest_paid_currency_id smallint,
missed_payments_count integer,
total_payments_count integer,
notes varchar(500),
loan_cycle_number integer,
created_by smallint,
updated_by smallint,
created_date date,
updated_date date,
version_no integer,
primary key(historical_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_address_detail (
customer_address_id integer auto_increment not null,
customer_id integer,
locale_id smallint,
address_name varchar(100),
line_1 varchar(200),
line_2 varchar(200),
line_3 varchar(200),
city varchar(100),
state varchar(100),
country varchar(100),
zip varchar(20),
address_status smallint,
phone_number varchar(20),
phone_number_stripped varchar(20),
primary key(customer_address_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(locale_id)
references supported_locale(locale_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index cust_address_idx on customer_address_detail (customer_id);
create index customer_address_detail_phone_number_stripped_idx on customer_address_detail (phone_number_stripped);
create table customer_custom_field (
customer_customfield_id integer auto_increment not null,
customer_id integer not null,
field_id smallint not null,
field_value varchar(200),
primary key(customer_customfield_id),
foreign key(field_id)
references custom_field_definition(field_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table offering_fund (
offering_fund_id smallint not null,
fund_id smallint,
prd_offering_id smallint,
primary key(offering_fund_id),
foreign key(fund_id)
references fund(fund_id)
on delete no action
on update no action,
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_offering_fees (
prd_offering_fee_id smallint auto_increment not null,
fee_id smallint,
prd_offering_id smallint,
primary key(prd_offering_fee_id),
foreign key(fee_id)
references fees(fee_id)
on delete no action
on update no action,
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index prd_offering_fee_idx
on prd_offering_fees (prd_offering_id, fee_id);
create table program_fund (
program_fund_id smallint not null,
fund_id smallint,
program_id integer,
primary key(program_fund_id),
foreign key(fund_id)
references fund(fund_id)
on delete no action
on update no action,
foreign key(program_id)
references program(program_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel_custom_field (
personnel_custom_field_id integer auto_increment not null,
field_id smallint not null,
personnel_id smallint not null,
field_value varchar(100),
primary key(personnel_custom_field_id),
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(field_id)
references custom_field_definition(field_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table roles_activity (
activity_id smallint not null,
role_id smallint not null,
primary key(activity_id, role_id),
foreign key(activity_id)
references activity(activity_id)
on delete no action
on update no action,
foreign key(role_id)
references role(role_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table personnel_role (
personnel_role_id integer auto_increment not null,
role_id smallint not null,
personnel_id smallint not null,
primary key(personnel_role_id),
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(role_id)
references role(role_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table meeting (
meeting_id integer auto_increment not null,
meeting_type_id smallint not null,
meeting_place varchar(200),
start_date date,
end_date date,
start_time date,
end_time date,
version_no integer,
primary key(meeting_id),
foreign key(meeting_type_id)
references meeting_type(meeting_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table fee_frequency (
fee_frequency_id smallint auto_increment not null,
fee_id smallint not null ,
fee_frequencytype_id smallint not null ,
frequency_payment_id smallint,
frequency_meeting_id integer,
primary key (fee_frequency_id),
foreign key (fee_id)
references fees (fee_id)
on delete no action
on update no action,
foreign key (fee_frequencytype_id)
references fee_frequency_type (fee_frequency_id)
on delete no action
on update no action,
foreign key (frequency_payment_id)
references fee_payment (fee_payment_id)
on delete no action
on update no action,
foreign key (frequency_meeting_id)
references meeting (meeting_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table recurrence_detail (
details_id integer auto_increment not null,
meeting_id integer not null,
recurrence_id smallint,
recur_after smallint not null,
version_no integer,
primary key(details_id),
foreign key(recurrence_id)
references recurrence_type(recurrence_id)
on delete no action
on update no action,
foreign key(meeting_id)
references meeting(meeting_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table recur_on_day (
recur_on_day_id integer auto_increment not null,
details_id integer not null,
days smallint,
rank_of_days smallint,
day_number smallint,
version_no integer,
primary key(recur_on_day_id),
foreign key(details_id)
references recurrence_detail(details_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_meeting (
customer_meeting_id integer auto_increment not null,
meeting_id integer not null,
customer_id integer not null,
primary key(customer_meeting_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(meeting_id)
references meeting(meeting_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index customer_meeting_idx on customer_meeting (customer_id);
create table inherited_meeting (
meeting_id integer,
customer_id integer,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(meeting_id)
references customer_meeting(customer_meeting_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_meeting_detail (
meeting_id integer not null,
details_id integer not null,
primary key(meeting_id, details_id),
foreign key(meeting_id)
references customer_meeting(customer_meeting_id)
on delete no action
on update no action,
foreign key(details_id)
references recurrence_detail(details_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_program (
program_id integer not null,
customer_id integer not null,
version_no integer not null,
primary key(program_id, customer_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(program_id)
references program(program_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table loan_offering_fund (
loan_offering_fund_id smallint auto_increment not null,
fund_id smallint not null,
prd_offering_id smallint not null,
primary key(loan_offering_fund_id),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action,
foreign key(fund_id)
references fund(fund_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_note (
comment_id integer auto_increment not null,
customer_id integer not null,
field_officer_id smallint not null,
comment_date date not null,
comment varchar(500) not null,
primary key(comment_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(field_officer_id)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index cust_note_idx on customer_note (customer_id);
create table customer_position (
customer_position_id integer auto_increment not null,
position_id integer not null,
customer_id integer,
parent_customer_id integer,
version_no integer,
primary key(customer_position_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(parent_customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create unique index cust_position_idx
on customer_position (customer_id, position_id);
create table prd_fee_frequency (
prdoffering_fee_id smallint not null,
fee_id smallint,
frequency_id smallint not null,
primary key(prdoffering_fee_id),
foreign key(fee_id)
references fees(fee_id)
on delete no action
on update no action,
foreign key(prdoffering_fee_id)
references prd_offering_fees(prd_offering_fee_id)
on delete no action
on update no action,
foreign key(frequency_id)
references recurrence_type(recurrence_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table office_hierarchy (
hierarchy_id integer auto_increment not null,
parent_id smallint not null,
office_id smallint,
status smallint,
start_date date,
end_date date,
updated_by smallint,
updated_date date,
primary key(hierarchy_id),
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(parent_id)
references office(office_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index office_hierarchy_idx on office_hierarchy (office_id,status);
create table customer_hierarchy (
hierarchy_id integer auto_increment not null,
parent_id integer not null,
customer_id integer,
status smallint,
start_date date,
end_date date,
updated_by smallint,
updated_date date,
primary key(hierarchy_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(parent_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index cust_hierarchy_idx on customer_hierarchy (customer_id, status);
create table customer_flag_detail (
customer_flag_id integer auto_increment not null,
customer_id integer not null,
flag_id smallint not null,
created_by smallint,
created_date date,
version_no integer,
primary key(customer_flag_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(flag_id)
references customer_state_flag(flag_id)
on delete no action
on update no action,
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_name_detail (
customer_name_id integer auto_increment not null,
customer_id integer,
name_type smallint,
locale_id smallint,
salutation integer,
first_name varchar(100) not null,
middle_name varchar(100),
last_name varchar(100) not null,
second_last_name varchar(100),
second_middle_name varchar(100),
display_name varchar(200),
primary key(customer_name_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(salutation)
references lookup_value(lookup_id)
on delete no action
on update no action,
foreign key(locale_id)
references supported_locale(locale_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index cust_name_idx on customer_name_detail (customer_id);
create table customer_family_detail (
customer_family_id integer auto_increment not null,
customer_id integer,
customer_name_id integer,
relationship smallint,
gender smallint,
date_of_birth date,
living_status smallint,
primary key (customer_family_id),
foreign key (customer_id) references customer(customer_id) on delete no action on update no action,
foreign key (customer_name_id) references customer_name_detail(customer_name_id) on delete no action on update no action
)engine=innodb character set utf8;
create table checklist (
checklist_id smallint auto_increment not null,
checklist_name varchar(100),
checklist_status smallint default 1 not null,
locale_id smallint not null,
created_by smallint,
created_date date,
updated_by smallint,
updated_date date,
primary key(checklist_id),
foreign key(locale_id)
references supported_locale(locale_id)
on delete no action
on update no action,
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account (
account_id integer auto_increment not null,
global_account_num varchar(100),
customer_id integer,
account_state_id smallint,
account_type_id smallint not null,
office_id smallint,
personnel_id smallint,
created_by smallint not null,
created_date date not null,
updated_by smallint,
updated_date date,
closed_date date,
version_no integer,
offsetting_allowable smallint not null,
external_id varchar(100),
primary key(account_id),
foreign key(account_state_id)
references account_state(account_state_id)
on delete no action
on update no action,
foreign key(account_type_id)
references account_type(account_type_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create unique index account_global_idx on account (global_account_num);
create index customer_id_account_idx on account (customer_id);
create table account_activity (
activity_id integer auto_increment not null,
account_id integer not null,
personnel_id smallint not null,
activity_name varchar(50) not null,
principal decimal(21,4),
principal_currency_id smallint,
principal_outstanding decimal(21,4),
principal_outstanding_currency_id smallint,
interest decimal(13, 10),
interest_currency_id smallint,
interest_outstanding decimal(13, 10),
interest_outstanding_currency_id smallint,
fee decimal(13, 2),
fee_currency_id smallint,
fee_outstanding decimal(13, 2),
fee_outstanding_currency_id smallint,
penalty decimal(13, 10),
penalty_currency_id smallint,
penalty_outstanding decimal(13, 10),
penalty_outstanding_currency_id smallint,
primary key(activity_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_outstanding_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_outstanding_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_outstanding_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_outstanding_currency_id)
references currency(currency_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table account_notes (
account_notes_id integer auto_increment not null,
account_id integer not null,
note varchar(500) not null,
comment_date date not null,
officer_id smallint not null,
primary key(account_notes_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(officer_id)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_movement (
customer_movement_id integer auto_increment not null,
customer_id integer,
personnel_id smallint,
office_id smallint not null,
status smallint,
start_date date,
end_date date,
updated_by smallint,
updated_date date,
primary key(customer_movement_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(personnel_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(updated_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index cust_movement_idx on customer_movement (customer_id, status);
create table loan_account (
account_id integer not null,
business_activities_id integer,
collateral_type_id integer,
grace_period_type_id smallint not null,
group_flag smallint,
loan_amount decimal(21,4),
loan_amount_currency_id smallint,
loan_balance decimal(21,4),
loan_balance_currency_id smallint,
interest_type_id smallint,
interest_rate decimal(13, 10),
fund_id smallint,
meeting_id integer,
currency_id smallint,
no_of_installments smallint not null,
disbursement_date date,
collateral_note varchar(500),
grace_period_duration smallint,
interest_at_disb smallint,
grace_period_penalty smallint,
prd_offering_id smallint,
redone smallint not null,
parent_account_id integer,
month_rank smallint,
month_week smallint,
recur_month smallint,
primary key(account_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(loan_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(loan_balance_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fund_id)
references fund(fund_id)
on delete no action
on update no action,
foreign key(grace_period_type_id)
references grace_period_type(grace_period_type_id)
on delete no action
on update no action,
foreign key(interest_type_id)
references interest_types(interest_type_id)
on delete no action
on update no action,
foreign key(meeting_id)
references meeting(meeting_id)
on delete no action
on update no action,
constraint fk_loan_col_type_id foreign key(collateral_type_id)
references lookup_value(lookup_id)
on delete no action
on update no action,
constraint fk_loan_bus_act_id foreign key(business_activities_id)
references lookup_value(lookup_id)
on delete no action
on update no action,
constraint fk_loan_prd_off_id foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action,
constraint fk_loan_acc_id foreign key(parent_account_id)
references account(account_id)
on delete no action
on update no action,
constraint fk_loan_account foreign key(parent_account_id)
references loan_account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table loan_activity_details (
id integer auto_increment not null,
created_by smallint not null,
account_id integer not null,
created_date timestamp not null,
comments varchar(100) not null,
principal_amount decimal(21,4),
principal_amount_currency_id smallint,
interest_amount decimal(21,4),
interest_amount_currency_id smallint,
penalty_amount decimal(21,4),
penalty_amount_currency_id smallint,
fee_amount decimal(21,4),
fee_amount_currency_id smallint,
balance_principal_amount decimal(21,4),
balance_principal_amount_currency_id smallint,
balance_interest_amount decimal(21,4),
balance_interest_amount_currency_id smallint,
balance_penalty_amount decimal(21,4),
balance_penalty_amount_currency_id smallint,
balance_fee_amount decimal(21,4),
balance_fee_amount_currency_id smallint,
primary key(id),
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(principal_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_principal_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_interest_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_penalty_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table waive_off_history(
waive_off_id integer auto_increment not null,
account_id integer not null,
waive_off_date date not null,
waive_off_type varchar(20) not null,
primary key (waive_off_id),
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table loan_summary(
account_id integer not null,
orig_principal decimal(21,4),
orig_principal_currency_id smallint,
orig_interest decimal(21,4),
orig_interest_currency_id smallint,
orig_fees decimal(21,4),
orig_fees_currency_id smallint,
orig_penalty decimal(21,4),
orig_penalty_currency_id smallint,
principal_paid decimal(21,4),
principal_paid_currency_id smallint,
interest_paid decimal(21,4),
interest_paid_currency_id smallint,
fees_paid decimal(21,4),
fees_paid_currency_id smallint,
penalty_paid decimal(21,4),
penalty_paid_currency_id smallint,
raw_amount_total decimal(21,4),
raw_amount_total_currency_id smallint,
primary key(account_id),
foreign key(orig_principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(orig_interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(orig_fees_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(orig_penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fees_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action,
constraint fk_loan_summary_raw_amount_total
foreign key(raw_amount_total_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table change_log_detail (
sequence_num integer auto_increment not null,
change_log_id integer not null ,
field_name varchar(100) default null,
old_value varchar(200) ,
new_value varchar(200) ,
primary key (sequence_num),
foreign key(change_log_id)
references change_log(change_log_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table customer_account (
account_id integer not null,
primary key(account_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_account_activity (
customer_account_activity_id integer auto_increment not null,
account_id integer not null,
description varchar(200) not null,
amount decimal(21,4),
fee_amount_currency_id smallint,
created_date date not null,
created_by smallint,
primary key(customer_account_activity_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table attendance (
meeting_id integer not null,
meeting_date date not null,
attendance smallint,
notes varchar(200) not null,
primary key(meeting_id, meeting_date),
foreign key(meeting_id)
references customer_meeting(customer_meeting_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table checklist_detail (
detail_id integer auto_increment not null,
checklist_id smallint,
locale_id smallint,
detail_text varchar(250),
answer_type smallint not null,
primary key(detail_id),
foreign key(checklist_id)
references checklist(checklist_id)
on delete no action
on update no action,
foreign key(locale_id)
references supported_locale(locale_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index chk_detail_idx on checklist_detail (checklist_id,locale_id);
create table loan_penalty (
loan_penalty_id integer auto_increment not null,
account_id integer,
penalty_id smallint not null,
start_date date,
end_date date,
penalty_type varchar(200),
penalty_rate decimal(13,10),
primary key(loan_penalty_id),
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action,
foreign key(penalty_id)
references penalty(penalty_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_checklist (
checklist_id smallint not null,
prd_type_id smallint,
account_status smallint not null,
primary key (checklist_id),
foreign key(account_status)
references account_state(account_state_id)
on delete no action
on update no action,
foreign key(checklist_id)
references checklist(checklist_id)
on delete no action
on update no action,
foreign key(prd_type_id)
references prd_type(prd_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_payment (
payment_id integer auto_increment not null,
account_id integer not null,
payment_type_id smallint not null,
currency_id smallint,
amount decimal(21,4) not null,
receipt_number varchar(60),
voucher_number varchar(50),
check_number varchar(50),
payment_date date not null,
receipt_date date,
bank_name varchar(50),
comment varchar(80),
primary key(payment_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(payment_type_id)
references payment_type(payment_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index account_id_account_payment_idx on account_payment (account_id);
create table customer_schedule (
id integer auto_increment not null,
account_id integer not null,
customer_id integer not null,
currency_id smallint,
action_date date,
misc_fees decimal(21,4),
misc_fees_currency_id smallint,
misc_fees_paid decimal(21,4),
misc_fees_paid_currency_id smallint,
misc_penalty decimal(21,4),
misc_penalty_currency_id smallint,
misc_penalty_paid decimal(21,4),
misc_penalty_paid_currency_id smallint,
payment_status smallint not null,
installment_id smallint not null,
payment_date date,
parent_flag smallint,
version_no integer not null,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index customer_schedule_action_date_idx
on customer_schedule (customer_id,action_date,payment_status);
create table loan_schedule (
id integer auto_increment not null,
account_id integer not null,
customer_id integer not null,
currency_id smallint,
action_date date,
principal decimal(21,4) not null,
principal_currency_id smallint,
interest decimal(21,4) not null,
interest_currency_id smallint,
penalty decimal(21,4) not null,
penalty_currency_id smallint,
misc_fees decimal(21,4),
misc_fees_currency_id smallint,
misc_fees_paid decimal(21,4),
misc_fees_paid_currency_id smallint,
misc_penalty decimal(21,4),
misc_penalty_currency_id smallint,
misc_penalty_paid decimal(21,4),
misc_penalty_paid_currency_id smallint,
principal_paid decimal(21,4),
principal_paid_currency_id smallint,
interest_paid decimal(21,4),
interest_paid_currency_id smallint,
penalty_paid decimal(21,4),
penalty_paid_currency_id smallint,
payment_status smallint not null,
installment_id smallint not null,
payment_date date,
parent_flag smallint,
version_no integer not null,
extra_interest decimal(21,4),
extra_interest_currency_id smallint,
extra_interest_paid decimal(21,4),
extra_interest_paid_currency_id smallint,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_fees_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_fees_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_penalty_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(extra_interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(extra_interest_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table saving_schedule (
id integer auto_increment not null,
account_id integer not null,
customer_id integer not null,
currency_id smallint,
action_date date,
deposit decimal(21,4) not null,
deposit_currency_id smallint,
deposit_paid decimal(21,4),
deposit_paid_currency_id smallint,
payment_status smallint not null,
installment_id smallint not null,
payment_date date,
parent_flag smallint,
version_no integer not null,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(deposit_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(deposit_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_checklist (
checklist_id smallint not null,
level_id smallint not null,
customer_status_id smallint not null,
primary key (checklist_id),
foreign key(checklist_id)
references checklist(checklist_id)
on delete no action
on update no action,
foreign key(level_id)
references customer_level(level_id)
on delete no action
on update no action,
foreign key(customer_status_id)
references customer_state(status_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_fees (
account_fee_id integer auto_increment not null,
account_id integer not null,
fee_id smallint not null,
fee_frequency integer,
status smallint,
inherited_flag smallint,
start_date date,
end_date date,
account_fee_amnt decimal(21,4) not null,
account_fee_amnt_currency_id smallint,
fee_amnt decimal(21,4) not null,
fee_status smallint,
status_change_date date,
version_no integer not null,
last_applied_date date,
primary key(account_fee_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(fee_id)
references fees(fee_id)
on delete no action
on update no action,
foreign key(account_fee_amnt_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_frequency)
references recurrence_detail(details_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index account_fees_id_idx on account_fees (account_id,fee_id);
create table savings_account (
account_id integer not null,
activation_date date,
savings_balance decimal(21,4),
savings_balance_currency_id smallint,
recommended_amount decimal(21,4),
recommended_amount_currency_id smallint,
recommended_amnt_unit_id smallint,
savings_type_id smallint not null,
int_to_be_posted decimal(21,4),
int_to_be_posted_currency_id smallint,
last_int_calc_date date,
last_int_post_date date,
next_int_calc_date date,
next_int_post_date date,
inter_int_calc_date date,
prd_offering_id smallint not null,
interest_rate decimal(13, 10) not null,
interest_calculation_type_id smallint not null,
time_per_for_int_calc integer,
min_amnt_for_int decimal(21,4),
min_amnt_for_int_currency_id smallint,
primary key(account_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(savings_balance_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(recommended_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(int_to_be_posted_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(recommended_amnt_unit_id)
references recommended_amnt_unit(recommended_amnt_unit_id)
on delete no action
on update no action,
foreign key(savings_type_id)
references savings_type(savings_type_id)
on delete no action
on update no action,
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action,
foreign key(interest_calculation_type_id)
references interest_calculation_types(interest_calculation_type_id)
on delete no action
on update no action,
foreign key(time_per_for_int_calc)
references meeting (meeting_id)
on delete no action
on update no action,
foreign key(min_amnt_for_int_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table savings_activity_details (
id integer auto_increment not null,
created_by smallint,
account_id integer not null,
created_date timestamp not null,
account_action_id smallint not null,
amount decimal(21,4) not null,
amount_currency_id smallint not null,
balance_amount decimal(21,4) not null,
balance_amount_currency_id smallint not null,
primary key(id),
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(account_action_id)
references account_action(account_action_id)
on delete no action
on update no action,
foreign key(amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table savings_performance(
id integer auto_increment not null,
account_id integer not null,
total_deposits decimal(21,4),
total_deposits_currency_id smallint,
total_withdrawals decimal(21,4),
total_withdrawals_currency_id smallint,
total_interest_earned decimal(21,4),
total_interest_earned_currency_id smallint,
missed_deposits smallint,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(total_deposits_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(total_withdrawals_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(total_interest_earned_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_custom_field (
account_custom_field_id integer auto_increment not null,
account_id integer not null,
field_id smallint not null,
field_value varchar(200),
primary key(account_custom_field_id),
foreign key(field_id)
references custom_field_definition(field_id)
on delete no action
on update no action,
foreign key(account_id)
references account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_trxn (
account_trxn_id integer auto_increment not null,
account_id integer not null,
payment_id integer not null,
personnel_id integer,
account_action_id smallint not null,
currency_id smallint,
amount_currency_id smallint,
amount decimal(21,4) not null,
due_date date,
comments varchar(200),
action_date date not null,
created_date timestamp not null,
customer_id integer,
installment_id smallint,
related_trxn_id integer,
primary key(account_trxn_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(account_action_id)
references account_action(account_action_id)
on delete no action
on update no action,
foreign key(payment_id)
references account_payment(payment_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index account_id_account_trxn_idx on account_trxn (account_id);
create table fee_trxn_detail (
fee_trxn_detail_id integer auto_increment not null,
account_trxn_id integer not null,
account_fee_id integer,
fee_amount_currency_id smallint,
fee_amount decimal(21,4) not null,
primary key(fee_trxn_detail_id),
foreign key(account_fee_id)
references account_fees(account_fee_id)
on delete no action
on update no action,
foreign key(fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(account_trxn_id)
references account_trxn(account_trxn_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index fee_account_trxn_idx on fee_trxn_detail (account_trxn_id);
create table loan_fee_schedule (
account_fees_detail_id integer auto_increment not null,
id integer not null,
installment_id integer not null,
fee_id smallint not null,
account_fee_id integer not null,
amount decimal(21,4),
amount_currency_id smallint,
amount_paid decimal(21,4) not null,
amount_paid_currency_id smallint not null,
version_no integer not null,
primary key(account_fees_detail_id),
foreign key(id)
references loan_schedule(id)
on delete no action
on update no action,
foreign key(amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(amount_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_id)
references fees(fee_id),
foreign key(account_fee_id)
references account_fees(account_fee_id)
)
engine=innodb character set utf8;
create table customer_fee_schedule (
account_fees_detail_id integer auto_increment not null,
id integer not null,
installment_id integer not null,
fee_id smallint not null,
account_fee_id integer not null,
amount decimal(21,4),
amount_currency_id smallint,
amount_paid decimal(21,4),
amount_paid_currency_id smallint,
version_no integer not null,
primary key(account_fees_detail_id ),
foreign key(id)
references customer_schedule(id)
on delete no action
on update no action,
foreign key(amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(amount_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_id)
references fees(fee_id),
foreign key(account_fee_id)
references account_fees(account_fee_id)
)
engine=innodb character set utf8;
create table savings_trxn_detail (
account_trxn_id integer not null,
deposit_amount decimal(21,4) ,
deposit_amount_currency_id smallint,
withdrawal_amount decimal(21,4) ,
withdrawal_amount_currency_id smallint,
interest_amount decimal(21,4) ,
interest_amount_currency_id smallint,
balance decimal(21,4),
balance_currency_id smallint not null,
primary key(account_trxn_id),
foreign key(account_trxn_id)
references account_trxn(account_trxn_id)
on delete no action
on update no action,
foreign key(deposit_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(withdrawal_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table loan_trxn_detail (
account_trxn_id integer not null,
principal_amount decimal(21,4),
principal_amount_currency_id smallint,
interest_amount decimal(21,4),
interest_amount_currency_id smallint,
penalty_amount decimal(21,4),
penalty_amount_currency_id smallint,
misc_fee_amount decimal(21,4),
misc_fee_amount_currency_id smallint,
misc_penalty_amount decimal(21,4),
misc_penalty_amount_currency_id smallint,
primary key(account_trxn_id),
foreign key(principal_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_penalty_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(account_trxn_id)
references account_trxn(account_trxn_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index loan_account_trxn_idx on loan_trxn_detail (account_trxn_id);
create table customer_trxn_detail (
account_trxn_id integer not null,
total_amount decimal(21,4),
total_amount_currency_id smallint,
misc_fee_amount decimal(21,4),
misc_fee_amount_currency_id smallint,
misc_penalty_amount decimal(21,4),
misc_penalty_amount_currency_id smallint,
primary key(account_trxn_id),
foreign key(total_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_penalty_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_fee_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(account_trxn_id)
references account_trxn(account_trxn_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table customer_loan_account_detail (
account_trxn_id integer not null,
account_id integer not null,
currency_id smallint,
installment_number smallint not null,
due_date date not null,
principal decimal(21,4) not null,
principal_currency_id smallint not null,
interest decimal(21,4) not null,
interest_currency_id smallint not null,
penalty decimal(21,4) not null,
penalty_currency_id smallint not null,
foreign key(account_trxn_id)
references account_trxn(account_trxn_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table spouse_father_lookup (
spouse_father_id integer not null ,
lookup_id integer not null ,
primary key (spouse_father_id),
foreign key (lookup_id) references lookup_value (lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table prd_offering_meeting (
prd_offering_meeting_id smallint auto_increment not null,
prd_offering_id smallint not null ,
prd_meeting_id integer ,
prd_offering_meeting_type_id smallint not null ,
primary key (prd_offering_meeting_id),
foreign key (prd_offering_id) references prd_offering (prd_offering_id),
foreign key (prd_meeting_id) references meeting (meeting_id),
foreign key (prd_offering_meeting_type_id) references meeting_type (meeting_type_id)
) engine=innodb;
create table account_state_flag (
flag_id smallint auto_increment not null,
lookup_id integer not null,
status_id smallint not null,
flag_description varchar(200),
retain_flag smallint not null,
primary key(flag_id),
foreign key(status_id)
references account_state(account_state_id)
on delete no action
on update no action,
foreign key(lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_flag_detail (
account_flag_id integer auto_increment not null,
account_id integer not null,
flag_id smallint not null,
created_by smallint not null,
created_date date not null,
primary key(account_flag_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(flag_id)
references account_state_flag(flag_id)
on delete no action
on update no action,
foreign key(created_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table account_status_change_history (
account_status_change_id integer auto_increment not null,
account_id integer not null,
old_status smallint,
new_status smallint not null,
changed_by smallint not null,
changed_date date not null,
primary key(account_status_change_id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(old_status)
references account_state(account_state_id)
on delete no action
on update no action,
foreign key(new_status)
references account_state(account_state_id)
on delete no action
on update no action,
foreign key(changed_by)
references personnel(personnel_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table temp_id (
id smallint auto_increment,
tempid smallint,
primary key(id)
)engine=innodb character set utf8;
create table config_key_value_integer (
configuration_id integer auto_increment not null,
configuration_key varchar(100) not null,
configuration_value integer not null,
primary key(configuration_id),
unique (configuration_key)
)
engine = innodb character set utf8;
create table field_configuration (
field_config_id integer auto_increment not null,
field_name varchar(100) not null,
entity_id smallint not null,
mandatory_flag smallint not null,
hidden_flag smallint not null,
parent_field_config_id integer,
primary key(field_config_id),
foreign key(entity_id)
references entity_master(entity_type_id)
on delete no action
on update no action,
foreign key(parent_field_config_id)
references field_configuration(field_config_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table customer_attendance_types(
attendance_id smallint auto_increment not null,
attendance_lookup_id integer not null,
description varchar(50),
primary key(attendance_id),
foreign key(attendance_lookup_id)
references lookup_value(lookup_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
-- TODO: a better name for this table would be "gl_account"
create table coa (
coa_id smallint auto_increment not null,
coa_name varchar(150) not null,
glcode_id smallint not null,
primary key(coa_id),
category_type varchar(20),
foreign key(glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action
)engine=innodb character set utf8;
-- TODO: drop this table, it isn't being used
create table coa_idmapper(
constant_id smallint not null ,
coa_id smallint not null,
description varchar(50),
primary key(constant_id),
foreign key(coa_id)
references coa(coa_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table financial_action (
fin_action_id smallint not null,
lookup_id integer not null,
primary key(fin_action_id),
foreign key(lookup_id)
references lookup_value_locale(lookup_id)
on delete no action
on update no action
)engine=innodb character set utf8;
-- TODO: drop this table, just move "parent_coaid" column to "coa" table
create table coahierarchy (
coa_id smallint not null ,
parent_coaid smallint,
foreign key(coa_id)
references coa(coa_id)
on delete no action
on update no action,
foreign key(parent_coaid)
references coa(coa_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table financial_trxn (
trxn_id integer auto_increment not null,
account_trxn_id integer not null,
related_fin_trxn integer,
currency_id smallint,
fin_action_id smallint,
glcode_id smallint not null,
posted_amount decimal(21,4) not null,
posted_amount_currency_id smallint,
balance_amount decimal(21,4) not null,
balance_amount_currency_id smallint,
action_date date not null,
posted_date date not null,
posted_by smallint,
accounting_updated smallint,
notes varchar(200),
debit_credit_flag smallint not null,
primary key(trxn_id),
foreign key(account_trxn_id)
references account_trxn(account_trxn_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(posted_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(balance_amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(related_fin_trxn)
references financial_trxn(trxn_id)
on delete no action
on update no action,
foreign key(fin_action_id)
references financial_action(fin_action_id)
on delete no action
on update no action,
foreign key(posted_by)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(glcode_id)
references gl_code(glcode_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table customer_attendance(
id integer auto_increment not null,
meeting_date date not null,
customer_id integer not null,
attendance smallint,
primary key(id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create index customer_attendance_meeting_date_idx on customer_attendance (meeting_date,customer_id);
create table report_category (
report_category_id smallint auto_increment not null,
report_category_value varchar(100),
primary key(report_category_id),
activity_id smallint,
foreign key(activity_id)
references activity(activity_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table report (
report_id smallint auto_increment not null,
report_category_id smallint ,
report_name varchar(100),
report_identifier varchar(100),
activity_id smallint,
report_active smallint,
primary key(report_id),
foreign key(report_category_id)
references report_category(report_category_id)
on delete no action
on update no action,
foreign key(activity_id)
references activity(activity_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table transaction_type
(
transaction_id smallint not null,
transaction_name varchar(100) not null,
primary key (transaction_id)
)
engine=innodb character set utf8;
create table accepted_payment_type
(
accepted_payment_type_id smallint auto_increment not null,
transaction_id smallint not null,
payment_type_id smallint not null,
primary key(accepted_payment_type_id),
foreign key(transaction_id)
references transaction_type(transaction_id)
on delete no action
on update no action,
foreign key(payment_type_id)
references payment_type(payment_type_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table client_perf_history (
id integer auto_increment not null,
customer_id integer not null,
last_loan_amnt decimal(21,4),
last_loan_amnt_currency_id smallint,
total_active_loans smallint,
total_savings_amnt decimal(21,4),
total_savings_amnt_currency_id smallint,
delinquint_portfolio decimal(21,4),
delinquint_portfolio_currency_id smallint,
primary key(id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table group_perf_history (
id integer auto_increment not null,
customer_id integer not null,
no_of_clients smallint,
last_group_loan_amnt_disb decimal(21,4),
last_group_loan_amnt_disb_currency_id smallint,
avg_loan_size decimal(21,4),
avg_loan_size_currency_id smallint,
total_outstand_loan_amnt decimal(21,4),
total_outstand_loan_amnt_currency_id smallint,
portfolio_at_risk decimal(21,4),
portfolio_at_risk_currency_id smallint,
total_savings_amnt decimal(21,4),
total_savings_amnt_currency_id smallint,
primary key(id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table loan_perf_history (
id integer auto_increment not null,
account_id integer not null,
no_of_payments smallint,
no_of_missed_payments smallint,
days_in_arrears smallint,
loan_maturity_date date,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table client_initial_savings_offering (
client_offering_id integer auto_increment not null,
customer_id integer not null,
prd_offering_id smallint not null,
primary key(client_offering_id),
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(prd_offering_id)
references prd_offering(prd_offering_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table loan_arrears_aging (
id integer auto_increment not null,
account_id integer not null,
customer_id integer not null,
customer_name varchar(200),
parent_customer_id integer,
office_id smallint not null,
days_in_arrears smallint not null,
overdue_principal decimal(21,4),
overdue_principal_currency_id smallint,
overdue_interest decimal(21,4),
overdue_interest_currency_id smallint,
overdue_balance decimal(21,4),
overdue_balance_currency_id smallint,
unpaid_principal decimal(21,4),
unpaid_principal_currency_id smallint,
unpaid_interest decimal(21,4),
unpaid_interest_currency_id smallint,
unpaid_balance decimal(21,4),
unpaid_balance_currency_id smallint,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(parent_customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(office_id)
references office(office_id)
on delete no action
on update no action,
foreign key(overdue_principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(overdue_interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(overdue_balance_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(unpaid_principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(unpaid_interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(unpaid_balance_currency_id)
references currency(currency_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table loan_counter(
loan_counter_id integer auto_increment not null,
client_perf_id integer not null,
loan_offering_id smallint not null,
loan_cycle_counter smallint,
primary key(loan_counter_id)
)
engine=innodb character set utf8;
create index loan_counter_client_perf_idx on loan_counter (client_perf_id);
-- Begin tables for the Reports Mini Portal
create table report_datasource (
datasource_id int auto_increment not null,
name varchar(255) default '' not null,
driver varchar(255) default null,
url varchar(255) default '' not null,
username varchar(255) default null,
password varchar(255) default null,
max_idle int default null,
max_active int default null,
max_wait bigint default null,
validation_query varchar(255) default null,
jndi tinyint default null,
primary key (datasource_id),
unique (name),
unique (name)
) engine=innodb character set utf8;
create table report_jasper_map (
report_id smallint auto_increment not null,
report_category_id smallint default null,
report_name varchar(100) default null,
report_identifier varchar(100) default null,
report_jasper varchar(100) default null,
primary key (report_id),
index report_category_id (report_category_id),
constraint report_jasper_map_ibfk_1 foreign key (report_category_id)
references report_category (report_category_id)
on delete no action on update no action
) engine=innodb character set utf8;
create table report_parameter (
parameter_id int auto_increment not null,
name varchar(255) default '' not null,
type varchar(255) default '' not null,
classname varchar(255) default '' not null,
data text,
datasource_id int default null,
description varchar(255) default null,
primary key (parameter_id),
unique (name),
unique (name),
index datasource_id (datasource_id)
) engine=innodb character set utf8;
create table report_parameter_map (
report_id int default '0' not null,
parameter_id int default null,
required tinyint default null,
sort_order int default null,
step int default null,
map_id int auto_increment not null,
primary key (map_id),
index report_id (report_id),
index parameter_id (parameter_id)
) engine=innodb character set utf8;
-- end tables for the Reports Mini Portal
-- start tables for surveys module
create table survey (
survey_id integer auto_increment not null,
survey_name varchar(200) not null,
survey_applies_to varchar(200) not null,
date_of_creation date not null,
state integer not null,
primary key(survey_id)
) engine=innodb character set utf8;
create table ppi_survey (
country_id integer not null,
survey_id integer not null,
very_poor_min integer not null,
very_poor_max integer not null,
poor_min integer not null,
poor_max integer not null,
at_risk_min integer not null,
at_risk_max integer not null,
non_poor_min integer not null,
non_poor_max integer not null,
primary key(country_id),
foreign key(survey_id)
references survey(survey_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table survey_instance (
instance_id integer auto_increment not null,
survey_id integer not null,
customer_id integer,
officer_id smallint,
date_conducted date not null,
completed_status integer not null,
account_id integer,
creating_officer_id smallint not null,
primary key(instance_id),
foreign key(survey_id)
references survey(survey_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(officer_id)
references personnel(personnel_id)
on delete no action
on update no action,
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(creating_officer_id)
references personnel(personnel_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table ppi_survey_instance (
instance_id integer not null,
bottom_half_below decimal(21,4),
top_half_below decimal(21,4),
primary key(instance_id)
) engine=innodb character set utf8;
create table questions (
question_id integer auto_increment not null,
answer_type integer not null,
question_state integer not null,
question_text varchar(1000) not null,
numeric_min integer,
numeric_max integer,
nickname varchar(64) not null,
primary key(question_id),
unique(nickname)
) engine=innodb character set utf8;
create table survey_questions (
surveyquestion_id integer auto_increment not null,
survey_id integer not null,
question_id integer not null,
question_order integer not null,
mandatory smallint default 1 not null,
primary key(surveyquestion_id),
foreign key(question_id)
references questions(question_id)
on delete no action
on update no action,
foreign key(survey_id)
references survey(survey_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table ppi_likelihoods (
likelihood_id integer auto_increment not null,
survey_id integer not null,
score_from integer not null,
score_to integer not null,
bottom_half_below decimal(21,4) not null,
top_half_below decimal(21,4) not null,
likelihood_order integer not null,
primary key(likelihood_id),
foreign key(survey_id)
references survey(survey_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table question_choices (
choice_id integer auto_increment not null,
question_id integer not null,
choice_text varchar(500) not null,
choice_order integer not null,
ppi varchar(1) not null,
ppi_points integer,
primary key(choice_id),
foreign key(question_id)
references questions(question_id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table survey_response (
response_id integer auto_increment not null,
instance_id integer not null,
survey_question_id integer not null,
freetext_value text,
choice_value integer,
date_value date,
number_value decimal(16,5),
multi_select_value text,
unique(instance_id, survey_question_id),
primary key(response_id),
foreign key(survey_question_id)
references survey_questions(surveyquestion_id)
on delete no action
on update no action,
foreign key(instance_id)
references survey_instance(instance_id)
on delete no action
on update no action,
foreign key(choice_value)
references question_choices(choice_id)
on delete no action
on update no action
) engine=innodb character set utf8;
-- end tables for surveys module
-- defining table for products mix
create table prd_offering_mix (
prd_offering_mix_id integer auto_increment not null,
prd_offering_id smallint not null ,
prd_offering_not_allowed_id smallint not null ,
created_by smallint ,
created_date date ,
updated_by smallint,
updated_date date ,
version_no integer,
primary key (prd_offering_mix_id),
constraint prd_offering_mix_prd_offering_id_1
foreign key (prd_offering_id)
references prd_offering (prd_offering_id)
on delete no action
on update no action,
constraint prd_offering_mix_prd_offering_id_2
foreign key (prd_offering_not_allowed_id)
references prd_offering (prd_offering_id)
on delete no action
on update no action
) engine=innodb character set utf8;
-- tables for loan defaults based on last loan
create table loan_amount_from_last_loan (
loan_amount_from_last_loan_id smallint auto_increment not null,
prd_offering_id smallint not null,
start_range decimal(21,4) not null,
end_range decimal(21,4) not null,
min_loan_amount decimal(21,4) not null,
max_loan_amnt decimal(21,4) not null,
default_loan_amount decimal(21,4) not null,
primary key(loan_amount_from_last_loan_id),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table no_of_install_from_last_loan (
no_of_install_from_last_loan_id smallint auto_increment not null,
prd_offering_id smallint not null,
start_range decimal(21,4) not null,
end_range decimal(21,4) not null,
min_no_install decimal(21,4) not null,
max_no_install decimal(21,4) not null,
default_no_install decimal(21,4) not null,
primary key(no_of_install_from_last_loan_id ),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table loan_amount_from_loan_cycle(
loan_amount_from_loan_cycle_id smallint auto_increment not null,
prd_offering_id smallint not null,
min_loan_amount decimal(21,4) not null,
max_loan_amnt decimal(21,4) not null,
default_loan_amount decimal(21,4) not null,
range_index smallint not null,
primary key(loan_amount_from_loan_cycle_id),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table no_of_install_from_loan_cycle (
no_of_install_from_loan_cycle_id smallint auto_increment not null,
prd_offering_id smallint not null,
min_no_install decimal(21,4) not null,
max_no_install decimal(21,4) not null,
default_no_install decimal(21,4) not null,
range_index decimal(21,4) not null,
primary key(no_of_install_from_loan_cycle_id),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table loan_amount_same_for_all_loan(
loan_amount_same_for_all_loan_id smallint auto_increment not null,
prd_offering_id smallint not null,
min_loan_amount decimal(21,4) not null,
max_loan_amnt decimal(21,4) not null,
default_loan_amount decimal(21,4) not null,
primary key(loan_amount_same_for_all_loan_id),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table no_of_install_same_for_all_loan(
no_of_install_same_for_all_loan_id smallint auto_increment not null,
prd_offering_id smallint not null,
min_no_install decimal(21,4) not null,
max_no_install decimal(21,4) not null,
default_no_install decimal(21,4) not null,
primary key(no_of_install_same_for_all_loan_id),
foreign key(prd_offering_id)
references loan_offering(prd_offering_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table max_min_loan_amount(
account_id integer auto_increment not null,
min_loan_amount decimal(21,4) not null,
max_loan_amount decimal(21,4) not null,
primary key(account_id),
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table max_min_interest_rate(
account_id integer auto_increment not null,
min_interest_rate decimal(21,4) not null,
max_interest_rate decimal(21,4) not null,
primary key(account_id),
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table max_min_no_of_install(
account_id integer auto_increment not null,
min_no_install decimal(21,4) not null,
max_no_install decimal(21,4) not null,
primary key(account_id),
foreign key(account_id)
references loan_account(account_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table group_loan_counter(
group_loan_counter_id integer auto_increment not null,
group_perf_id integer not null,
loan_offering_id smallint not null,
loan_cycle_counter smallint,
primary key(group_loan_counter_id),
foreign key(group_perf_id)
references group_perf_history(id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table admin_document (
admin_document_id integer auto_increment not null,
admin_document_name varchar(200) ,
admin_document_identifier varchar(100) ,
admin_document_active smallint ,
created_by smallint ,
created_date date ,
updated_by smallint ,
updated_date date ,
version_no integer ,
primary key (admin_document_id)
)
engine=innodb character set utf8;
create table admin_document_acc_state_mix (
admin_doc_acc_state_mix_id integer auto_increment,
account_state_id smallint not null,
admin_document_id integer not null,
created_by smallint ,
created_date date ,
updated_by smallint ,
updated_date date ,
version_no integer ,
primary key (admin_doc_acc_state_mix_id),
constraint admin_document_acc_state_mix_fk foreign key (account_state_id) references account_state (account_state_id) on delete no action on update no action,
constraint admin_document_acc_state_mix_fk1 foreign key (admin_document_id) references admin_document (admin_document_id) on delete no action on update no action
)
engine=innodb character set utf8;
create table batch_branch_report(
branch_report_id integer auto_increment not null,
branch_id smallint not null,
run_date date not null,
primary key(branch_report_id)
)engine=innodb character set utf8;
create table batch_client_summary(
client_summary_id integer auto_increment not null primary key,
branch_report_id integer not null,
field_name varchar(50) not null,
total varchar(50),
vpoor_total varchar(50),
foreign key(branch_report_id) references batch_branch_report(branch_report_id)
)engine=innodb character set utf8;
create table batch_loan_arrears_aging (
loan_arrears_aging_id integer auto_increment not null,
aging_period_id integer not null,
branch_report_id integer not null,
clients_aging integer not null,
loans_aging integer not null,
amount_aging decimal(21,4) not null,
amount_aging_currency_id smallint not null,
amount_outstanding_aging decimal(21,4) not null,
amount_outstanding_aging_currency_id smallint not null,
interest_aging decimal(21,4) not null,
interest_aging_currency_id smallint not null,
primary key (loan_arrears_aging_id),
foreign key (branch_report_id)
references batch_branch_report (branch_report_id)
) engine = innodb character set utf8;
create table batch_staff_summary(
staff_summary_id integer auto_increment not null primary key,
branch_report_id integer not null,
personnel_id smallint not null,
personnel_name varchar(50) not null,
joining_date date,
active_borrowers integer not null,
active_loans integer not null,
center_count integer not null,
client_count integer not null,
loan_amount_outstanding decimal(21,4) not null,
loan_amount_outstanding_currency_id smallint not null,
interest_fees_outstanding decimal(21,4) not null,
interest_fees_outstanding_currency_id smallint not null,
portfolio_at_risk decimal(21,4) not null,
total_clients_enrolled integer not null,
clients_enrolled_this_month integer not null,
loan_arrears_amount decimal(21,4) not null,
loan_arrears_amount_currency_id smallint not null,
foreign key(branch_report_id) references batch_branch_report(branch_report_id)
)engine=innodb character set utf8;
create table batch_staffing_level_summary(
staffing_level_summary_id integer auto_increment not null primary key,
branch_report_id integer not null,
role_id integer not null,
role_name varchar(50) not null,
personnel_count integer not null,
foreign key(branch_report_id) references batch_branch_report(branch_report_id)
)engine=innodb character set utf8;
create table batch_loan_details(
loan_details_id integer auto_increment not null primary key,
branch_report_id integer not null,
product_name varchar(50) not null,
number_of_loans_issued integer not null,
loan_amount_issued decimal(21,4) not null,
loan_amount_issued_currency_id smallint not null,
loan_interest_issued decimal(21,4) not null,
loan_interest_issued_currency_id smallint not null,
number_of_loans_outstanding integer not null,
loan_outstanding_amount decimal(21,4) not null,
loan_outstanding_amount_currency_id smallint not null,
loan_outstanding_interest decimal(21,4) not null,
loan_outstanding_interest_currency_id smallint not null,
foreign key(branch_report_id) references batch_branch_report(branch_report_id)
)engine=innodb character set utf8;
create table batch_loan_arrears_profile(
loan_arrears_profile_id integer auto_increment not null primary key,
branch_report_id integer not null,
loans_in_arrears integer not null,
clients_in_arrears integer not null,
overdue_balance decimal(21,4) not null,
overdue_balance_currency_id smallint not null,
unpaid_balance decimal(21,4) not null,
unpaid_balance_currency_id smallint not null,
loans_at_risk integer not null,
outstanding_amount_at_risk decimal(21,4) not null,
outstanding_amount_at_risk_currency_id smallint not null,
overdue_amount_at_risk decimal(21,4) not null,
overdue_amount_at_risk_currency_id smallint not null,
clients_at_risk integer not null,
foreign key(branch_report_id) references batch_branch_report(branch_report_id)
)engine=innodb character set utf8;
create table batch_branch_cash_confirmation_report(
branch_cash_confirmation_report_id integer auto_increment not null,
branch_id smallint not null,
run_date date not null,
primary key(branch_cash_confirmation_report_id)
)engine=innodb character set utf8;
create table batch_branch_confirmation_recovery(
recovery_id integer auto_increment not null primary key,
branch_cash_confirmation_report_id integer not null,
product_name varchar(50) not null,
due decimal(21,4) not null,
due_currency_id smallint not null,
actual decimal(21,4) not null,
actual_currency_id smallint not null,
arrears decimal(21,4) not null,
arrears_currency_id smallint not null,
foreign key(branch_cash_confirmation_report_id)
references batch_branch_cash_confirmation_report(branch_cash_confirmation_report_id)
)engine=innodb character set utf8;
create table batch_branch_confirmation_issue(
id integer auto_increment not null primary key,
branch_cash_confirmation_report_id integer not null,
product_name varchar(50) not null,
actual decimal(21,4) not null,
actual_currency_id smallint not null,
foreign key(branch_cash_confirmation_report_id)
references batch_branch_cash_confirmation_report(branch_cash_confirmation_report_id)
)engine=innodb character set utf8;
create table batch_branch_confirmation_disbursement(
id integer auto_increment not null primary key,
branch_cash_confirmation_report_id integer not null,
product_name varchar(50) not null,
actual decimal(21,4) not null,
actual_currency_id smallint not null,
foreign key(branch_cash_confirmation_report_id)
references batch_branch_cash_confirmation_report(branch_cash_confirmation_report_id)
)engine=innodb character set utf8;
create table imported_transactions_files
( file_name varchar(100) not null,
submitted_on timestamp not null,
submitted_by smallint not null,
primary key (file_name),
foreign key (submitted_by)
references personnel(personnel_id)
on delete no action
on update no action
)engine=innodb character set utf8;
create table question_group(
id integer auto_increment not null,
title varchar(200) not null,
date_of_creation date not null,
state integer not null,
is_editable tinyint not null default 0,
is_ppi tinyint not null default 0,
primary key (id)
) engine=innodb character set utf8;
create table events (
id integer not null,
name varchar(50) not null,
primary key (id)
) engine=innodb character set utf8;
create table event_sources (
id integer not null,
entity_type_id smallint not null,
event_id integer not null,
description varchar(200) not null,
primary key (id),
foreign key (entity_type_id) references entity_master(entity_type_id),
foreign key (event_id) references events(id)
) engine=innodb character set utf8;
create table question_group_event_sources(
id integer auto_increment not null,
question_group_id integer not null,
event_source_id integer not null,
primary key (id),
foreign key (question_group_id) references question_group(id),
foreign key (event_source_id) references event_sources(id)
) engine=innodb character set utf8;
create table sections(
id integer auto_increment not null,
question_group_id integer not null,
name varchar(50) not null,
sequence_number integer not null,
primary key (id),
foreign key (question_group_id) references question_group(id)
) engine=innodb character set utf8;
create table sections_questions(
id integer auto_increment not null,
section_id integer not null,
question_id integer not null,
is_required tinyint default 0,
sequence_number integer not null,
primary key (id),
foreign key (section_id) references sections(id),
foreign key (question_id) references questions(question_id)
) engine=innodb character set utf8;
create table question_group_instance(
id integer auto_increment not null,
question_group_id integer not null,
entity_id integer not null,
date_conducted date not null,
completed_status smallint not null,
created_by integer not null,
version_id integer not null,
event_source_id integer not null,
primary key (id),
foreign key (question_group_id) references question_group(id)
) engine=innodb character set utf8;
create index entity_and_event_source_idx on question_group_instance (entity_id, event_source_id);
create table question_group_response(
id integer auto_increment not null,
question_group_instance_id integer not null,
sections_questions_id integer not null,
response varchar(500) not null,
tag varchar(50),
primary key (id),
foreign key (sections_questions_id) references sections_questions(id),
foreign key (question_group_instance_id) references question_group_instance(id)
) engine=innodb character set utf8;
create table question_choice_tags(
id integer auto_increment not null,
choice_id integer not null,
tag_text varchar(50) not null,
primary key (id),
foreign key (choice_id) references question_choices(choice_id),
unique(choice_id, tag_text)
) engine=innodb character set utf8;
create table applied_upgrades(
upgrade_id integer not null,
primary key (upgrade_id)
) engine=innodb character set utf8;
create table QRTZ_JOB_DETAILS(
job_name varchar(200) not null,
job_group varchar(200) not null,
description varchar(250) null,
job_class_name varchar(250) not null,
is_durable varchar(1) not null,
is_volatile varchar(1) not null,
is_stateful varchar(1) not null,
requests_recovery varchar(1) not null,
job_data blob null,
primary key (job_name,job_group)
) engine=innodb character set utf8;
create table QRTZ_JOB_LISTENERS(
job_name varchar(200) not null,
job_group varchar(200) not null,
job_listener varchar(200) not null,
primary key (job_name,job_group,job_listener),
foreign key (job_name,job_group)
references QRTZ_JOB_DETAILS(job_name,job_group)
) engine=innodb character set utf8;
create table QRTZ_TRIGGERS(
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
job_name varchar(200) not null,
job_group varchar(200) not null,
is_volatile varchar(1) not null,
description varchar(250) null,
next_fire_time bigint(13) null,
prev_fire_time bigint(13) null,
priority integer null,
trigger_state varchar(16) not null,
trigger_type varchar(8) not null,
start_time bigint(13) not null,
end_time bigint(13) null,
calendar_name varchar(200) null,
misfire_instr smallint(2) null,
job_data blob null,
primary key (trigger_name,trigger_group),
foreign key (job_name,job_group)
references QRTZ_JOB_DETAILS(job_name,job_group)
) engine=innodb character set utf8;
create table QRTZ_SIMPLE_TRIGGERS(
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
repeat_count bigint(7) not null,
repeat_interval bigint(12) not null,
times_triggered bigint(10) not null,
primary key (trigger_name,trigger_group),
foreign key (trigger_name,trigger_group)
references QRTZ_TRIGGERS(trigger_name,trigger_group)
) engine=innodb character set utf8;
create table QRTZ_CRON_TRIGGERS(
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
cron_expression varchar(200) not null,
time_zone_id varchar(80),
primary key (trigger_name,trigger_group),
foreign key (trigger_name,trigger_group)
references QRTZ_TRIGGERS(trigger_name,trigger_group)
) engine=innodb character set utf8;
create table QRTZ_BLOB_TRIGGERS(
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
blob_data blob null,
primary key (trigger_name,trigger_group),
foreign key (trigger_name,trigger_group)
references QRTZ_TRIGGERS(trigger_name,trigger_group)
) engine=innodb character set utf8;
create table QRTZ_TRIGGER_LISTENERS(
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
trigger_listener varchar(200) not null,
primary key (trigger_name,trigger_group,trigger_listener),
foreign key (trigger_name,trigger_group)
references QRTZ_TRIGGERS(trigger_name,trigger_group)
) engine=innodb character set utf8;
create table QRTZ_CALENDARS(
calendar_name varchar(200) not null,
calendar blob not null,
primary key (calendar_name)
) engine=innodb character set utf8;
create table QRTZ_PAUSED_TRIGGER_GRPS(
trigger_group varchar(200) not null,
primary key (trigger_group)
) engine=innodb character set utf8;
create table QRTZ_FIRED_TRIGGERS(
entry_id varchar(95) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
is_volatile varchar(1) not null,
instance_name varchar(200) not null,
fired_time bigint(13) not null,
priority integer not null,
state varchar(16) not null,
job_name varchar(200) null,
job_group varchar(200) null,
is_stateful varchar(1) null,
requests_recovery varchar(1) null,
primary key (entry_id)
) engine=innodb character set utf8;
create table QRTZ_SCHEDULER_STATE(
instance_name varchar(200) not null,
last_checkin_time bigint(13) not null,
checkin_interval bigint(13) not null,
primary key (instance_name)
) engine=innodb character set utf8;
create table QRTZ_LOCKS(
lock_name varchar(40) not null,
primary key (lock_name)
) engine=innodb character set utf8;
create table BATCH_JOB_INSTANCE (
job_instance_id bigint not null primary key ,
version bigint ,
job_name varchar(100) not null,
job_key varchar(32) not null,
constraint job_inst_un unique (job_name, job_key)
) engine=innodb character set utf8;
create table BATCH_JOB_EXECUTION (
job_execution_id bigint not null primary key ,
version bigint ,
job_instance_id bigint not null,
create_time datetime not null,
start_time datetime default null ,
end_time datetime default null ,
status varchar(10) ,
exit_code varchar(20) ,
exit_message varchar(2500) ,
last_updated datetime,
constraint job_inst_exec_fk foreign key (job_instance_id)
references BATCH_JOB_INSTANCE(job_instance_id)
) engine=innodb character set utf8;
create table BATCH_JOB_PARAMS (
job_instance_id bigint not null ,
type_cd varchar(6) not null ,
key_name varchar(100) not null ,
string_val varchar(250) ,
date_val datetime default null ,
long_val bigint ,
double_val double precision ,
constraint job_inst_params_fk foreign key (job_instance_id)
references BATCH_JOB_INSTANCE(job_instance_id)
) engine=innodb character set utf8;
create table BATCH_STEP_EXECUTION (
step_execution_id bigint not null primary key ,
version bigint not null,
step_name varchar(100) not null,
job_execution_id bigint not null,
start_time datetime not null ,
end_time datetime default null ,
status varchar(10) ,
commit_count bigint ,
read_count bigint ,
filter_count bigint ,
write_count bigint ,
read_skip_count bigint ,
write_skip_count bigint ,
process_skip_count bigint ,
rollback_count bigint ,
exit_code varchar(20) ,
exit_message varchar(2500) ,
last_updated datetime,
constraint job_exec_step_fk foreign key (job_execution_id)
references BATCH_JOB_EXECUTION(job_execution_id)
) engine=innodb character set utf8;
create table BATCH_STEP_EXECUTION_CONTEXT (
step_execution_id bigint not null primary key,
short_context varchar(2500) not null,
serialized_context text ,
constraint step_exec_ctx_fk foreign key (step_execution_id)
references BATCH_STEP_EXECUTION(step_execution_id)
) engine=innodb character set utf8;
create table BATCH_JOB_EXECUTION_CONTEXT (
job_execution_id bigint not null primary key,
short_context varchar(2500) not null,
serialized_context text ,
constraint job_exec_ctx_fk foreign key (job_execution_id)
references BATCH_JOB_EXECUTION(job_execution_id)
) engine=innodb character set utf8;
create table BATCH_STEP_EXECUTION_SEQ (id bigint not null) engine=myisam;
create table BATCH_JOB_EXECUTION_SEQ (id bigint not null) engine=myisam;
create table BATCH_JOB_SEQ (id bigint not null) engine=myisam;
create table prd_offering_question_group(
prd_offering_id smallint not null,
question_group_id integer not null,
foreign key (prd_offering_id) references prd_offering(prd_offering_id),
foreign key (question_group_id) references question_group(id)
) engine=innodb character set utf8;
create table cash_flow (
id int auto_increment not null primary key,
capital decimal(21, 4),
liability decimal(21, 4)
) engine=innodb character set utf8;
create table monthly_cash_flow_details(
id int auto_increment not null primary key,
cash_flow_id int,
month_year date,
revenue decimal(21, 4) not null,
expenses decimal(21, 4) not null,
notes varchar(300),
foreign key(cash_flow_id)
references cash_flow(id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table loan_cash_flow (
loan_id int not null,
cash_flow_id int not null,
foreign key(loan_id)
references loan_account(account_id)
on delete no action
on update no action,
foreign key(cash_flow_id)
references cash_flow(id)
on delete no action
on update no action
) engine=innodb character set utf8;
create table savings_offering_historical_interest_detail (
id integer auto_increment not null,
period_start_date date not null,
period_end_date date not null,
interest_rate decimal(13, 10) not null,
min_amnt_for_int decimal(21,4) not null,
min_amnt_for_int_currency_id smallint not null,
product_id smallint not null,
primary key(id),
foreign key (product_id) references savings_offering (prd_offering_id)
)
engine=innodb character set utf8;
create table original_loan_schedule (
id integer auto_increment not null,
account_id integer not null,
customer_id integer not null,
currency_id smallint,
action_date date,
principal decimal(21,4) not null,
principal_currency_id smallint,
interest decimal(21,4) not null,
interest_currency_id smallint,
penalty decimal(21,4) not null,
penalty_currency_id smallint,
misc_fees decimal(21,4),
misc_fees_currency_id smallint,
misc_fees_paid decimal(21,4),
misc_fees_paid_currency_id smallint,
misc_penalty decimal(21,4),
misc_penalty_currency_id smallint,
misc_penalty_paid decimal(21,4),
misc_penalty_paid_currency_id smallint,
principal_paid decimal(21,4),
principal_paid_currency_id smallint,
interest_paid decimal(21,4),
interest_paid_currency_id smallint,
penalty_paid decimal(21,4),
penalty_paid_currency_id smallint,
payment_status smallint not null,
installment_id smallint not null,
payment_date date,
parent_flag smallint,
version_no integer not null,
extra_interest decimal(21,4),
extra_interest_currency_id smallint,
extra_interest_paid decimal(21,4),
extra_interest_paid_currency_id smallint,
primary key(id),
foreign key(account_id)
references account(account_id)
on delete no action
on update no action,
foreign key(currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_fees_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_fees_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_penalty_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(principal_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(penalty_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(misc_penalty_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(customer_id)
references customer(customer_id)
on delete no action
on update no action,
foreign key(extra_interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(extra_interest_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
create table original_loan_fee_schedule (
account_fees_detail_id integer auto_increment not null,
id integer not null,
installment_id integer not null,
fee_id smallint not null,
account_fee_id integer not null,
amount decimal(21,4),
amount_currency_id smallint,
amount_paid decimal(21,4) not null,
amount_paid_currency_id smallint not null,
version_no integer not null,
primary key(account_fees_detail_id),
foreign key(id)
references original_loan_schedule(id)
on delete no action
on update no action,
foreign key(amount_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(amount_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(fee_id)
references fees(fee_id),
foreign key(account_fee_id)
references account_fees(account_fee_id)
)
engine=innodb character set utf8;
create table calculated_interest_on_payment (
loan_account_trxn_id integer not null,
original_interest decimal(21,4) not null,
original_interest_currency_id smallint,
extra_interest_paid decimal(21,4),
extra_interest_paid_currency_id smallint,
interest_due_till_paid decimal(21,4),
interest_due_till_paid_currency_id smallint,
primary key(loan_account_trxn_id),
foreign key(loan_account_trxn_id)
references loan_trxn_detail(account_trxn_id)
on delete no action
on update no action,
foreign key(original_interest_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(extra_interest_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action,
foreign key(interest_due_till_paid_currency_id)
references currency(currency_id)
on delete no action
on update no action
)
engine=innodb character set utf8;
CREATE TABLE DATABASECHANGELOG (
ID varchar(63) NOT NULL,
AUTHOR varchar(63) NOT NULL,
FILENAME varchar(200) NOT NULL,
DATEEXECUTED datetime NOT NULL,
ORDEREXECUTED int(11) NOT NULL,
EXECTYPE varchar(10) NOT NULL,
MD5SUM varchar(35) DEFAULT NULL,
DESCRIPTION varchar(255) DEFAULT NULL,
COMMENTS varchar(255) DEFAULT NULL,
TAG varchar(255) DEFAULT NULL,
LIQUIBASE varchar(20) DEFAULT NULL,
PRIMARY KEY (ID,AUTHOR,FILENAME)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE DATABASECHANGELOGLOCK (
ID int(11) NOT NULL,
LOCKED tinyint(1) NOT NULL,
LOCKGRANTED datetime DEFAULT NULL,
LOCKEDBY varchar(255) DEFAULT NULL,
PRIMARY KEY (ID)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
col hold_mode head HOLD_MODE for a10
col req_mode head REQ_MODE for a10
col object_owner head OBJECT_OWNER for a15
col namespace for a20 word_wrap
col kgllk_state head 0xSTATE for A8
SELECT * FROM (
SELECT
s.sid
, KGLLKSNM rsid
-- , KGLLKADR
-- , KGLLKUSE
-- , KGLLKSES
, decode(l.kgllkmod, 0, 'None', 1, 'Null', 2, 'Share', 3, 'Exclusive', to_char(l.kgllkmod)) hold_mode
, decode(l.kgllkreq, 0, 'None', 1, 'Null', 2, 'Share', 3, 'Exclusive', to_char(l.kgllkreq)) req_mode
-- , LPAD('0x'||TRIM(TO_CHAR(l.kgllkflg,'XXXXX')),8) kgllk_state
-- , decode(l.kgllkflg, 0, 1, 'BROKEN', 2, 'BREAKABLE', l.kgllkflg) kgllk_state
-- 11g stuff
-- , kgllkest
-- , kgllkexc
-- , KGLLKFLG
-- , KGLLKSPN
-- , KGLLKHTB
, KGLNAHSH
-- , KGLLKSQLID
-- , KGLHDPAR
-- , KGLHDNSP
-- , n.kglsttyp
, n.kglstdsc namespace
, USER_NAME object_owner
, KGLNAOBJ object_name
, TO_CHAR(l.kgllkflg,'XXXXX') kgllk_state
, KGLLKHDL
, KGLLKPNC
, KGLLKPNS
, KGLLKCNT
-- , KGLLKCTP -- cursor type
FROM
x$kgllk l
, v$session s
, x$kglst n
WHERE
s.saddr(+) = l.kgllkuse
AND l.kglhdnsp = n.indx
--AND kgllkhdl = hextoraw(upper(lpad('&1',vsize(l.kgllkhdl)*2,'0')))
)
WHERE &1
/
|
CREATE INDEX IF NOT EXISTS idx_posts_root_id ON posts(rootid);
DROP INDEX IF EXISTS idx_posts_root_id_delete_at;
ALTER TABLE posts ADD COLUMN IF NOT EXISTS parentid varchar(26);
ALTER TABLE posts ALTER COLUMN props TYPE varchar(8000);
ALTER TABLE posts ALTER COLUMN fileids TYPE varchar(300);
|
CREATE TABLE BPM_TASK_DEF(
ID BIGINT NOT NULL,
TASK_DEFINITION_KEY VARCHAR(200),
ASSIGNEE VARCHAR(200),
CANDIDATE VARCHAR(200),
PROCESS_ID BIGINT,
CONSTRAINT PK_BPM_TASK_DEF PRIMARY KEY(ID),
CONSTRAINT FK_BPM_TASK_DEF_ID FOREIGN KEY(PROCESS_ID) REFERENCES BPM_PROCESS(ID)
) ENGINE=INNODB CHARSET=UTF8;
|
<filename>mojaloop-technical-overview/central-ledger/assets/database/central-ledger-ddl-MySQLWorkbench.sql
-- MySQL dump 10.13 Distrib 8.0.18, for macos10.14 (x86_64)
--
-- Host: localhost Database: central_ledger
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `amountType`
--
DROP TABLE IF EXISTS `amountType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `amountType` (
`amountTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(256) NOT NULL,
`description` varchar(1024) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`amountTypeId`),
UNIQUE KEY `amounttype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `balanceOfPayments`
--
DROP TABLE IF EXISTS `balanceOfPayments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `balanceOfPayments` (
`balanceOfPaymentsId` int(10) unsigned NOT NULL,
`name` varchar(256) NOT NULL,
`description` varchar(1024) DEFAULT NULL COMMENT 'Possible values and meaning are defined in https://www.imf.org/external/np/sta/bopcode/',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`balanceOfPaymentsId`),
UNIQUE KEY `balanceofpayments_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='See https://www.imf.org/external/np/sta/bopcode/guide.htm';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkProcessingState`
--
DROP TABLE IF EXISTS `bulkProcessingState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkProcessingState` (
`bulkProcessingStateId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkProcessingStateId`),
UNIQUE KEY `bulkprocessingstate_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransfer`
--
DROP TABLE IF EXISTS `bulkTransfer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransfer` (
`bulkTransferId` varchar(36) NOT NULL,
`bulkQuoteId` varchar(36) DEFAULT NULL,
`payerParticipantId` int(10) unsigned DEFAULT NULL,
`payeeParticipantId` int(10) unsigned DEFAULT NULL,
`expirationDate` datetime NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferId`),
KEY `bulktransfer_payerparticipantid_index` (`payerParticipantId`),
KEY `bulktransfer_payeeparticipantid_index` (`payeeParticipantId`),
CONSTRAINT `bulktransfer_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransferDuplicateCheck` (`bulktransferid`),
CONSTRAINT `bulktransfer_payeeparticipantid_foreign` FOREIGN KEY (`payeeParticipantId`) REFERENCES `participant` (`participantid`),
CONSTRAINT `bulktransfer_payerparticipantid_foreign` FOREIGN KEY (`payerParticipantId`) REFERENCES `participant` (`participantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferAssociation`
--
DROP TABLE IF EXISTS `bulkTransferAssociation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferAssociation` (
`bulkTransferAssociationId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferId` varchar(36) NOT NULL,
`bulkTransferId` varchar(36) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`bulkProcessingStateId` int(10) unsigned NOT NULL,
`lastProcessedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`errorCode` int(10) unsigned DEFAULT NULL,
`errorDescription` varchar(128) DEFAULT NULL,
PRIMARY KEY (`bulkTransferAssociationId`),
UNIQUE KEY `bulktransferassociation_transferid_bulktransferid_unique` (`transferId`,`bulkTransferId`),
KEY `bulktransferassociation_bulktransferid_foreign` (`bulkTransferId`),
KEY `bulktransferassociation_bulkprocessingstateid_foreign` (`bulkProcessingStateId`),
CONSTRAINT `bulktransferassociation_bulkprocessingstateid_foreign` FOREIGN KEY (`bulkProcessingStateId`) REFERENCES `bulkProcessingState` (`bulkprocessingstateid`),
CONSTRAINT `bulktransferassociation_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferDuplicateCheck`
--
DROP TABLE IF EXISTS `bulkTransferDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferDuplicateCheck` (
`bulkTransferId` varchar(36) NOT NULL,
`hash` varchar(256) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferError`
--
DROP TABLE IF EXISTS `bulkTransferError`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferError` (
`bulkTransferErrorId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`bulkTransferStateChangeId` bigint(20) unsigned NOT NULL,
`errorCode` int(10) unsigned NOT NULL,
`errorDescription` varchar(128) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferErrorId`),
KEY `bulktransfererror_bulktransferstatechangeid_index` (`bulkTransferStateChangeId`),
CONSTRAINT `bulktransfererror_bulktransferstatechangeid_foreign` FOREIGN KEY (`bulkTransferStateChangeId`) REFERENCES `bulkTransferStateChange` (`bulktransferstatechangeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferExtension`
--
DROP TABLE IF EXISTS `bulkTransferExtension`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferExtension` (
`bulkTransferExtensionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`bulkTransferId` varchar(36) NOT NULL,
`isFulfilment` tinyint(1) NOT NULL DEFAULT '0',
`key` varchar(128) NOT NULL,
`value` text NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferExtensionId`),
KEY `bulktransferextension_bulktransferid_index` (`bulkTransferId`),
CONSTRAINT `bulktransferextension_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferFulfilment`
--
DROP TABLE IF EXISTS `bulkTransferFulfilment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferFulfilment` (
`bulkTransferId` varchar(36) NOT NULL,
`completedDate` datetime NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferId`),
CONSTRAINT `bulktransferfulfilment_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransferFulfilmentDuplicateCheck` (`bulktransferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferFulfilmentDuplicateCheck`
--
DROP TABLE IF EXISTS `bulkTransferFulfilmentDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferFulfilmentDuplicateCheck` (
`bulkTransferId` varchar(36) NOT NULL,
`hash` varchar(256) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferId`),
CONSTRAINT `bulktransferfulfilmentduplicatecheck_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferState`
--
DROP TABLE IF EXISTS `bulkTransferState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferState` (
`bulkTransferStateId` varchar(50) NOT NULL,
`enumeration` varchar(50) NOT NULL COMMENT 'bulkTransferState associated to the Mojaloop API',
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferStateId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bulkTransferStateChange`
--
DROP TABLE IF EXISTS `bulkTransferStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulkTransferStateChange` (
`bulkTransferStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`bulkTransferId` varchar(36) NOT NULL,
`bulkTransferStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`bulkTransferStateChangeId`),
KEY `bulktransferstatechange_bulktransferid_index` (`bulkTransferId`),
KEY `bulktransferstatechange_bulktransferstateid_index` (`bulkTransferStateId`),
CONSTRAINT `bulktransferstatechange_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`),
CONSTRAINT `bulktransferstatechange_bulktransferstateid_foreign` FOREIGN KEY (`bulkTransferStateId`) REFERENCES `bulkTransferState` (`bulktransferstateid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `contactType`
--
DROP TABLE IF EXISTS `contactType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `contactType` (
`contactTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`contactTypeId`),
UNIQUE KEY `contacttype_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `currency`
--
DROP TABLE IF EXISTS `currency`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `currency` (
`currencyId` varchar(3) NOT NULL,
`name` varchar(128) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`scale` int(10) unsigned NOT NULL DEFAULT '4',
PRIMARY KEY (`currencyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `endpointType`
--
DROP TABLE IF EXISTS `endpointType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `endpointType` (
`endpointTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`endpointTypeId`),
UNIQUE KEY `endpointtype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `event`
--
DROP TABLE IF EXISTS `event`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `event` (
`eventId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`eventId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `expiringTransfer`
--
DROP TABLE IF EXISTS `expiringTransfer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `expiringTransfer` (
`expiringTransferId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferId` varchar(36) NOT NULL,
`expirationDate` datetime NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`expiringTransferId`),
UNIQUE KEY `expiringtransfer_transferid_unique` (`transferId`),
KEY `expiringtransfer_expirationdate_index` (`expirationDate`),
CONSTRAINT `expiringtransfer_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `geoCode`
--
DROP TABLE IF EXISTS `geoCode`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `geoCode` (
`geoCodeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`quotePartyId` bigint(20) unsigned NOT NULL COMMENT 'Optionally the GeoCode for the Payer/Payee may have been provided. If the Quote Response has the GeoCode for the Payee, an additional row is added',
`latitude` varchar(50) NOT NULL COMMENT 'Latitude of the initiating Party',
`longitude` varchar(50) NOT NULL COMMENT 'Longitude of the initiating Party',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`geoCodeId`),
KEY `geocode_quotepartyid_foreign` (`quotePartyId`),
CONSTRAINT `geocode_quotepartyid_foreign` FOREIGN KEY (`quotePartyId`) REFERENCES `quoteParty` (`quotepartyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ilpPacket`
--
DROP TABLE IF EXISTS `ilpPacket`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ilpPacket` (
`transferId` varchar(36) NOT NULL,
`value` text NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`),
CONSTRAINT `ilppacket_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ledgerAccountType`
--
DROP TABLE IF EXISTS `ledgerAccountType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ledgerAccountType` (
`ledgerAccountTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`isSettleable` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`ledgerAccountTypeId`),
UNIQUE KEY `ledgeraccounttype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ledgerEntryType`
--
DROP TABLE IF EXISTS `ledgerEntryType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ledgerEntryType` (
`ledgerEntryTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ledgerAccountTypeId` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`ledgerEntryTypeId`),
UNIQUE KEY `ledgerentrytype_name_unique` (`name`),
KEY `ledgerentrytype_ledgeraccounttypeid_foreign` (`ledgerAccountTypeId`),
CONSTRAINT `ledgerentrytype_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `migration`
--
DROP TABLE IF EXISTS `migration`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migration` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`batch` int(11) DEFAULT NULL,
`migration_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `migration_lock`
--
DROP TABLE IF EXISTS `migration_lock`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migration_lock` (
`index` int(10) unsigned NOT NULL AUTO_INCREMENT,
`is_locked` int(11) DEFAULT NULL,
PRIMARY KEY (`index`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participant`
--
DROP TABLE IF EXISTS `participant`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participant` (
`participantId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(256) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdBy` varchar(128) NOT NULL,
PRIMARY KEY (`participantId`),
UNIQUE KEY `participant_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantContact`
--
DROP TABLE IF EXISTS `participantContact`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantContact` (
`participantContactId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`participantId` int(10) unsigned NOT NULL,
`contactTypeId` int(10) unsigned NOT NULL,
`value` varchar(256) NOT NULL,
`priorityPreference` int(11) NOT NULL DEFAULT '9',
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdBy` varchar(128) NOT NULL,
PRIMARY KEY (`participantContactId`),
KEY `participantcontact_participantid_index` (`participantId`),
KEY `participantcontact_contacttypeid_index` (`contactTypeId`),
CONSTRAINT `participantcontact_contacttypeid_foreign` FOREIGN KEY (`contactTypeId`) REFERENCES `contactType` (`contacttypeid`),
CONSTRAINT `participantcontact_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantCurrency`
--
DROP TABLE IF EXISTS `participantCurrency`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantCurrency` (
`participantCurrencyId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`participantId` int(10) unsigned NOT NULL,
`currencyId` varchar(3) NOT NULL,
`ledgerAccountTypeId` int(10) unsigned NOT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdBy` varchar(128) NOT NULL,
PRIMARY KEY (`participantCurrencyId`),
UNIQUE KEY `participantcurrency_pcl_unique` (`participantId`,`currencyId`,`ledgerAccountTypeId`),
KEY `participantcurrency_ledgeraccounttypeid_foreign` (`ledgerAccountTypeId`),
KEY `participantcurrency_participantid_index` (`participantId`),
KEY `participantcurrency_currencyid_index` (`currencyId`),
CONSTRAINT `participantcurrency_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `participantcurrency_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`),
CONSTRAINT `participantcurrency_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantEndpoint`
--
DROP TABLE IF EXISTS `participantEndpoint`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantEndpoint` (
`participantEndpointId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`participantId` int(10) unsigned NOT NULL,
`endpointTypeId` int(10) unsigned NOT NULL,
`value` varchar(512) NOT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdBy` varchar(128) NOT NULL,
PRIMARY KEY (`participantEndpointId`),
KEY `participantendpoint_participantid_index` (`participantId`),
KEY `participantendpoint_endpointtypeid_index` (`endpointTypeId`),
CONSTRAINT `participantendpoint_endpointtypeid_foreign` FOREIGN KEY (`endpointTypeId`) REFERENCES `endpointType` (`endpointtypeid`),
CONSTRAINT `participantendpoint_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantLimit`
--
DROP TABLE IF EXISTS `participantLimit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantLimit` (
`participantLimitId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`participantCurrencyId` int(10) unsigned NOT NULL,
`participantLimitTypeId` int(10) unsigned NOT NULL,
`value` decimal(18,4) NOT NULL DEFAULT '0.0000',
`thresholdAlarmPercentage` decimal(5,2) NOT NULL DEFAULT '10.00',
`startAfterParticipantPositionChangeId` bigint(20) unsigned DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdBy` varchar(128) NOT NULL,
PRIMARY KEY (`participantLimitId`),
KEY `participantlimit_participantcurrencyid_index` (`participantCurrencyId`),
KEY `participantlimit_participantlimittypeid_index` (`participantLimitTypeId`),
KEY `participantlimit_startafterparticipantpositionchangeid_index` (`startAfterParticipantPositionChangeId`),
CONSTRAINT `participantlimit_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
CONSTRAINT `participantlimit_participantlimittypeid_foreign` FOREIGN KEY (`participantLimitTypeId`) REFERENCES `participantLimitType` (`participantlimittypeid`),
CONSTRAINT `participantlimit_startafterparticipantpositionchangeid_foreign` FOREIGN KEY (`startAfterParticipantPositionChangeId`) REFERENCES `participantPositionChange` (`participantpositionchangeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantLimitType`
--
DROP TABLE IF EXISTS `participantLimitType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantLimitType` (
`participantLimitTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`participantLimitTypeId`),
UNIQUE KEY `participantlimittype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantParty`
--
DROP TABLE IF EXISTS `participantParty`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantParty` (
`participantPartyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`participantId` int(10) unsigned NOT NULL,
`partyId` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`participantPartyId`),
UNIQUE KEY `participantparty_participantid_partyid_unique` (`participantId`,`partyId`),
KEY `participantparty_participantid_index` (`participantId`),
CONSTRAINT `participantparty_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantPosition`
--
DROP TABLE IF EXISTS `participantPosition`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantPosition` (
`participantPositionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`participantCurrencyId` int(10) unsigned NOT NULL,
`value` decimal(18,4) NOT NULL,
`reservedValue` decimal(18,4) NOT NULL,
`changedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`participantPositionId`),
KEY `participantposition_participantcurrencyid_index` (`participantCurrencyId`),
CONSTRAINT `participantposition_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `participantPositionChange`
--
DROP TABLE IF EXISTS `participantPositionChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participantPositionChange` (
`participantPositionChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`participantPositionId` bigint(20) unsigned NOT NULL,
`transferStateChangeId` bigint(20) unsigned NOT NULL,
`value` decimal(18,4) NOT NULL,
`reservedValue` decimal(18,4) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`participantPositionChangeId`),
KEY `participantpositionchange_participantpositionid_index` (`participantPositionId`),
KEY `participantpositionchange_transferstatechangeid_index` (`transferStateChangeId`),
CONSTRAINT `participantpositionchange_participantpositionid_foreign` FOREIGN KEY (`participantPositionId`) REFERENCES `participantPosition` (`participantpositionid`),
CONSTRAINT `participantpositionchange_transferstatechangeid_foreign` FOREIGN KEY (`transferStateChangeId`) REFERENCES `transferStateChange` (`transferstatechangeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `party`
--
DROP TABLE IF EXISTS `party`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `party` (
`partyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`quotePartyId` bigint(20) unsigned NOT NULL,
`firstName` varchar(128) DEFAULT NULL,
`middleName` varchar(128) DEFAULT NULL,
`lastName` varchar(128) DEFAULT NULL,
`dateOfBirth` datetime DEFAULT NULL,
PRIMARY KEY (`partyId`),
KEY `party_quotepartyid_foreign` (`quotePartyId`),
CONSTRAINT `party_quotepartyid_foreign` FOREIGN KEY (`quotePartyId`) REFERENCES `quoteParty` (`quotepartyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Optional pers. data provided during Quote Request & Response';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `partyIdentifierType`
--
DROP TABLE IF EXISTS `partyIdentifierType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `partyIdentifierType` (
`partyIdentifierTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) NOT NULL,
PRIMARY KEY (`partyIdentifierTypeId`),
UNIQUE KEY `partyidentifiertype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `partyType`
--
DROP TABLE IF EXISTS `partyType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `partyType` (
`partyTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`description` varchar(256) NOT NULL,
PRIMARY KEY (`partyTypeId`),
UNIQUE KEY `partytype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quote`
--
DROP TABLE IF EXISTS `quote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quote` (
`quoteId` varchar(36) NOT NULL,
`transactionReferenceId` varchar(36) NOT NULL COMMENT 'Common ID (decided by the Payer FSP) between the FSPs for the future transaction object',
`transactionRequestId` varchar(36) DEFAULT NULL COMMENT 'Optional previously-sent transaction request',
`note` text COMMENT 'A memo that will be attached to the transaction',
`expirationDate` datetime DEFAULT NULL COMMENT 'Optional expiration for the requested transaction',
`transactionInitiatorId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction initiator',
`transactionInitiatorTypeId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction initiator type',
`transactionScenarioId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction scenario',
`balanceOfPaymentsId` int(10) unsigned DEFAULT NULL COMMENT 'This is part of the transaction type that contains the elements- balance of payment',
`transactionSubScenarioId` int(10) unsigned DEFAULT NULL COMMENT 'This is part of the transaction type sub scenario as defined by the local scheme',
`amountTypeId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction type that contains valid elements for - Amount Type',
`amount` decimal(18,4) NOT NULL DEFAULT '0.0000' COMMENT 'The amount that the quote is being requested for. Need to be interpert in accordance with the amount type',
`currencyId` varchar(255) DEFAULT NULL COMMENT 'Trading currency pertaining to the Amount',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`quoteId`),
KEY `quote_transactionreferenceid_foreign` (`transactionReferenceId`),
KEY `quote_transactionrequestid_foreign` (`transactionRequestId`),
KEY `quote_transactioninitiatorid_foreign` (`transactionInitiatorId`),
KEY `quote_transactioninitiatortypeid_foreign` (`transactionInitiatorTypeId`),
KEY `quote_transactionscenarioid_foreign` (`transactionScenarioId`),
KEY `quote_balanceofpaymentsid_foreign` (`balanceOfPaymentsId`),
KEY `quote_transactionsubscenarioid_foreign` (`transactionSubScenarioId`),
KEY `quote_amounttypeid_foreign` (`amountTypeId`),
KEY `quote_currencyid_foreign` (`currencyId`),
CONSTRAINT `quote_amounttypeid_foreign` FOREIGN KEY (`amountTypeId`) REFERENCES `amountType` (`amounttypeid`),
CONSTRAINT `quote_balanceofpaymentsid_foreign` FOREIGN KEY (`balanceOfPaymentsId`) REFERENCES `balanceOfPayments` (`balanceofpaymentsid`),
CONSTRAINT `quote_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `quote_transactioninitiatorid_foreign` FOREIGN KEY (`transactionInitiatorId`) REFERENCES `transactionInitiator` (`transactioninitiatorid`),
CONSTRAINT `quote_transactioninitiatortypeid_foreign` FOREIGN KEY (`transactionInitiatorTypeId`) REFERENCES `transactionInitiatorType` (`transactioninitiatortypeid`),
CONSTRAINT `quote_transactionreferenceid_foreign` FOREIGN KEY (`transactionReferenceId`) REFERENCES `transactionReference` (`transactionreferenceid`),
CONSTRAINT `quote_transactionrequestid_foreign` FOREIGN KEY (`transactionRequestId`) REFERENCES `transactionReference` (`transactionreferenceid`),
CONSTRAINT `quote_transactionscenarioid_foreign` FOREIGN KEY (`transactionScenarioId`) REFERENCES `transactionScenario` (`transactionscenarioid`),
CONSTRAINT `quote_transactionsubscenarioid_foreign` FOREIGN KEY (`transactionSubScenarioId`) REFERENCES `transactionSubScenario` (`transactionsubscenarioid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quoteDuplicateCheck`
--
DROP TABLE IF EXISTS `quoteDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteDuplicateCheck` (
`quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`hash` varchar(1024) DEFAULT NULL COMMENT 'hash value received for the quote request',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`quoteId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quoteError`
--
DROP TABLE IF EXISTS `quoteError`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteError` (
`quoteErrorId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`quoteResponseId` bigint(20) unsigned DEFAULT NULL COMMENT 'The response to the intial quote',
`errorCode` int(10) unsigned NOT NULL,
`errorDescription` varchar(128) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`quoteErrorId`),
KEY `quoteerror_quoteid_foreign` (`quoteId`),
KEY `quoteerror_quoteresponseid_foreign` (`quoteResponseId`),
CONSTRAINT `quoteerror_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
CONSTRAINT `quoteerror_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quoteExtension`
--
DROP TABLE IF EXISTS `quoteExtension`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteExtension` (
`quoteExtensionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`quoteResponseId` bigint(20) unsigned NOT NULL COMMENT 'The response to the intial quote',
`transactionId` varchar(36) NOT NULL COMMENT 'The transaction reference that is part of the initial quote',
`key` varchar(128) NOT NULL,
`value` text NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`quoteExtensionId`),
KEY `quoteextension_quoteid_foreign` (`quoteId`),
KEY `quoteextension_quoteresponseid_foreign` (`quoteResponseId`),
KEY `quoteextension_transactionid_foreign` (`transactionId`),
CONSTRAINT `quoteextension_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
CONSTRAINT `quoteextension_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`),
CONSTRAINT `quoteextension_transactionid_foreign` FOREIGN KEY (`transactionId`) REFERENCES `transactionReference` (`transactionreferenceid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quoteParty`
--
DROP TABLE IF EXISTS `quoteParty`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteParty` (
`quotePartyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`partyTypeId` int(10) unsigned NOT NULL COMMENT 'Specifies the type of party this row relates to; typically PAYER or PAYEE',
`partyIdentifierTypeId` int(10) unsigned NOT NULL COMMENT 'Specifies the type of identifier used to identify this party e.g. MSISDN, IBAN etc...',
`partyIdentifierValue` varchar(128) NOT NULL COMMENT 'The value of the identifier used to identify this party',
`partySubIdOrTypeId` int(10) unsigned DEFAULT NULL COMMENT 'A sub-identifier or sub-type for the Party',
`fspId` varchar(255) DEFAULT NULL COMMENT 'This is the FSP ID as provided in the quote. For the switch between multi-parties it is required',
`participantId` int(10) unsigned DEFAULT NULL COMMENT 'Reference to the resolved FSP ID (if supplied/known). If not an error will be reported',
`merchantClassificationCode` varchar(4) DEFAULT NULL COMMENT 'Used in the context of Payee Information, where the Payee happens to be a merchant accepting merchant payments',
`partyName` varchar(128) DEFAULT NULL COMMENT 'Display name of the Party, could be a real name or a nick name',
`transferParticipantRoleTypeId` int(10) unsigned NOT NULL COMMENT 'The role this Party is playing in the transaction',
`ledgerEntryTypeId` int(10) unsigned NOT NULL COMMENT 'The type of financial entry this Party is presenting',
`amount` decimal(18,4) NOT NULL,
`currencyId` varchar(3) NOT NULL COMMENT 'Trading currency pertaining to the party amount',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`quotePartyId`),
KEY `quoteparty_quoteid_foreign` (`quoteId`),
KEY `quoteparty_partytypeid_foreign` (`partyTypeId`),
KEY `quoteparty_partyidentifiertypeid_foreign` (`partyIdentifierTypeId`),
KEY `quoteparty_partysubidortypeid_foreign` (`partySubIdOrTypeId`),
KEY `quoteparty_participantid_foreign` (`participantId`),
KEY `quoteparty_transferparticipantroletypeid_foreign` (`transferParticipantRoleTypeId`),
KEY `quoteparty_ledgerentrytypeid_foreign` (`ledgerEntryTypeId`),
KEY `quoteparty_currencyid_foreign` (`currencyId`),
CONSTRAINT `quoteparty_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `quoteparty_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
CONSTRAINT `quoteparty_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`),
CONSTRAINT `quoteparty_partyidentifiertypeid_foreign` FOREIGN KEY (`partyIdentifierTypeId`) REFERENCES `partyIdentifierType` (`partyidentifiertypeid`),
CONSTRAINT `quoteparty_partysubidortypeid_foreign` FOREIGN KEY (`partySubIdOrTypeId`) REFERENCES `partyIdentifierType` (`partyidentifiertypeid`),
CONSTRAINT `quoteparty_partytypeid_foreign` FOREIGN KEY (`partyTypeId`) REFERENCES `partyType` (`partytypeid`),
CONSTRAINT `quoteparty_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
CONSTRAINT `quoteparty_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary view structure for view `quotePartyView`
--
DROP TABLE IF EXISTS `quotePartyView`;
/*!50001 DROP VIEW IF EXISTS `quotePartyView`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `quotePartyView` AS SELECT
1 AS `quoteId`,
1 AS `quotePartyId`,
1 AS `partyType`,
1 AS `identifierType`,
1 AS `partyIdentifierValue`,
1 AS `partySubIdOrType`,
1 AS `fspId`,
1 AS `merchantClassificationCode`,
1 AS `partyName`,
1 AS `firstName`,
1 AS `lastName`,
1 AS `middleName`,
1 AS `dateOfBirth`,
1 AS `longitude`,
1 AS `latitude`*/;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `quoteResponse`
--
DROP TABLE IF EXISTS `quoteResponse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteResponse` (
`quoteResponseId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`transferAmountCurrencyId` varchar(3) NOT NULL COMMENT 'CurrencyId of the transfer amount',
`transferAmount` decimal(18,4) NOT NULL COMMENT 'The amount of money that the Payer FSP should transfer to the Payee FSP',
`payeeReceiveAmountCurrencyId` varchar(3) DEFAULT NULL COMMENT 'CurrencyId of the payee receive amount',
`payeeReceiveAmount` decimal(18,4) DEFAULT NULL COMMENT 'The amount of Money that the Payee should receive in the end-to-end transaction. Optional as the Payee FSP might not want to disclose any optional Payee fees',
`payeeFspFeeCurrencyId` varchar(3) DEFAULT NULL COMMENT 'CurrencyId of the payee fsp fee amount',
`payeeFspFeeAmount` decimal(18,4) DEFAULT NULL COMMENT 'Payee FSP’s part of the transaction fee',
`payeeFspCommissionCurrencyId` varchar(3) DEFAULT NULL COMMENT 'CurrencyId of the payee fsp commission amount',
`payeeFspCommissionAmount` decimal(18,4) DEFAULT NULL COMMENT 'Transaction commission from the Payee FSP',
`ilpCondition` varchar(256) NOT NULL,
`responseExpirationDate` datetime DEFAULT NULL COMMENT 'Optional expiration for the requested transaction',
`isValid` tinyint(1) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`quoteResponseId`),
KEY `quoteresponse_quoteid_foreign` (`quoteId`),
KEY `quoteresponse_transferamountcurrencyid_foreign` (`transferAmountCurrencyId`),
KEY `quoteresponse_payeereceiveamountcurrencyid_foreign` (`payeeReceiveAmountCurrencyId`),
KEY `quoteresponse_payeefspcommissioncurrencyid_foreign` (`payeeFspCommissionCurrencyId`),
CONSTRAINT `quoteresponse_payeefspcommissioncurrencyid_foreign` FOREIGN KEY (`payeeFspCommissionCurrencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `quoteresponse_payeereceiveamountcurrencyid_foreign` FOREIGN KEY (`payeeReceiveAmountCurrencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `quoteresponse_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
CONSTRAINT `quoteresponse_transferamountcurrencyid_foreign` FOREIGN KEY (`transferAmountCurrencyId`) REFERENCES `currency` (`currencyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='This table is the primary store for quote responses';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quoteResponseDuplicateCheck`
--
DROP TABLE IF EXISTS `quoteResponseDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteResponseDuplicateCheck` (
`quoteResponseId` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'The response to the intial quote',
`quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`hash` varchar(255) DEFAULT NULL COMMENT 'hash value received for the quote response',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`quoteResponseId`),
KEY `quoteresponseduplicatecheck_quoteid_foreign` (`quoteId`),
CONSTRAINT `quoteresponseduplicatecheck_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
CONSTRAINT `quoteresponseduplicatecheck_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `quoteResponseIlpPacket`
--
DROP TABLE IF EXISTS `quoteResponseIlpPacket`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quoteResponseIlpPacket` (
`quoteResponseId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`value` text NOT NULL COMMENT 'ilpPacket returned from Payee in response to a quote request',
PRIMARY KEY (`quoteResponseId`),
CONSTRAINT `quoteresponseilppacket_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary view structure for view `quoteResponseView`
--
DROP TABLE IF EXISTS `quoteResponseView`;
/*!50001 DROP VIEW IF EXISTS `quoteResponseView`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `quoteResponseView` AS SELECT
1 AS `quoteResponseId`,
1 AS `quoteId`,
1 AS `transferAmountCurrencyId`,
1 AS `transferAmount`,
1 AS `payeeReceiveAmountCurrencyId`,
1 AS `payeeReceiveAmount`,
1 AS `payeeFspFeeCurrencyId`,
1 AS `payeeFspFeeAmount`,
1 AS `payeeFspCommissionCurrencyId`,
1 AS `payeeFspCommissionAmount`,
1 AS `ilpCondition`,
1 AS `responseExpirationDate`,
1 AS `isValid`,
1 AS `createdDate`,
1 AS `ilpPacket`,
1 AS `longitude`,
1 AS `latitude`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `quoteView`
--
DROP TABLE IF EXISTS `quoteView`;
/*!50001 DROP VIEW IF EXISTS `quoteView`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `quoteView` AS SELECT
1 AS `quoteId`,
1 AS `transactionReferenceId`,
1 AS `transactionRequestId`,
1 AS `note`,
1 AS `expirationDate`,
1 AS `transactionInitiator`,
1 AS `transactionInitiatorType`,
1 AS `transactionScenario`,
1 AS `balanceOfPaymentsId`,
1 AS `transactionSubScenario`,
1 AS `amountType`,
1 AS `amount`,
1 AS `currency`*/;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `segment`
--
DROP TABLE IF EXISTS `segment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `segment` (
`segmentId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`segmentType` varchar(50) NOT NULL,
`enumeration` int(11) NOT NULL DEFAULT '0',
`tableName` varchar(50) NOT NULL,
`value` bigint(20) NOT NULL,
`changedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`segmentId`),
KEY `segment_keys_index` (`segmentType`,`enumeration`,`tableName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlement`
--
DROP TABLE IF EXISTS `settlement`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlement` (
`settlementId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
`settlementModelId` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`settlementId`),
KEY `settlement_currentstatechangeid_foreign` (`currentStateChangeId`),
KEY `settlement_settlementmodelid_foreign` (`settlementModelId`),
CONSTRAINT `settlement_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementStateChange` (`settlementstatechangeid`),
CONSTRAINT `settlement_settlementmodelid_foreign` FOREIGN KEY (`settlementModelId`) REFERENCES `settlementModel` (`settlementmodelid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementContentAggregation`
--
DROP TABLE IF EXISTS `settlementContentAggregation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementContentAggregation` (
`settlementContentAggregationId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementWindowContentId` bigint(20) unsigned NOT NULL,
`participantCurrencyId` int(10) unsigned NOT NULL,
`transferParticipantRoleTypeId` int(10) unsigned NOT NULL,
`ledgerEntryTypeId` int(10) unsigned NOT NULL,
`amount` decimal(18,2) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`currentStateId` varchar(50) NOT NULL,
`settlementId` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`settlementContentAggregationId`),
KEY `settlementcontentaggregation_settlementwindowcontentid_index` (`settlementWindowContentId`),
KEY `settlementcontentaggregation_participantcurrencyid_index` (`participantCurrencyId`),
KEY `settlementcontentaggregation_transferparticipantroletypeid_index` (`transferParticipantRoleTypeId`),
KEY `settlementcontentaggregation_ledgerentrytypeid_index` (`ledgerEntryTypeId`),
KEY `settlementcontentaggregation_currentstateid_index` (`currentStateId`),
KEY `settlementcontentaggregation_settlementid_index` (`settlementId`),
CONSTRAINT `sca_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`),
CONSTRAINT `settlementcontentaggregation_currentstateid_foreign` FOREIGN KEY (`currentStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`),
CONSTRAINT `settlementcontentaggregation_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
CONSTRAINT `settlementcontentaggregation_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
CONSTRAINT `settlementcontentaggregation_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
CONSTRAINT `settlementcontentaggregation_settlementwindowcontentid_foreign` FOREIGN KEY (`settlementWindowContentId`) REFERENCES `settlementWindowContent` (`settlementwindowcontentid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementDelay`
--
DROP TABLE IF EXISTS `settlementDelay`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementDelay` (
`settlementDelayId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`settlementDelayId`),
UNIQUE KEY `settlementdelay_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementGranularity`
--
DROP TABLE IF EXISTS `settlementGranularity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementGranularity` (
`settlementGranularityId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`settlementGranularityId`),
UNIQUE KEY `settlementgranularity_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementInterchange`
--
DROP TABLE IF EXISTS `settlementInterchange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementInterchange` (
`settlementInterchangeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`settlementInterchangeId`),
UNIQUE KEY `settlementinterchange_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementModel`
--
DROP TABLE IF EXISTS `settlementModel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementModel` (
`settlementModelId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`settlementGranularityId` int(10) unsigned NOT NULL,
`settlementInterchangeId` int(10) unsigned NOT NULL,
`settlementDelayId` int(10) unsigned NOT NULL,
`currencyId` varchar(3) DEFAULT NULL,
`requireLiquidityCheck` tinyint(1) NOT NULL DEFAULT '1',
`ledgerAccountTypeId` int(10) unsigned NOT NULL,
`autoPositionReset` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`settlementModelId`),
UNIQUE KEY `settlementmodel_name_unique` (`name`),
KEY `settlementmodel_settlementgranularityid_index` (`settlementGranularityId`),
KEY `settlementmodel_settlementinterchangeid_index` (`settlementInterchangeId`),
KEY `settlementmodel_settlementdelayid_index` (`settlementDelayId`),
KEY `settlementmodel_currencyid_index` (`currencyId`),
KEY `settlementmodel_ledgeraccounttypeid_index` (`ledgerAccountTypeId`),
CONSTRAINT `settlementmodel_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `settlementmodel_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`),
CONSTRAINT `settlementmodel_settlementdelayid_foreign` FOREIGN KEY (`settlementDelayId`) REFERENCES `settlementDelay` (`settlementdelayid`),
CONSTRAINT `settlementmodel_settlementgranularityid_foreign` FOREIGN KEY (`settlementGranularityId`) REFERENCES `settlementGranularity` (`settlementgranularityid`),
CONSTRAINT `settlementmodel_settlementinterchangeid_foreign` FOREIGN KEY (`settlementInterchangeId`) REFERENCES `settlementInterchange` (`settlementinterchangeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementParticipantCurrency`
--
DROP TABLE IF EXISTS `settlementParticipantCurrency`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementParticipantCurrency` (
`settlementParticipantCurrencyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementId` bigint(20) unsigned NOT NULL,
`participantCurrencyId` int(10) unsigned NOT NULL,
`netAmount` decimal(18,4) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
`settlementTransferId` varchar(36) DEFAULT NULL,
PRIMARY KEY (`settlementParticipantCurrencyId`),
KEY `settlementparticipantcurrency_settlementid_index` (`settlementId`),
KEY `settlementparticipantcurrency_participantcurrencyid_index` (`participantCurrencyId`),
KEY `settlementparticipantcurrency_settlementtransferid_index` (`settlementTransferId`),
KEY `spc_currentstatechangeid_foreign` (`currentStateChangeId`),
CONSTRAINT `settlementparticipantcurrency_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
CONSTRAINT `settlementparticipantcurrency_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
CONSTRAINT `spc_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementParticipantCurrencyStateChange` (`settlementparticipantcurrencystatechangeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementParticipantCurrencyStateChange`
--
DROP TABLE IF EXISTS `settlementParticipantCurrencyStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementParticipantCurrencyStateChange` (
`settlementParticipantCurrencyStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementParticipantCurrencyId` bigint(20) unsigned NOT NULL,
`settlementStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`externalReference` varchar(50) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementParticipantCurrencyStateChangeId`),
KEY `spcsc_settlementparticipantcurrencyid_index` (`settlementParticipantCurrencyId`),
KEY `spcsc_settlementstateid_index` (`settlementStateId`),
CONSTRAINT `spcsc_settlementparticipantcurrencyid_foreign` FOREIGN KEY (`settlementParticipantCurrencyId`) REFERENCES `settlementParticipantCurrency` (`settlementparticipantcurrencyid`),
CONSTRAINT `spcsc_settlementstateid_foreign` FOREIGN KEY (`settlementStateId`) REFERENCES `settlementState` (`settlementstateid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementSettlementWindow`
--
DROP TABLE IF EXISTS `settlementSettlementWindow`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementSettlementWindow` (
`settlementSettlementWindowId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementId` bigint(20) unsigned NOT NULL,
`settlementWindowId` bigint(20) unsigned NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementSettlementWindowId`),
UNIQUE KEY `settlementsettlementwindow_unique` (`settlementId`,`settlementWindowId`),
KEY `settlementsettlementwindow_settlementid_index` (`settlementId`),
KEY `settlementsettlementwindow_settlementwindowid_index` (`settlementWindowId`),
CONSTRAINT `settlementsettlementwindow_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
CONSTRAINT `settlementsettlementwindow_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementState`
--
DROP TABLE IF EXISTS `settlementState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementState` (
`settlementStateId` varchar(50) NOT NULL,
`enumeration` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementStateId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementStateChange`
--
DROP TABLE IF EXISTS `settlementStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementStateChange` (
`settlementStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementId` bigint(20) unsigned NOT NULL,
`settlementStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementStateChangeId`),
KEY `settlementstatechange_settlementid_index` (`settlementId`),
KEY `settlementstatechange_settlementstateid_index` (`settlementStateId`),
CONSTRAINT `settlementstatechange_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
CONSTRAINT `settlementstatechange_settlementstateid_foreign` FOREIGN KEY (`settlementStateId`) REFERENCES `settlementState` (`settlementstateid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementTransferParticipant`
--
DROP TABLE IF EXISTS `settlementTransferParticipant`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementTransferParticipant` (
`settlementTransferParticipantId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementId` bigint(20) unsigned NOT NULL,
`settlementWindowId` bigint(20) unsigned NOT NULL,
`participantCurrencyId` int(10) unsigned NOT NULL,
`transferParticipantRoleTypeId` int(10) unsigned NOT NULL,
`ledgerEntryTypeId` int(10) unsigned NOT NULL,
`amount` decimal(18,4) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementTransferParticipantId`),
KEY `settlementtransferparticipant_settlementid_index` (`settlementId`),
KEY `settlementtransferparticipant_settlementwindowid_index` (`settlementWindowId`),
KEY `settlementtransferparticipant_participantcurrencyid_index` (`participantCurrencyId`),
KEY `stp_transferparticipantroletypeid_index` (`transferParticipantRoleTypeId`),
KEY `settlementtransferparticipant_ledgerentrytypeid_index` (`ledgerEntryTypeId`),
CONSTRAINT `settlementtransferparticipant_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
CONSTRAINT `settlementtransferparticipant_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
CONSTRAINT `settlementtransferparticipant_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
CONSTRAINT `settlementtransferparticipant_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`),
CONSTRAINT `stp_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementWindow`
--
DROP TABLE IF EXISTS `settlementWindow`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementWindow` (
`settlementWindowId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`settlementWindowId`),
KEY `settlementwindow_currentstatechangeid_foreign` (`currentStateChangeId`),
CONSTRAINT `settlementwindow_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementWindowStateChange` (`settlementwindowstatechangeid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementWindowContent`
--
DROP TABLE IF EXISTS `settlementWindowContent`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementWindowContent` (
`settlementWindowContentId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementWindowId` bigint(20) unsigned NOT NULL,
`ledgerAccountTypeId` int(10) unsigned NOT NULL,
`currencyId` varchar(3) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
`settlementId` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`settlementWindowContentId`),
KEY `settlementwindowcontent_settlementwindowid_index` (`settlementWindowId`),
KEY `settlementwindowcontent_ledgeraccounttypeid_index` (`ledgerAccountTypeId`),
KEY `settlementwindowcontent_currencyid_index` (`currencyId`),
KEY `settlementwindowcontent_currentstatechangeid_index` (`currentStateChangeId`),
KEY `settlementwindowcontent_settlementid_index` (`settlementId`),
CONSTRAINT `settlementwindowcontent_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `settlementwindowcontent_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementWindowContentStateChange` (`settlementwindowcontentstatechangeid`),
CONSTRAINT `settlementwindowcontent_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`),
CONSTRAINT `settlementwindowcontent_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
CONSTRAINT `settlementwindowcontent_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementWindowContentStateChange`
--
DROP TABLE IF EXISTS `settlementWindowContentStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementWindowContentStateChange` (
`settlementWindowContentStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementWindowContentId` bigint(20) unsigned NOT NULL,
`settlementWindowStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementWindowContentStateChangeId`),
KEY `swcsc_settlementwindowcontentid_index` (`settlementWindowContentId`),
KEY `swcsc_settlementwindowstateid_index` (`settlementWindowStateId`),
CONSTRAINT `swc_settlementwindowcontentid_foreign` FOREIGN KEY (`settlementWindowContentId`) REFERENCES `settlementWindowContent` (`settlementwindowcontentid`),
CONSTRAINT `sws1_settlementwindowstateid_foreign` FOREIGN KEY (`settlementWindowStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementWindowState`
--
DROP TABLE IF EXISTS `settlementWindowState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementWindowState` (
`settlementWindowStateId` varchar(50) NOT NULL,
`enumeration` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementWindowStateId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `settlementWindowStateChange`
--
DROP TABLE IF EXISTS `settlementWindowStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settlementWindowStateChange` (
`settlementWindowStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`settlementWindowId` bigint(20) unsigned NOT NULL,
`settlementWindowStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`settlementWindowStateChangeId`),
KEY `settlementwindowstatechange_settlementwindowid_index` (`settlementWindowId`),
KEY `settlementwindowstatechange_settlementwindowstateid_index` (`settlementWindowStateId`),
CONSTRAINT `settlementwindowstatechange_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`),
CONSTRAINT `settlementwindowstatechange_settlementwindowstateid_foreign` FOREIGN KEY (`settlementWindowStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `token`
--
DROP TABLE IF EXISTS `token`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `token` (
`tokenId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`participantId` int(10) unsigned NOT NULL,
`value` varchar(256) NOT NULL,
`expiration` bigint(20) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`tokenId`),
UNIQUE KEY `token_value_unique` (`value`),
KEY `token_participantid_index` (`participantId`),
CONSTRAINT `token_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transactionInitiator`
--
DROP TABLE IF EXISTS `transactionInitiator`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transactionInitiator` (
`transactionInitiatorId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(256) NOT NULL,
`description` varchar(1024) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`transactionInitiatorId`),
UNIQUE KEY `transactioninitiator_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transactionInitiatorType`
--
DROP TABLE IF EXISTS `transactionInitiatorType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transactionInitiatorType` (
`transactionInitiatorTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(256) NOT NULL,
`description` varchar(1024) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`transactionInitiatorTypeId`),
UNIQUE KEY `transactioninitiatortype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transactionReference`
--
DROP TABLE IF EXISTS `transactionReference`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transactionReference` (
`transactionReferenceId` varchar(36) NOT NULL COMMENT 'Common ID (decided by the Payer FSP) between the FSPs for the future transaction object',
`quoteId` varchar(36) DEFAULT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System row creation timestamp',
PRIMARY KEY (`transactionReferenceId`),
KEY `transactionreference_quoteid_index` (`quoteId`),
CONSTRAINT `transactionreference_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quoteDuplicateCheck` (`quoteid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transactionScenario`
--
DROP TABLE IF EXISTS `transactionScenario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transactionScenario` (
`transactionScenarioId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(256) NOT NULL,
`description` varchar(1024) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`transactionScenarioId`),
UNIQUE KEY `transactionscenario_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transactionSubScenario`
--
DROP TABLE IF EXISTS `transactionSubScenario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transactionSubScenario` (
`transactionSubScenarioId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(256) NOT NULL,
`description` varchar(1024) DEFAULT NULL COMMENT 'Possible sub-scenario, defined locally within the scheme',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
PRIMARY KEY (`transactionSubScenarioId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transfer`
--
DROP TABLE IF EXISTS `transfer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transfer` (
`transferId` varchar(36) NOT NULL,
`amount` decimal(18,4) NOT NULL,
`currencyId` varchar(3) NOT NULL,
`ilpCondition` varchar(256) NOT NULL,
`expirationDate` datetime NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`),
KEY `transfer_currencyid_index` (`currencyId`),
CONSTRAINT `transfer_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
CONSTRAINT `transfer_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transferDuplicateCheck` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferDuplicateCheck`
--
DROP TABLE IF EXISTS `transferDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferDuplicateCheck` (
`transferId` varchar(36) NOT NULL,
`hash` varchar(256) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferError`
--
DROP TABLE IF EXISTS `transferError`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferError` (
`transferId` varchar(36) NOT NULL,
`transferStateChangeId` bigint(20) unsigned NOT NULL,
`errorCode` int(10) unsigned NOT NULL,
`errorDescription` varchar(128) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`),
KEY `transfererror_transferstatechangeid_foreign` (`transferStateChangeId`),
CONSTRAINT `transfererror_transferstatechangeid_foreign` FOREIGN KEY (`transferStateChangeId`) REFERENCES `transferStateChange` (`transferstatechangeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferErrorDuplicateCheck`
--
DROP TABLE IF EXISTS `transferErrorDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferErrorDuplicateCheck` (
`transferId` varchar(36) NOT NULL,
`hash` varchar(256) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`),
CONSTRAINT `transfererrorduplicatecheck_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferExtension`
--
DROP TABLE IF EXISTS `transferExtension`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferExtension` (
`transferExtensionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferId` varchar(36) NOT NULL,
`key` varchar(128) NOT NULL,
`value` text NOT NULL,
`isFulfilment` tinyint(1) NOT NULL DEFAULT '0',
`isError` tinyint(1) NOT NULL DEFAULT '0',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferExtensionId`),
KEY `transferextension_transferid_foreign` (`transferId`),
CONSTRAINT `transferextension_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferFulfilment`
--
DROP TABLE IF EXISTS `transferFulfilment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferFulfilment` (
`transferId` varchar(36) NOT NULL,
`ilpFulfilment` varchar(256) DEFAULT NULL,
`completedDate` datetime NOT NULL,
`isValid` tinyint(1) DEFAULT NULL,
`settlementWindowId` bigint(20) unsigned DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`),
KEY `transferfulfilment_settlementwindowid_foreign` (`settlementWindowId`),
CONSTRAINT `transferfulfilment_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`),
CONSTRAINT `transferfulfilment_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transferFulfilmentDuplicateCheck` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferFulfilmentDuplicateCheck`
--
DROP TABLE IF EXISTS `transferFulfilmentDuplicateCheck`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferFulfilmentDuplicateCheck` (
`transferId` varchar(36) NOT NULL,
`hash` varchar(256) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferId`),
CONSTRAINT `transferfulfilmentduplicatecheck_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferParticipant`
--
DROP TABLE IF EXISTS `transferParticipant`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferParticipant` (
`transferParticipantId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferId` varchar(36) NOT NULL,
`participantCurrencyId` int(10) unsigned NOT NULL,
`transferParticipantRoleTypeId` int(10) unsigned NOT NULL,
`ledgerEntryTypeId` int(10) unsigned NOT NULL,
`amount` decimal(18,4) NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`transferParticipantId`),
KEY `transferparticipant_transferid_index` (`transferId`),
KEY `transferparticipant_participantcurrencyid_index` (`participantCurrencyId`),
KEY `transferparticipant_transferparticipantroletypeid_index` (`transferParticipantRoleTypeId`),
KEY `transferparticipant_ledgerentrytypeid_index` (`ledgerEntryTypeId`),
KEY `transferparticipant_currentstatechangeid_foreign` (`currentStateChangeId`),
CONSTRAINT `transferparticipant_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `transferParticipantStateChange` (`transferparticipantstatechangeid`),
CONSTRAINT `transferparticipant_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
CONSTRAINT `transferparticipant_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
CONSTRAINT `transferparticipant_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`),
CONSTRAINT `transferparticipant_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferParticipantRoleType`
--
DROP TABLE IF EXISTS `transferParticipantRoleType`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferParticipantRoleType` (
`transferParticipantRoleTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferParticipantRoleTypeId`),
UNIQUE KEY `transferparticipantroletype_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferParticipantStateChange`
--
DROP TABLE IF EXISTS `transferParticipantStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferParticipantStateChange` (
`transferParticipantStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferParticipantId` bigint(20) unsigned NOT NULL,
`settlementWindowStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferParticipantStateChangeId`),
KEY `transferparticipantstatechange_transferparticipantid_index` (`transferParticipantId`),
KEY `transferparticipantstatechange_settlementwindowstateid_index` (`settlementWindowStateId`),
CONSTRAINT `transferparticipantstatechange_settlementwindowstateid_foreign` FOREIGN KEY (`settlementWindowStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`),
CONSTRAINT `transferparticipantstatechange_transferparticipantid_foreign` FOREIGN KEY (`transferParticipantId`) REFERENCES `transferParticipant` (`transferparticipantid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferRules`
--
DROP TABLE IF EXISTS `transferRules`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferRules` (
`transferRulesId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`description` varchar(512) DEFAULT NULL,
`rule` text NOT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferRulesId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferState`
--
DROP TABLE IF EXISTS `transferState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferState` (
`transferStateId` varchar(50) NOT NULL,
`enumeration` varchar(50) NOT NULL COMMENT 'transferState associated to the Mojaloop API',
`description` varchar(512) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferStateId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferStateChange`
--
DROP TABLE IF EXISTS `transferStateChange`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferStateChange` (
`transferStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferId` varchar(36) NOT NULL,
`transferStateId` varchar(50) NOT NULL,
`reason` varchar(512) DEFAULT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferStateChangeId`),
KEY `transferstatechange_transferid_index` (`transferId`),
KEY `transferstatechange_transferstateid_index` (`transferStateId`),
CONSTRAINT `transferstatechange_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`),
CONSTRAINT `transferstatechange_transferstateid_foreign` FOREIGN KEY (`transferStateId`) REFERENCES `transferState` (`transferstateid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transferTimeout`
--
DROP TABLE IF EXISTS `transferTimeout`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferTimeout` (
`transferTimeoutId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`transferId` varchar(36) NOT NULL,
`expirationDate` datetime NOT NULL,
`createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`transferTimeoutId`),
UNIQUE KEY `transfertimeout_transferid_unique` (`transferId`),
CONSTRAINT `transfertimeout_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Final view structure for view `quotePartyView`
--
/*!50001 DROP VIEW IF EXISTS `quotePartyView`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8 */;
/*!50001 SET character_set_results = utf8 */;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`central_ledger`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `quotePartyView` AS select `qp`.`quoteId` AS `quoteId`,`qp`.`quotePartyId` AS `quotePartyId`,`pt`.`name` AS `partyType`,`pit`.`name` AS `identifierType`,`qp`.`partyIdentifierValue` AS `partyIdentifierValue`,`spit`.`name` AS `partySubIdOrType`,`qp`.`fspId` AS `fspId`,`qp`.`merchantClassificationCode` AS `merchantClassificationCode`,`qp`.`partyName` AS `partyName`,`p`.`firstName` AS `firstName`,`p`.`lastName` AS `lastName`,`p`.`middleName` AS `middleName`,`p`.`dateOfBirth` AS `dateOfBirth`,`gc`.`longitude` AS `longitude`,`gc`.`latitude` AS `latitude` from (((((`quoteParty` `qp` join `partyType` `pt` on((`pt`.`partyTypeId` = `qp`.`partyTypeId`))) join `partyIdentifierType` `pit` on((`pit`.`partyIdentifierTypeId` = `qp`.`partyIdentifierTypeId`))) left join `party` `p` on((`p`.`quotePartyId` = `qp`.`quotePartyId`))) left join `partyIdentifierType` `spit` on((`spit`.`partyIdentifierTypeId` = `qp`.`partySubIdOrTypeId`))) left join `geoCode` `gc` on((`gc`.`quotePartyId` = `qp`.`quotePartyId`))) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `quoteResponseView`
--
/*!50001 DROP VIEW IF EXISTS `quoteResponseView`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8 */;
/*!50001 SET character_set_results = utf8 */;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`central_ledger`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `quoteResponseView` AS select `qr`.`quoteResponseId` AS `quoteResponseId`,`qr`.`quoteId` AS `quoteId`,`qr`.`transferAmountCurrencyId` AS `transferAmountCurrencyId`,`qr`.`transferAmount` AS `transferAmount`,`qr`.`payeeReceiveAmountCurrencyId` AS `payeeReceiveAmountCurrencyId`,`qr`.`payeeReceiveAmount` AS `payeeReceiveAmount`,`qr`.`payeeFspFeeCurrencyId` AS `payeeFspFeeCurrencyId`,`qr`.`payeeFspFeeAmount` AS `payeeFspFeeAmount`,`qr`.`payeeFspCommissionCurrencyId` AS `payeeFspCommissionCurrencyId`,`qr`.`payeeFspCommissionAmount` AS `payeeFspCommissionAmount`,`qr`.`ilpCondition` AS `ilpCondition`,`qr`.`responseExpirationDate` AS `responseExpirationDate`,`qr`.`isValid` AS `isValid`,`qr`.`createdDate` AS `createdDate`,`qrilp`.`value` AS `ilpPacket`,`gc`.`longitude` AS `longitude`,`gc`.`latitude` AS `latitude` from ((((`quoteResponse` `qr` join `quoteResponseIlpPacket` `qrilp` on((`qrilp`.`quoteResponseId` = `qr`.`quoteResponseId`))) join `quoteParty` `qp` on((`qp`.`quoteId` = `qr`.`quoteId`))) join `partyType` `pt` on((`pt`.`partyTypeId` = `qp`.`partyTypeId`))) left join `geoCode` `gc` on((`gc`.`quotePartyId` = `qp`.`quotePartyId`))) where (`pt`.`name` = 'PAYEE') */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `quoteView`
--
/*!50001 DROP VIEW IF EXISTS `quoteView`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8 */;
/*!50001 SET character_set_results = utf8 */;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`central_ledger`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `quoteView` AS select `q`.`quoteId` AS `quoteId`,`q`.`transactionReferenceId` AS `transactionReferenceId`,`q`.`transactionRequestId` AS `transactionRequestId`,`q`.`note` AS `note`,`q`.`expirationDate` AS `expirationDate`,`ti`.`name` AS `transactionInitiator`,`tit`.`name` AS `transactionInitiatorType`,`ts`.`name` AS `transactionScenario`,`q`.`balanceOfPaymentsId` AS `balanceOfPaymentsId`,`tss`.`name` AS `transactionSubScenario`,`amt`.`name` AS `amountType`,`q`.`amount` AS `amount`,`q`.`currencyId` AS `currency` from (((((`quote` `q` join `transactionInitiator` `ti` on((`ti`.`transactionInitiatorId` = `q`.`transactionInitiatorId`))) join `transactionInitiatorType` `tit` on((`tit`.`transactionInitiatorTypeId` = `q`.`transactionInitiatorTypeId`))) join `transactionScenario` `ts` on((`ts`.`transactionScenarioId` = `q`.`transactionScenarioId`))) join `amountType` `amt` on((`amt`.`amountTypeId` = `q`.`amountTypeId`))) left join `transactionSubScenario` `tss` on((`tss`.`transactionSubScenarioId` = `q`.`transactionSubScenarioId`))) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-02-20 22:51:43
|
<reponame>devnw/aegis
/*
RETURN QueryData SINGLE
Length INT NOT
*/
DROP PROCEDURE IF EXISTS `GetJobConfigLength`;
CREATE PROCEDURE `GetJobConfigLength` (_configID VARCHAR(36), _jobID INT, _dataInSourceConfigID VARCHAR(36), _dataOutSourceConfigID VARCHAR(36),
_priorityOverride INT, _continuous BIT, _Payload MEDIUMTEXT, _waitInSeconds INT, _maxInstances INT, _autoStart BIT, _OrgID VARCHAR(36),
_updatedBy NVARCHAR(255), _createdBy NVARCHAR(255) , _updatedDate DATETIME ,_createdDate DATETIME,_lastJobStart DATETIME, _ID VARCHAR(36))
#BEGIN#
SELECT
count(*)
FROM JobConfig JC
WHERE JC.OrganizationId = _OrgId
AND JC.Active = 1
AND (JC.JobId = _jobid OR _jobid = '' OR _jobid is NULL)
AND (JC.Id = _id OR _id = '' OR _id is NULL)
AND (JC.Id = _configId OR _configId= 0 OR _configId is NULL)
AND (JC.DataInSourceConfigId = _dataInSourceConfigId OR _dataInSourceConfigId = '' OR _dataInSourceConfigId is NULL)
AND (JC.DataOutSourceConfigId = _dataOutSourceConfigId OR _dataOutSourceConfigId ='' OR _dataOutSourceConfigId is NULL)
AND (JC.PriorityOverride = _priorityOverride OR _priorityOverride ='' OR _priorityOverride is NULL)
AND (JC.Continuous = _continuous OR _continuous ='' OR _continuous is NULL)
AND (JC.WaitInSeconds = _waitInSeconds OR _waitInSeconds ='' OR _waitInSeconds is NULL)
AND (JC.MaxInstances = _maxInstances OR _maxInstances ='' OR _maxInstances is NULL)
AND (JC.AutoStart = _autoStart OR _autoStart ='' OR _autoStart is NULL)
AND (JC.Payload = _payload OR _payload ='' OR _payload is NULL)
AND (JC.UpdatedBy = _updatedBy OR _updatedBy='' OR _updatedBy is NULL)
AND (JC.CreatedBy = _createdBy OR _createdBy ='' OR _createdBy is NULL)
AND (JC.CreatedDate = _createdDate OR _createdDate ='1970-01-02 00:00:00 +0000 UTC' OR _createdDate is NULL)
AND (JC.UpdatedDate = _updatedDate OR _updatedDate ='1970-01-02 00:00:00 +0000 UTC' OR _updatedDate is NULL)
AND (JC.LastJobStart = _lastJobStart OR _lastJobStart ='1970-01-02 00:00:00 +0000 UTC' OR _lastJobStart is NULL)
|
<gh_stars>10-100
-- test add and drop columns
USE `common_1`;
CREATE TABLE `add_and_drop_columns`
(
`id` int(11) NOT NULL PRIMARY KEY
);
insert into `add_and_drop_columns` (id)
values (1);
alter table `add_and_drop_columns`
add col1 int null,
add col2 int null,
add col3 int null;
insert into `add_and_drop_columns` (id, col1, col2, col3)
values (2, 3, 4, 5);
insert into `add_and_drop_columns` (id) values (3);
alter table `add_and_drop_columns`
drop col1,
drop col2;
insert into `add_and_drop_columns` (id, col3)
values (4, 5);
|
-- Add repository groups
with repo_latest as (
select sub.repo_id,
sub.repo_name
from (
select repo_id,
dup_repo_name as repo_name,
row_number() over (partition by repo_id order by created_at desc, id desc) as row_num
from
gha_events
) sub
where
sub.row_num = 1
)
update
gha_repos r
set
alias = (
select rl.repo_name
from
repo_latest rl
where
rl.repo_id = r.id
)
where
r.name like '%_/_%'
and r.name not like '%/%/%'
;
update gha_repos set repo_group = alias;
update gha_repos set repo_group = 'fluentd' where name in ('fluentd', 'fluent/fluentd');
update gha_repos set repo_group = 'fluent-logger-ruby' where name in ('fluent-logger-ruby', 'fluent/fluent-logger-ruby');
update gha_repos set repo_group = 'fluent-plugin-scribe' where name in ('fluent-plugin-scribe', 'fluent/fluent-plugin-scribe');
update gha_repos set repo_group = 'fluent-plugin-mongo' where name in ('fluent-plugin-mongo', 'fluent/fluent-plugin-mongo');
update gha_repos set repo_group = 'fluent-plugin-s3' where name in ('fluent-plugin-s3', 'fluent/fluent-plugin-s3');
update gha_repos set repo_group = 'fluent-plugin-msgpack-rpc' where name in ('fluent-plugin-msgpack-rpc', 'fluent/fluent-plugin-msgpack-rpc');
update gha_repos set repo_group = 'fluent-logger-python' where name in ('fluent-logger-python', 'fluent/fluent-logger-python');
update gha_repos set repo_group = 'fluent-logger-java' where name in ('fluent-logger-java', 'fluent/fluent-logger-java');
update gha_repos set repo_group = 'fluent-logger-php' where name in ('fluent-logger-php', 'fluent/fluent-logger-php');
update gha_repos set repo_group = 'website' where name in ('website', 'fluent/website');
update gha_repos set repo_group = 'fluent-logger-perl' where name in ('fluent-logger-perl', 'fluent/fluent-logger-perl');
update gha_repos set repo_group = 'fluent-plugin-hoop' where name in ('fluent-plugin-hoop', 'fluent/fluent-plugin-hoop');
update gha_repos set repo_group = 'fluent-logger-d' where name in ('fluent-logger-d', 'fluent/fluent-logger-d');
update gha_repos set repo_group = 'fluent-plugins' where name in ('fluent-plugins', 'fluent/fluent-plugins');
update gha_repos set repo_group = 'fluent-plugin-flume' where name in ('fluent-plugin-flume', 'fluent/fluent-plugin-flume');
update gha_repos set repo_group = 'fluent-plugin-webhdfs' where name in ('fluent-plugin-webhdfs', 'fluent/fluent-plugin-webhdfs');
update gha_repos set repo_group = 'fluent-plugin-sql' where name in ('fluent-plugin-sql', 'fluent/fluent-plugin-sql');
update gha_repos set repo_group = 'nginx-fluentd-module' where name in ('nginx-fluentd-module', 'fluent/nginx-fluentd-module');
update gha_repos set repo_group = 'fluentd-docs' where name in ('fluentd-docs', 'fluent/fluentd-docs');
update gha_repos set repo_group = 'fluent-logger-node' where name in ('fluent-logger-node', 'fluent/fluent-logger-node');
update gha_repos set repo_group = 'fluentd-benchmark' where name in ('fluentd-benchmark', 'fluent/fluentd-benchmark');
update gha_repos set repo_group = 'fluent-plugin-rewrite-tag-filter' where name in ('fluent-plugin-rewrite-tag-filter', 'fluent/fluent-plugin-rewrite-tag-filter');
update gha_repos set repo_group = 'serverengine' where name in ('serverengine', 'fluent/serverengine');
update gha_repos set repo_group = 'fluent-logger-ocaml' where name in ('fluent-logger-ocaml', 'fluent/fluent-logger-ocaml');
update gha_repos set repo_group = 'fluentd-ui' where name in ('fluentd-ui', 'fluent/fluentd-ui');
update gha_repos set repo_group = 'NLog.Targets.Fluentd' where name in ('NLog.Targets.Fluentd', 'fluent/NLog.Targets.Fluentd');
update gha_repos set repo_group = 'fluentd-forwarder' where name in ('fluentd-forwarder', 'fluent/fluentd-forwarder');
update gha_repos set repo_group = 'fluent-bit' where name in ('fluent/fluent-bit', 'fluent-bit');
update gha_repos set repo_group = 'fluent-logger-scala' where name in ('fluent/fluent-logger-scala', 'fluent-logger-scala');
update gha_repos set repo_group = 'fluent-bit-demo' where name in ('fluent/fluent-bit-demo', 'fluent-bit-demo');
update gha_repos set repo_group = 'fluent-logger-erlang' where name in ('fluent/fluent-logger-erlang', 'fluent-logger-erlang');
update gha_repos set repo_group = 'data-collection' where name in ('fluent/data-collection', 'data-collection');
update gha_repos set repo_group = 'fluent-logger-golang' where name in ('fluent/fluent-logger-golang', 'fluent-logger-golang');
update gha_repos set repo_group = 'fluentd-docker-image' where name in ('fluent/fluentd-docker-image', 'fluentd-docker-image');
update gha_repos set repo_group = 'fluent-bit-website' where name in ('fluent/fluent-bit-website', 'fluent-bit-website');
update gha_repos set repo_group = 'fluentbit-dashboard' where name in ('fluent/fluentbit-dashboard', 'fluentbit-dashboard');
update gha_repos set repo_group = 'fluentd-website' where name in ('fluent/fluentd-website', 'fluentd-website');
update gha_repos set repo_group = 'fluentbit-website-v2' where name in ('fluent/fluentbit-website-v2', 'fluentbit-website-v2');
update gha_repos set repo_group = 'fluent-bit-docs' where name in ('fluent/fluent-bit-docs', 'fluent-bit-docs');
update gha_repos set repo_group = 'fluent-bit-go' where name in ('fluent/fluent-bit-go', 'fluent-bit-go');
update gha_repos set repo_group = 'fluent-bit-docker-image' where name in ('fluent/fluent-bit-docker-image', 'fluent-bit-docker-image');
update gha_repos set repo_group = 'fluentd-kubernetes-daemonset' where name in ('fluent/fluentd-kubernetes-daemonset', 'fluentd-kubernetes-daemonset');
update gha_repos set repo_group = 'fluentd-docs-kubernetes' where name in ('fluent/fluentd-docs-kubernetes', 'fluentd-docs-kubernetes');
update gha_repos set repo_group = 'fluent-bit-kubernetes-logging' where name in ('fluent/fluent-bit-kubernetes-logging', 'fluent-bit-kubernetes-logging');
update gha_repos set repo_group = 'fluent-bit-docker-image' where name in ('fluent/fluent-bit-docker-image', 'fluent-bit-docker-image');
update gha_repos set repo_group = 'fluent-bit-packaging' where name in ('fluent/fluent-bit-packaging', 'fluent-bit-packaging');
update gha_repos set repo_group = 'fluent-bit-test' where name in ('fluent/fluent-bit-test', 'fluent-bit-test');
update gha_repos set repo_group = 'kafka-connect-fluentd' where name in ('fluent/kafka-connect-fluentd', 'kafka-connect-fluentd');
update gha_repos set repo_group = 'fluent-bit-kubernetes-logging' where name in ('fluent/fluent-bit-kubernetes-logging', 'fluent-bit-kubernetes-logging');
update gha_repos set repo_group = 'fluentd-docs-gitbook' where name in ('fluent/fluentd-docs-gitbook', 'fluentd-docs-gitbook');
update gha_repos set repo_group = 'fluent-bit-tutorials' where name in ('fluent/fluent-bit-tutorials', 'fluent-bit-tutorials');
update gha_repos set repo_group = 'fluent.github.com' where name in ('fluent/fluent.github.com', 'fluent.github.com');
update gha_repos set repo_group = 'fluent-bit-docs-stream-processing' where name in ('fluent/fluent-bit-docs-stream-processing', 'fluent-bit-docs-stream-processing');
update gha_repos set repo_group = 'fluent-bit-plugin' where name in ('fluent/fluent-bit-plugin', 'fluent-bit-plugin');
update gha_repos set repo_group = 'fluent-bit-perf' where name in ('fluent/fluent-bit-perf', 'fluent-bit-perf');
update gha_repos set repo_group = 'fluent-bit-docker' where name in ('fluent/fluent-bit-docker', 'fluent-bit-docker');
update gha_repos set repo_group = 'fluent-bit-kubernetes-daemonset' where name in ('fluent/fluent-bit-kubernetes-daemonset', 'fluent-bit-kubernetes-daemonset');
update
gha_repos
set
repo_group = 'Plugins'
where
lower(org_login) in (
'fluent-plugins-nursery'
)
or lower(name) in (
'baritolog/barito-fluent-plugin', 'blacknight95/aws-fluent-plugin-kinesis', 'sumologic/fluentd-kubernetes-sumologic', 'sumologic/fluentd-output-sumologic',
'wallynegima/scenario-manager-plugin', 'aliyun/aliyun-odps-fluentd-plugin', 'awslabs/aws-fluent-plugin-kinesis', 'campanja/fluent-output-router',
'grafana/loki/', 'jdoconnor/fluentd_https_out', 'newrelic/newrelic-fluentd-output', 'roma42427/filter_wms_auth', 'scalyr/scalyr-fluentd',
'sebryu/fluent_plugin_in_websocket', 'tagomoris/fluent-helper-plugin-spec', 'y-ken/fluent-mixin-rewrite-tag-name', 'y-ken/fluent-mixin-type-converter'
)
or lower(name) like '%_/fluent-plugin-%'
or lower(name) like '%_/fluentd-plugin-%'
;
select
repo_group,
count(*) as number_of_repos
from
gha_repos
where
repo_group is not null
group by
repo_group
order by
number_of_repos desc,
repo_group asc;
|
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_awayan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_awayan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 34;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_awayan TO lap_awayan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_awayan FROM lap_awayan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_awayan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_awayan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_bappeda;
CREATE VIEW view_aset_tetap_usul_hapus_l2_bappeda AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 21;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_bappeda TO lap_bappeda;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_bappeda FROM lap_bappeda;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_bappeda;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_bappeda;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_batumandi;
CREATE VIEW view_aset_tetap_usul_hapus_l2_batumandi AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 32;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_batumandi TO lap_batumandi;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_batumandi FROM lap_batumandi;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_batumandi;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_batumandi;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_batupiring;
CREATE VIEW view_aset_tetap_usul_hapus_l2_batupiring AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 37;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_batupiring TO lap_batupiring;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_batupiring FROM lap_batupiring;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_batupiring;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_batupiring;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_bkd;
CREATE VIEW view_aset_tetap_usul_hapus_l2_bkd AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 19;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_bkd TO lap_bkd;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_bkd FROM lap_bkd;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_bkd;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_bkd;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_bkppd;
CREATE VIEW view_aset_tetap_usul_hapus_l2_bkppd AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 26;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_bkppd TO lap_bkppd;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_bkppd FROM lap_bkppd;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_bkppd;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_bkppd;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_bpbd;
CREATE VIEW view_aset_tetap_usul_hapus_l2_bpbd AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 39;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_bpbd TO lap_bpbd;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_bpbd FROM lap_bpbd;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_bpbd;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_bpbd;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_bppd;
CREATE VIEW view_aset_tetap_usul_hapus_l2_bppd AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 48;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_bppd TO lap_bppd;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_bppd FROM lap_bppd;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_bppd;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_bppd;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dinkes;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dinkes AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 5;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dinkes TO lap_dinkes;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dinkes FROM lap_dinkes;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dinkes;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dinkes;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_disdik;
CREATE VIEW view_aset_tetap_usul_hapus_l2_disdik AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 7;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_disdik TO lap_disdik;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_disdik FROM lap_disdik;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_disdik;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_disdik;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dishub;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dishub AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 4;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dishub TO lap_dishub;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dishub FROM lap_dishub;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dishub;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dishub;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_disnakertrans;
CREATE VIEW view_aset_tetap_usul_hapus_l2_disnakertrans AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 41;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_disnakertrans TO lap_disnakertrans;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_disnakertrans FROM lap_disnakertrans;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_disnakertrans;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_disnakertrans;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_distamben;
CREATE VIEW view_aset_tetap_usul_hapus_l2_distamben AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 17;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_distamben TO lap_distamben;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_distamben FROM lap_distamben;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_distamben;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_distamben;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dko;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dko AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 23;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dko TO lap_dko;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dko FROM lap_dko;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dko;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dko;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dkp;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dkp AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 15;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dkp TO lap_dkp;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dkp FROM lap_dkp;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dkp;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dkp;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dkukmp;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dkukmp AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 16;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dkukmp TO lap_dkukmp;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dkukmp FROM lap_dkukmp;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dkukmp;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dkukmp;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dlh;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dlh AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 22;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dlh TO lap_dlh;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dlh FROM lap_dlh;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dlh;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dlh;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dpkp;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dpkp AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 40;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dpkp TO lap_dpkp;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dpkp FROM lap_dpkp;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dpkp;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dpkp;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dpmd;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dpmd AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 10;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dpmd TO lap_dpmd;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dpmd FROM lap_dpmd;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dpmd;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dpmd;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dpmptsp;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dpmptsp AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 18;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dpmptsp TO lap_dpmptsp;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dpmptsp FROM lap_dpmptsp;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dpmptsp;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dpmptsp;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dppkb;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dppkb AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 42;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dppkb TO lap_dppkb;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dppkb FROM lap_dppkb;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dppkb;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dppkb;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dpppa;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dpppa AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 11;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dpppa TO lap_dpppa;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dpppa FROM lap_dpppa;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dpppa;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dpppa;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dpupr;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dpupr AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 3;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dpupr TO lap_dpupr;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dpupr FROM lap_dpupr;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dpupr;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dpupr;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_dukcatpil;
CREATE VIEW view_aset_tetap_usul_hapus_l2_dukcatpil AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 12;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_dukcatpil TO lap_dukcatpil;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_dukcatpil FROM lap_dukcatpil;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_dukcatpil;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_dukcatpil;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_halong;
CREATE VIEW view_aset_tetap_usul_hapus_l2_halong AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 35;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_halong TO lap_halong;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_halong FROM lap_halong;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_halong;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_halong;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_inspektorat;
CREATE VIEW view_aset_tetap_usul_hapus_l2_inspektorat AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 20;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_inspektorat TO lap_inspektorat;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_inspektorat FROM lap_inspektorat;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_inspektorat;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_inspektorat;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_juai;
CREATE VIEW view_aset_tetap_usul_hapus_l2_juai AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 33;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_juai TO lap_juai;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_juai FROM lap_juai;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_juai;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_juai;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_kearsipan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_kearsipan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 44;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_kearsipan TO lap_kearsipan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_kearsipan FROM lap_kearsipan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_kearsipan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_kearsipan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_kehutanan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_kehutanan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 14;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_kehutanan TO lap_kehutanan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_kehutanan FROM lap_kehutanan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_kehutanan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_kehutanan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_kesbangpol;
CREATE VIEW view_aset_tetap_usul_hapus_l2_kesbangpol AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 24;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_kesbangpol TO lap_kesbangpol;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_kesbangpol FROM lap_kesbangpol;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_kesbangpol;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_kesbangpol;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_kominfo;
CREATE VIEW view_aset_tetap_usul_hapus_l2_kominfo AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 43;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_kominfo TO lap_kominfo;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_kominfo FROM lap_kominfo;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_kominfo;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_kominfo;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_korpri;
CREATE VIEW view_aset_tetap_usul_hapus_l2_korpri AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 27;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_korpri TO lap_korpri;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_korpri FROM lap_korpri;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_korpri;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_korpri;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_lampihong;
CREATE VIEW view_aset_tetap_usul_hapus_l2_lampihong AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 31;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_lampihong TO lap_lampihong;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_lampihong FROM lap_lampihong;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_lampihong;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_lampihong;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_paringin;
CREATE VIEW view_aset_tetap_usul_hapus_l2_paringin AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 28;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_paringin TO lap_paringin;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_paringin FROM lap_paringin;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_paringin;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_paringin;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_paringinkota;
CREATE VIEW view_aset_tetap_usul_hapus_l2_paringinkota AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 29;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_paringinkota TO lap_paringinkota;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_paringinkota FROM lap_paringinkota;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_paringinkota;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_paringinkota;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_paringinselatan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_paringinselatan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 36;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_paringinselatan TO lap_paringinselatan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_paringinselatan FROM lap_paringinselatan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_paringinselatan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_paringinselatan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_paringintimur;
CREATE VIEW view_aset_tetap_usul_hapus_l2_paringintimur AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 30;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_paringintimur TO lap_paringintimur;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_paringintimur FROM lap_paringintimur;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_paringintimur;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_paringintimur;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_pariwisata;
CREATE VIEW view_aset_tetap_usul_hapus_l2_pariwisata AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 46;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_pariwisata TO lap_pariwisata;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_pariwisata FROM lap_pariwisata;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_pariwisata;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_pariwisata;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_perdagangan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_perdagangan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 47;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_perdagangan TO lap_perdagangan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_perdagangan FROM lap_perdagangan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_perdagangan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_perdagangan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_perikanan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_perikanan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 45;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_perikanan TO lap_perikanan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_perikanan FROM lap_perikanan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_perikanan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_perikanan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_perpustakaan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_perpustakaan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 8;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_perpustakaan TO lap_perpustakaan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_perpustakaan FROM lap_perpustakaan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_perpustakaan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_perpustakaan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_pertanian;
CREATE VIEW view_aset_tetap_usul_hapus_l2_pertanian AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 13;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_pertanian TO lap_pertanian;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_pertanian FROM lap_pertanian;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_pertanian;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_pertanian;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_rsud;
CREATE VIEW view_aset_tetap_usul_hapus_l2_rsud AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 6;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_rsud TO lap_rsud;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_rsud FROM lap_rsud;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_rsud;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_rsud;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_satpolpp;
CREATE VIEW view_aset_tetap_usul_hapus_l2_satpolpp AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 25;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_satpolpp TO lap_satpolpp;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_satpolpp FROM lap_satpolpp;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_satpolpp;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_satpolpp;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_setda;
CREATE VIEW view_aset_tetap_usul_hapus_l2_setda AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 2;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_setda TO lap_setda;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_setda FROM lap_setda;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_setda;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_setda;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_setwan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_setwan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 1;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_setwan TO lap_setwan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_setwan FROM lap_setwan;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_setwan;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_setwan;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_sosial;
CREATE VIEW view_aset_tetap_usul_hapus_l2_sosial AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 9;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_sosial TO lap_sosial;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_sosial FROM lap_sosial;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_sosial;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_sosial;
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_tebingtinggi;
CREATE VIEW view_aset_tetap_usul_hapus_l2_tebingtinggi AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 38;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_tebingtinggi TO lap_tebingtinggi;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_hapus_l2_tebingtinggi FROM lap_tebingtinggi;
GRANT ALL PRIVILEGES ON keadaan_barang TO lap_tebingtinggi;
REVOKE INSERT, UPDATE, DELETE ON keadaan_barang FROM lap_tebingtinggi;
|
autocommit off;
insert into joe.kitsch_v (atom_c, attr_1, attr_6, set_attr_1, set_attr_6)
values ('12345', '10', 10, {'10'}, {10});
rollback work;
rollback;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 07, 2021 at 09:50 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `yii2advanced`
--
-- --------------------------------------------------------
--
-- Table structure for table `migration`
--
CREATE TABLE `migration` (
`version` varchar(180) NOT NULL,
`apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `migration`
--
INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1634968454),
('m130524_201442_init', 1634968458),
('m190124_110200_add_verification_token_column_to_user_table', 1634968458),
('m211023_061947_create_employees_table', 1634971086),
('m211023_183449_create_department_table', 1635014301),
('m211107_075222_migration_for_adding_new_roles_column', 1636271655),
('m211107_075946_migration_for_adding_new_phone_column', 1636272056);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` smallint(6) NOT NULL DEFAULT 10,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
`verification_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`role` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `migration`
--
ALTER TABLE `migration`
ADD PRIMARY KEY (`version`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `password_reset_token` (`<PASSWORD>`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
drop index ZSTG_RNASETS_GENECHIP_A;
drop index ZSTG_RNASETS_SPECIES_SC;
drop index ZSTG_RNASETS_SEQUENCE_T;
drop index ZSTG_RNASETS_SEQUENCE_S;
drop index ZSTG_RNASETS_TRANSCRIPT;
drop index ZSTG_RNASETS_TARGET_DES;
drop index ZSTG_RNASETS_REPRESENTA;
drop index ZSTG_RNASETS_ARCHIVAL_U;
drop index ZSTG_RNASETS_UNIGENE_ID;
drop index ZSTG_RNASETS_GENOME_VER;
drop index ZSTG_RNASETS_ALIGNMENTS;
drop index ZSTG_RNASETS_GENE_SYMBO;
drop index ZSTG_RNASETS_CHROMOSOMA;
drop index ZSTG_RNASETS_UNIGENE_CL;
drop index ZSTG_RNASETS_ENSEMBL;
drop index ZSTG_RNASETS_ENTREZ_GEN;
drop index ZSTG_RNASETS_EC;
drop index ZSTG_RNASETS_OMIM;
drop index ZSTG_RNASETS_REFSEQ_PRO;
drop index ZSTG_RNASETS_REFSEQ_TRA;
drop index ZSTG_RNASETS_FLYBASE;
drop index ZSTG_RNASETS_AGI;
drop index ZSTG_RNASETS_WORMBASE;
drop index ZSTG_RNASETS_MGI_NAME;
drop index ZSTG_RNASETS_RGD_NAME;
drop index ZSTG_RNASETS_SGD_ACCESS;
drop index ZSTG_RNASETS_QTL;
drop index ZSTG_RNASETS_ANNOTATION;
drop index SYS_IL0000013349C00041$$;
drop index SYS_IL0000013349C00040$$;
drop index SYS_IL0000013349C00039$$;
drop index SYS_IL0000013349C00036$$;
drop index SYS_IL0000013349C00035$$;
drop index SYS_IL0000013349C00034$$;
drop index SYS_IL0000013349C00033$$;
drop index SYS_IL0000013349C00032$$;
drop index SYS_IL0000013349C00031$$;
drop index SYS_IL0000013349C00020$$;
drop index SYS_IL0000013349C00014$$;
drop index ZSTG_RNASETS_PROBE_SET_;
--EXIT;
|
create class test_class (date_col date, time_col time, timestamp_col timestamp, datetime_col datetimetz, datetime_col1 datetimetz);
insert into test_class values (DATE '01/01/1901', TIME '09:00:00', TIMESTAMP '01/01/1901 00:00:00', datetimetz '1970-01-01 00:00:00.000', datetimetz '1970-01-01 00:00:00.999');
insert into test_class values (DATE '01/01/1971', TIME '09:00:00', TIMESTAMP '01/01/1970 00:00:00', datetimetz '1970-01-01 00:00:00.000', datetimetz '1970-01-01 00:00:00.999');
insert into test_class values (DATE '01/02/1971', TIME '09:00:00', TIMESTAMP '01/02/1970 00:00:00', datetimetz '1970-01-02 00:00:00.000', datetimetz '1970-01-02 00:00:00.999');
insert into test_class values (DATE '01/02/2009', TIME '19:10:00', TIMESTAMP '01/01/1970 12:00:00', datetimetz '2008-01-12 12:00:00', datetimetz '2008-02-12 12:00:00.999');
select * from test_class order by 1;
drop class test_class;
|
--
-- The contents of this file are subject to the license and copyright
-- detailed in the LICENSE and NOTICE files at the root of the source
-- tree and available online at
--
-- http://www.dspace.org/license/
--
-- ===============================================================
-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
--
-- DO NOT MANUALLY RUN THIS DATABASE MIGRATION. IT WILL BE EXECUTED
-- AUTOMATICALLY (IF NEEDED) BY "FLYWAY" WHEN YOU STARTUP DSPACE.
-- http://flywaydb.org/
-- ===============================================================
-------------------------------------------------------------
-- This will create the setup for the dspace 7 entities usage
-------------------------------------------------------------
CREATE SEQUENCE entity_type_id_seq;
CREATE SEQUENCE relationship_type_id_seq;
CREATE SEQUENCE relationship_id_seq;
CREATE TABLE entity_type
(
id INTEGER NOT NULL PRIMARY KEY,
label varchar(32) UNIQUE NOT NULL
);
CREATE TABLE relationship_type
(
id INTEGER NOT NULL PRIMARY KEY,
left_type INTEGER NOT NULL,
right_type INTEGER NOT NULL,
left_label varchar(32) NOT NULL,
right_label varchar(32) NOT NULL,
left_min_cardinality INTEGER,
left_max_cardinality INTEGER,
right_min_cardinality INTEGER,
right_max_cardinality INTEGER,
FOREIGN KEY (left_type) REFERENCES entity_type(id),
FOREIGN KEY (right_type) REFERENCES entity_type(id),
CONSTRAINT u_relationship_type_constraint UNIQUE (left_type, right_type, left_label, right_label)
);
CREATE TABLE relationship
(
id INTEGER NOT NULL PRIMARY KEY,
left_id uuid NOT NULL REFERENCES item(uuid),
type_id INTEGER NOT NULL REFERENCES relationship_type(id),
right_id uuid NOT NULL REFERENCES item(uuid),
left_place INTEGER,
right_place INTEGER,
CONSTRAINT u_constraint UNIQUE (left_id, type_id, right_id)
);
CREATE INDEX entity_type_label_idx ON entity_type(label);
CREATE INDEX relationship_type_by_left_type_idx ON relationship_type(left_type);
CREATE INDEX relationship_type_by_right_type_idx ON relationship_type(right_type);
CREATE INDEX relationship_type_by_left_label_idx ON relationship_type(left_label);
CREATE INDEX relationship_type_by_right_label_idx ON relationship_type(right_label);
CREATE INDEX relationship_by_left_id_idx ON relationship(left_id);
CREATE INDEX relationship_by_right_id_idx ON relationship(right_id);
|
<filename>conf/evolutions/default/3.sql
-- Tokens
-- !Ups
create table token
(
token_value varchar(200) not null,
issued timestamp with time zone not null,
valid_until timestamp with time zone not null,
user_id int not null,
constraint pk_token primary key (token_value)
);
alter table token
add constraint fk_token_user_id
foreign key (user_id) references portal_user (id) on delete restrict on update restrict;
-- !Downs
alter table if exists token
drop constraint if exists fk_token_user_id;
DROP TABLE token;
|
CREATE TABLE Product (
name varchar(50) PRIMARY KEY,
description varchar(50) NOT NULL,
price integer NOT NULL,
username varchar(50) NOT NULL
);
CREATE TABLE User (
user_name varchar(50) NOT NULL,
login varchar(50) PRIMARY KEY,
password varchar(50) NOT NULL
);
CREATE TABLE Rating (
id integer PRIMARY KEY,
value integer NOT NULL,
user_name varchar(50) NOT NULL,
product_name varchar(50) NOT NULL,
FOREIGN KEY(product_name) REFERENCES Product(name) ON DELETE CASCADE
);
CREATE TABLE Comment (
id integer PRIMARY KEY,
content text,
user_name varchar(50) NOT NULL,
product_name varchar(50) NOT NULL,
FOREIGN KEY(product_name) REFERENCES Product(name) ON DELETE CASCADE
);
|
<filename>migrations/default/1646425161821_alter_table_public_issues_drop_column_board_id/up.sql<gh_stars>0
alter table "public"."issues" drop column "board_id" cascade;
|
\ir to_ts.sql
\ir log.sql
\ir logger.sql
\ir acq.sql
|
CREATE TABLE `tags` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(200) NOT NULL,
`description` TEXT,
`parent_id` INT,
PRIMARY KEY (`id`),
UNIQUE KEY `tags_name_uc` (`name`)
);
|
<filename>infrastructure/repositories/database/postgres/migrations/2018-02-23-1_create_users_table.down.sql
DROP TABLE "users";
|
<filename>egov/egov-commons/src/main/resources/db/migration/main/V20170103185251__commons_educational_qualification_DML.sql
delete from eg_feature_role where feature in(select id from eg_feature where name in('Create Council Qualification','Update Council Qualification','View Council Qualification'));
delete from eg_feature_action where feature in(select id from eg_feature where name in('Create Council Qualification','Update Council Qualification','View Council Qualification'));
delete from eg_feature where name in('Create Council Qualification','Update Council Qualification','View Council Qualification');
delete from eg_roleaction where actionid in(select id from eg_action where name in('New-CouncilQualification','Create-CouncilQualification','Update-CouncilQualification','View-CouncilQualification','Edit-CouncilQualification','Result-CouncilQualification','Search and View-CouncilQualification','Search and Edit-CouncilQualification','Search and View Result-CouncilQualification','Search and Edit Result-CouncilQualification'));
delete from eg_action where name in('New-CouncilQualification','Create-CouncilQualification','Update-CouncilQualification','View-CouncilQualification','Edit-CouncilQualification','Result-CouncilQualification','Search and View-CouncilQualification','Search and Edit-CouncilQualification','Search and View Result-CouncilQualification','Search and Edit Result-CouncilQualification');
-------------alter table--------------------------------
ALTER TABLE egcncl_qualification RENAME TO eg_qualification;
ALTER TABLE eg_qualification RENAME CONSTRAINT pk_egcncl_qualification TO pk_eg_qualification;
ALTER SEQUENCE seq_egcncl_qualification RENAME TO seq_eg_qualification;
----------------------educational qualification role action mapping------------------------------------
INSERT into eg_module values (nextval('SEQ_EG_ACTION'),'CommonQualification',true,'common',(select id from eg_module where name='Common-Masters' and contextroot='common'),'Educational Qualification',4);
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Create Educational Qualification','/qualification/create',(select id from eg_module where name='CommonQualification'),1,'Create Educational Qualification',true,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Create Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Update Educational Qualification','/qualification/update',(select id from eg_module where name='CommonQualification'),2,'Update Educational Qualification',false,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Update Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'View Educational Qualification','/qualification/view',(select id from eg_module where name='CommonQualification'),3,'View Educational Qualification',false,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='View Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Edit Educational Qualification','/qualification/edit',(select id from eg_module where name='CommonQualification'),4,'Edit Educational Qualification',false,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Edit Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Result Educational Qualification','/qualification/result',(select id from eg_module where name='CommonQualification'),5,'Result Educational Qualification',false,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Result Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Search and View Educational Qualification','/qualification/search/view',(select id from eg_module where name='CommonQualification'),6,'View Educational Qualification',true,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Search and View Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Search and Edit Educational Qualification','/qualification/search/edit',(select id from eg_module where name='CommonQualification'),7,'Update Educational Qualification',true,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Search and Edit Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Search and View Result Educational Qualification','/qualification/searchresult/view',(select id from eg_module where name='CommonQualification'),8,'Search and View Result Educational Qualification',false,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Search and View Result Educational Qualification'));
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'Search and Edit Result Educational Qualification','/qualification/searchresult/edit',(select id from eg_module where name='CommonQualification'),9,'Search and Edit Result Educational Qualification',false,'common',(select id from eg_module where name='Common' and parentmodule is null));
Insert into eg_roleaction values((select id from eg_role where name='Super User'),(select id from eg_action where name='Search and Edit Result Educational Qualification'));
--------------------------educational qualification feature action mapping----------------
------------------------ Create -----------------
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Create Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Create Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Create Educational Qualification'));
------------------------ Update -----------------
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Search and Edit Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Search and View Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Edit Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Update Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Search and Edit Educational Qualification') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
------------------------ View -----------------
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Search and View Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'View Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Search and Edit Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'View Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Result Educational Qualification') ,(select id FROM eg_feature WHERE name = 'View Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'View Educational Qualification') ,(select id FROM eg_feature WHERE name = 'View Educational Qualification'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'Search and View Educational Qualification') ,(select id FROM eg_feature WHERE name = 'View Educational Qualification'));
--------------------------educational qualification feature role mapping----------------
INSERT INTO eg_feature_role (ROLE, FEATURE) VALUES ((select id from eg_role where name = 'Super User') ,(select id FROM eg_feature WHERE name = 'Create Educational Qualification'));
INSERT INTO eg_feature_role (ROLE, FEATURE) VALUES ((select id from eg_role where name = 'Super User') ,(select id FROM eg_feature WHERE name = 'Update Educational Qualification'));
INSERT INTO eg_feature_role (ROLE, FEATURE) VALUES ((select id from eg_role where name = 'Super User') ,(select id FROM eg_feature WHERE name = 'View Educational Qualification'));
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 19, 2020 at 12:43 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `gameina`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id_admin` int(64) NOT NULL,
`nama_admin` varchar(64) NOT NULL,
`email_admin` varchar(64) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id_admin`, `nama_admin`, `email_admin`, `password`) VALUES
(2, 'admin', '<EMAIL>', <PASSWORD>');
-- --------------------------------------------------------
--
-- Table structure for table `game`
--
CREATE TABLE `game` (
`id_game` int(64) NOT NULL,
`nama_game` varchar(64) NOT NULL,
`id_publisher` int(64) NOT NULL,
`nama_publisher` varchar(64) NOT NULL,
`deskripsi_produk` varchar(255) NOT NULL,
`kategori` varchar(16) NOT NULL,
`harga` varchar(64) NOT NULL,
`gambar_game` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `game`
--
INSERT INTO `game` (`id_game`, `nama_game`, `id_publisher`, `nama_publisher`, `deskripsi_produk`, `kategori`, `harga`, `gambar_game`) VALUES
(12, 'Mobile Legend', 25, '<NAME>', 'LOL', 'Multiplayer', '222222', 'giphy.gif'),
(13, 'Mobile Legend', 25, '<NAME>', 'LOL', 'Battle Royale', '121221', 'giphy1.gif');
-- --------------------------------------------------------
--
-- Table structure for table `keranjang`
--
CREATE TABLE `keranjang` (
`id_keranjang` int(64) NOT NULL,
`id_game` int(64) NOT NULL,
`harga` varchar(64) NOT NULL,
`jumlah` varchar(64) NOT NULL,
`tanggal` varchar(64) NOT NULL,
`id_user` int(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pembayaran`
--
CREATE TABLE `pembayaran` (
`id_pembayaran` int(255) NOT NULL,
`id` int(64) NOT NULL,
`id_game` int(64) NOT NULL,
`jumlah_pembayaran` varchar(64) NOT NULL,
`nama_user` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pembayaran`
--
INSERT INTO `pembayaran` (`id_pembayaran`, `id`, `id_game`, `jumlah_pembayaran`, `nama_user`) VALUES
(1113, 70, 123, '123', '123'),
(1114, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf'),
(1115, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf'),
(1116, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf'),
(1117, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf'),
(1118, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf'),
(1119, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf'),
(1120, 70, 10, '100.000', 'Syauqi Zaidan Khairan Khalaf');
-- --------------------------------------------------------
--
-- Table structure for table `playgames`
--
CREATE TABLE `playgames` (
`id_game` int(11) NOT NULL,
`nama_game` varchar(255) NOT NULL,
`gambar_game` varchar(255) NOT NULL,
`deskripsi_game` varchar(255) NOT NULL,
`kategori` varchar(255) NOT NULL,
`link_game` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `playgames`
--
INSERT INTO `playgames` (`id_game`, `nama_game`, `gambar_game`, `deskripsi_game`, `kategori`, `link_game`) VALUES
(1, 'Cube Ninja', 'cnn1.jpg', 'Game tentang ninja laki lakis', 'arcade', 'ninja.html'),
(2, 'Birdy Rush', 'birdy_rush.png', 'Game tentang burung', 'arcade', 'bird.html'),
(3, 'Olympic Rio', 'olympic.jpg', 'Permainan Sport Terseru dan populer telah hadir!', 'populer', 'olympic.html'),
(4, 'Cut The Rope', 'header.jpg', 'Bermain dan beri makan omnom! si alien lucu .', 'populer', 'cut_the_rope.html'),
(5, 'Turbo Racing', 'turbo_racing.jpg', 'Permainan Balapan Menegangkan ! seru dan menarik!', 'populer', 'turbo_racing.html'),
(6, '8 Ball Pool', 'ball_pool.jpg', 'Mainkan game billiar terpopuler di sini ! mainkan gratis!', 'populer', 'ball_pool.html'),
(7, 'Red Code', 'red.jpg', 'Game perang terseru dan terkeren! yuk main sekarang dude!', 'populer', 'red_code.html'),
(8, 'Monkey Kick', 'monkey_kick.jpg', 'Tendang MONYET yang lucu dan pikakeheulen jiga kamu :)', 'populer', 'monkey_kick.html'),
(9, 'Bloxorz', 'bloxorz.png', 'Mystery box oriented game yang bikin kamu pusing dan menantang!', 'populer', 'bloxorz.html'),
(10, 'Basketball', 'basket.jpg', 'Mainkan olahraga basket dengan mudah disini!', 'populer', 'basket.html'),
(11, 'Free Falling', 'free_falling.jpg', 'Rasakan sensasi parkour yang seru dan menegangkan disini!', 'populer', 'free_falling.html'),
(12, 'Thunderbirds', 'thunderbirds.jpg', 'Mainkan game thunderbirds yang seru,menarik dan gege', 'populer', 'thunderbirds.html'),
(13, 'Battle Golf', 'battle_golf.jpg', 'Mainkan game golf bersama temanmu sekarang!', 'populer', 'battle_golf.html'),
(14, 'Cartapult', 'cartapult.jpg', 'Tabrakan dan ledakan mobil sekitarmu hahahahhaha!', 'populer', 'cartapult.html'),
(16, 'Zombiester', 'zombie_buster.png', 'Kalahkan para zombie dan bertahan hidup agar kamu selamat!', 'fps', 'zombie.html'),
(17, 'Tank Wars', 'tank_wars.jpg', 'Kalahkan tank lain , kuasai mereka dan menangkan pertandingan!', 'fps', 'tankwars.html'),
(18, 'Combatdier', 'soldiers-combat.jpg', 'Kalahkan musuh dan bertahan hidup untuk menang!', 'fps', 'combat.html'),
(19, 'Jelly Jump', 'jelly_jump.jpg', 'Loncat loncat fucekkkk', 'fps', 'jelly.html'),
(20, 'Throatgery', 'throat_surgery.jpg', 'Mainkan simulasi operasi gigi sekarang!', 'arcade', 'surgery.html'),
(21, 'BoxKid', 'box_kid.jpg', 'Mainkan game keren puzzle dan mengasah otak!', 'arcade', 'box.html'),
(22, 'Turbo Racing', 'turbo_racing.jpg', 'Permainan Balapan Menegangkan ! seru dan menarik!', 'balapan', 'turbo_racing.html'),
(23, 'BoxKid', 'box_kid.jpg', 'Mainkan game keren puzzle dan mengasah otak!', 'misteri', 'box.html'),
(24, 'Throatgery', 'throat_surgery.jpg', 'Mainkan simulasi operasi gigi sekarang!', 'edukasi', 'surgery.html'),
(25, 'Olympic Rio', 'olympic.jpg', 'Permainan Sport Terseru dan populer telah hadir!', 'olahraga', 'olympic.html'),
(26, 'Thunderbirds', 'thunderbirds.jpg', 'Mainkan game thunderbirds yang seru,menarik dan gege', 'petualangan', 'thunderbirds.html'),
(27, 'Free Falling', 'free_falling.jpg', 'Rasakan sensasi parkour yang seru dan menegangkan disini!', 'Aksi', 'free_falling.html'),
(28, 'Thunderbirds', 'thunderbirds.jpg', 'Mainkan game thunderbirds yang seru,menarik dan gege', 'aksi', 'thunderbirds.html'),
(29, 'Red Code', 'red.jpg', 'Game perang terseru dan terkeren! yuk main sekarang dude!', 'aksi', 'red_code.html'),
(30, 'Monkey Kick', 'monkey_kick.jpg', 'Tendang MONYET yang lucu dan pikakeheulen jiga kamu :)', 'aksi', 'monkey_kick.html'),
(31, 'Firewatergirl', 'fireboy.jpg', 'Mainkan game bersama temanmu! selesaikan level bersama sama!', 'multiplayer', 'fire boys.html'),
(32, 'Cartapult', 'cartapult.jpg', 'Tabrakan dan ledakan mobil sekitarmu hahahahhaha!', 'balapan', 'cartapult.html'),
(33, 'Birdy Rush', 'birdy_rush.png', 'Game tentang burung', 'balapan', 'bird.html'),
(34, 'Thunderbirds', 'thunderbirds.jpg', 'Mainkan game thunderbirds yang seru,menarik dan gege', 'balapan', 'thunderbirds.html'),
(35, 'Cut The Rope', 'header.jpg', 'Bermain dan beri makan omnom! si alien lucu .', 'misteri', 'cut_the_rope.html'),
(36, 'Bloxorz', 'bloxorz.png', 'Mystery box oriented game yang bikin kamu pusing dan menantang!', 'misteri', 'bloxorz.html'),
(37, 'Red Code', 'red.jpg', 'Game perang terseru dan terkeren! yuk main sekarang dude!', 'misteri', 'red_code.html'),
(38, 'Free Falling', 'free_falling.jpg', 'Rasakan sensasi parkour yang seru dan menegangkan disini!', 'olahraga', 'free_falling.html'),
(39, 'Thunderbirds', 'thunderbirds.jpg', 'Mainkan game thunderbirds yang seru,menarik dan gege', 'olahraga', 'thunderbirds.html'),
(41, 'Cut The Rope', 'header.jpg', 'Bermain dan beri makan omnom! si alien lucu .', 'petualangan', 'cut_the_rope.html'),
(42, 'Red Code', 'red.jpg', 'Game perang terseru dan terkeren! yuk main sekarang dude!', 'petualangan', 'red_code.html'),
(43, 'Monkey Kick', 'monkey_kick.jpg', 'Tendang MONYET yang lucu dan pikakeheulen jiga kamu :)', 'petualangan', 'monkey_kick.html'),
(44, '8 Ball Pool', 'ball_pool.jpg', 'Mainkan game billiar terpopuler di sini ! mainkan gratis!', 'multiplayer', 'ball_pool.html'),
(45, 'Battle Golf', 'battle_golf.jpg', 'Mainkan game golf bersama temanmu sekarang!', 'multiplayer', 'battle_golf.html'),
(46, 'Cut The Rope', 'header.jpg', 'Bermain dan beri makan omnom! si alien lucu .', 'multiplayer', 'cut_the_rope.html'),
(47, 'Bloxorz', 'bloxorz.png', 'Mystery box oriented game yang bikin kamu pusing dan menantang!', 'edukasi', 'bloxorz.html'),
(48, 'Cut The Rope', 'header.jpg', 'Bermain dan beri makan omnom! si alien lucu .', 'edukasi', 'cut_the_rope.html'),
(49, 'Basketball', 'basket.jpg', 'Mainkan olahraga basket dengan mudah disini!', 'olahraga', 'basket.html'),
(50, 'Olympic Rio', 'olympic.jpg', 'Permainan Sport Terseru dan populer telah hadir!', 'edukasi', 'olympic.html'),
(54, 'Final Fantasy', 'k4n5pyovt5c41.jpg', '', 'Action', ''),
(56, 'dreadout1', 'Picture1.png', '', 'Action', '');
-- --------------------------------------------------------
--
-- Table structure for table `publisher`
--
CREATE TABLE `publisher` (
`id_publisher` int(64) NOT NULL,
`nama_publisher` varchar(64) NOT NULL,
`nama_perusahaan` varchar(255) NOT NULL,
`email_publisher` varchar(64) NOT NULL,
`image` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`is_active` varchar(1) NOT NULL,
`date_created` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `publisher`
--
INSERT INTO `publisher` (`id_publisher`, `nama_publisher`, `nama_perusahaan`, `email_publisher`, `image`, `password`, `is_active`, `date_created`) VALUES
(25, '<NAME>', 'Desienfy', '<EMAIL>', 'k4n5pyovt5c41.jpg', '$2y$10$usZznYoh9n4i89ySFivE6elyY03RH/Zm9U.EC/Q.2qHwjA9VwcEvO', '1', 1583756973),
(30, 'Maantan', 'MaantanCorp', '<EMAIL>', 'default.jpg', '$2y$10$7FO.XWhJ1PBpeLUGZ.lFWuk3XvhetC90PBOQRte7m6aN1OUlfaxcy', '1', 1592549207);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(64) NOT NULL,
`nama` varchar(64) NOT NULL,
`email` varchar(64) NOT NULL,
`image` varchar(64) NOT NULL,
`password` varchar(128) NOT NULL,
`is_active` int(1) NOT NULL,
`date_created` int(11) NOT NULL,
`inacash` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `nama`, `email`, `image`, `password`, `is_active`, `date_created`, `inacash`) VALUES
(70, '<NAME>', '<EMAIL>', 'pp.jfif', '$2y$10$fv3F2TtNn/7oi1/6i2CQkuC8CaNaSliRNfkhCKTBX5ZhX0zp1H5M.', 1, 1583582357, 200000),
(82, '<NAME>', '<EMAIL>', 'default.jpg', '$2y$10$iTE5h.PUrc7Cnc.O.4oAFO08u8M3doA1QXtoFcdLkKXMNcI1bla2.', 1, 1583975818, 0),
(83, '<NAME>', '<EMAIL>', 'default.jpg', '$2y$10$WaGebURGdE6l1cNzO/3SguARI3lVMktWsMpKhvrRPrvjFagSEJXK6', 1, 1583978764, 0),
(85, '<NAME>', '<EMAIL>', 'default.jpg', '$2y$10$hGskZSQQOfs2ZC4SmjtWNuvFu2sIhErh/40yI93MTvX9UrJ1khek6', 1, 1583979637, 0),
(88, '<NAME>', '<EMAIL>', 'default.jpg', '$2y$10$8RSmU944nBT6coUtfspRl.6UzbzmejRhiuitcCUsjZQVFaGaF9MtK', 1, 1592548950, 0),
(89, 'Dummy', '<EMAIL>', 'default.jpg', '$2y$10$gsjeehNm3yfEd.UwaWmr0ehdFtgucO4k7g5t3iUgVVG2GnG23gL1C', 1, 1592549022, 0);
-- --------------------------------------------------------
--
-- Table structure for table `user_token`
--
CREATE TABLE `user_token` (
`id` int(11) NOT NULL,
`email` varchar(128) NOT NULL,
`token` varchar(128) NOT NULL,
`date_created` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user_token`
--
INSERT INTO `user_token` (`id`, `email`, `token`, `date_created`) VALUES
(55, '<EMAIL>', 'M84IrsJ2B03Ddg0aCRIbfluXXm99bv33tlBTzEVpE0I=', 1583975411),
(59, '<EMAIL>', 'wH1DOZ8hymnp2CCiSBUFILri4I+AsaCtPlRXmwWwcqA=', 1583979496),
(63, '<EMAIL>', 'WEohsMGvSSoQFwLCm4lT923mQNi4SqrxkjwaUDzVLmU=', 1592548950),
(64, '<EMAIL>', 'oY3JdrQ2ZFJw2G9PHCdjueWdSIuKmk+EPbjAH25SkGA=', 1592549022),
(65, '<EMAIL>', 'sAA7OTqO8+6KMeG6O6xjReIoAld3mCuoZDM/T3z3uM8=', 1592549207);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id_admin`);
--
-- Indexes for table `game`
--
ALTER TABLE `game`
ADD PRIMARY KEY (`id_game`,`id_publisher`),
ADD KEY `id_publisher` (`id_publisher`);
--
-- Indexes for table `keranjang`
--
ALTER TABLE `keranjang`
ADD PRIMARY KEY (`id_keranjang`,`id_game`,`id_user`),
ADD KEY `id_game` (`id_game`),
ADD KEY `id_user` (`id_user`);
--
-- Indexes for table `pembayaran`
--
ALTER TABLE `pembayaran`
ADD PRIMARY KEY (`id_pembayaran`,`id`,`id_game`),
ADD KEY `id_user` (`id`),
ADD KEY `id_game` (`id_game`);
--
-- Indexes for table `playgames`
--
ALTER TABLE `playgames`
ADD PRIMARY KEY (`id_game`);
--
-- Indexes for table `publisher`
--
ALTER TABLE `publisher`
ADD PRIMARY KEY (`id_publisher`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_token`
--
ALTER TABLE `user_token`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id_admin` int(64) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `game`
--
ALTER TABLE `game`
MODIFY `id_game` int(64) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `keranjang`
--
ALTER TABLE `keranjang`
MODIFY `id_keranjang` int(64) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pembayaran`
--
ALTER TABLE `pembayaran`
MODIFY `id_pembayaran` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1121;
--
-- AUTO_INCREMENT for table `playgames`
--
ALTER TABLE `playgames`
MODIFY `id_game` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=61;
--
-- AUTO_INCREMENT for table `publisher`
--
ALTER TABLE `publisher`
MODIFY `id_publisher` int(64) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(64) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=90;
--
-- AUTO_INCREMENT for table `user_token`
--
ALTER TABLE `user_token`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>tsunchung/er-diagram-generator
CREATE TABLE Country
(
Name VARCHAR(35) NOT NULL UNIQUE,
Code VARCHAR(4) CONSTRAINT CountryKey PRIMARY KEY,
Capital VARCHAR(35),
Province VARCHAR(35),
Area NUMERIC CONSTRAINT CountryArea CHECK (Area >= 0),
Population NUMERIC CONSTRAINT CountryPop CHECK (Population >= 0)
);
CREATE TABLE City
(
Name VARCHAR(35), -- PRIMARY
Country VARCHAR(4), -- PRIMARY
Province VARCHAR(35), -- PRIMARY
Population NUMERIC CONSTRAINT CityPop CHECK (Population >= 0),
Longitude NUMERIC CONSTRAINT CityLon CHECK ((Longitude >= -180) AND (Longitude <= 180)) ,
Latitude NUMERIC CONSTRAINT CityLat CHECK ((Latitude >= -90) AND (Latitude <= 90)) ,
CONSTRAINT CityKey PRIMARY KEY (Name, Country, Province)
);
CREATE TABLE Province
(
Name VARCHAR(35) CONSTRAINT PrName NOT NULL , -- PRIMARY
Country VARCHAR(4) CONSTRAINT PrCountry NOT NULL REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Population NUMERIC CONSTRAINT PrPop CHECK (Population >= 0),
Area NUMERIC CONSTRAINT PrAr CHECK (Area >= 0),
Capital VARCHAR(35),
CapProv VARCHAR(35),
CONSTRAINT PrKey PRIMARY KEY (Name, Country)
);
CREATE TABLE Economy
(
Country VARCHAR(4) CONSTRAINT EconomyKey PRIMARY KEY REFERENCES Country DEFERRABLE INITIALLY DEFERRED,
GDP NUMERIC CONSTRAINT EconomyGDP CHECK (GDP >= 0),
Agriculture NUMERIC,
Service NUMERIC,
Industry NUMERIC,
Inflation NUMERIC
);
CREATE TABLE Population
(
Country VARCHAR(4) CONSTRAINT PopKey PRIMARY KEY REFERENCES Country DEFERRABLE INITIALLY DEFERRED,
Population_Growth NUMERIC,
Infant_Mortality NUMERIC
);
CREATE TABLE Politics
(
Country VARCHAR(4) CONSTRAINT PoliticsKey PRIMARY KEY REFERENCES Country DEFERRABLE INITIALLY DEFERRED,
Independence DATE,
Dependent VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED,
Government VARCHAR(120)
);
CREATE TABLE Language
(
Country VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Name VARCHAR(50), -- PRIMARY
Percentage NUMERIC CONSTRAINT LanguagePercent CHECK ((Percentage > 0) AND (Percentage <= 100)),
CONSTRAINT LanguageKey PRIMARY KEY (Name, Country)
);
CREATE TABLE Religion
(
Country VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Name VARCHAR(50), -- PRIMARY
Percentage NUMERIC CONSTRAINT ReligionPercent CHECK ((Percentage > 0) AND (Percentage <= 100)),
CONSTRAINT ReligionKey PRIMARY KEY (Name, Country)
);
CREATE TABLE EthnicGroup
(
Country VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Name VARCHAR(50), -- PRIMARY
Percentage NUMERIC CONSTRAINT EthnicPercent CHECK ((Percentage > 0) AND (Percentage <= 100)),
CONSTRAINT EthnicKey PRIMARY KEY (Name, Country)
);
CREATE TABLE Continent
(
Name VARCHAR(20) CONSTRAINT ContinentKey PRIMARY KEY,
Area NUMERIC(10)
);
CREATE TABLE borders
(
Country1 VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country2 VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Length NUMERIC CHECK (Length > 0),
CONSTRAINT BorderKey PRIMARY KEY (Country1,Country2)
);
CREATE TABLE encompasses
(
Country VARCHAR(4) NOT NULL REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Continent VARCHAR(20) NOT NULL REFERENCES Continent DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Percentage NUMERIC CHECK ((Percentage > 0) AND (Percentage <= 100)),
CONSTRAINT EncompassesKey PRIMARY KEY (Country,Continent)
);
CREATE TABLE Organization
(
Abbreviation VARCHAR(12) PRIMARY KEY, -- PRIMARY
Name VARCHAR(80) NOT NULL,
City VARCHAR(35) , -- REFERENCES City
Country VARCHAR(4) , -- REFERENCES City
Province VARCHAR(35) , -- REFERENCES City
Established DATE,
CONSTRAINT OrgNameUnique UNIQUE (Name),
CONSTRAINT City_FKey FOREIGN KEY (City, Country, Province) REFERENCES City(Name, Country, Province) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE isMember
(
Country VARCHAR(4) REFERENCES Country DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Organization VARCHAR(12) REFERENCES Organization DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Type VARCHAR(35) DEFAULT 'member',
CONSTRAINT MemberKey PRIMARY KEY (Country,Organization) );
CREATE TABLE Mountain
(
Name VARCHAR(35) CONSTRAINT MountainKey PRIMARY KEY,
Mountains VARCHAR(35),
Height NUMERIC,
Type VARCHAR(10),
);
CREATE TABLE Desert
(
Name VARCHAR(35) CONSTRAINT DesertKey PRIMARY KEY,
Area NUMERIC,
);
CREATE TABLE Island
(
Name VARCHAR(35) CONSTRAINT IslandKey PRIMARY KEY,
Islands VARCHAR(35),
Area NUMERIC CONSTRAINT IslandAr check (Area >= 0),
Height NUMERIC,
Type VARCHAR(10),
);
CREATE TABLE Lake
(
Name VARCHAR(35) CONSTRAINT LakeKey PRIMARY KEY,
Area NUMERIC CONSTRAINT LakeAr CHECK (Area >= 0),
Depth NUMERIC CONSTRAINT LakeDpth CHECK (Depth >= 0),
Altitude NUMERIC,
Type VARCHAR(10),
River VARCHAR(35),
);
CREATE TABLE Sea
(
Name VARCHAR(35) CONSTRAINT SeaKey PRIMARY KEY,
Depth NUMERIC CONSTRAINT SeaDepth CHECK (Depth >= 0)
);
CREATE TABLE River
(
Name VARCHAR(35) CONSTRAINT RiverKey PRIMARY KEY,
River VARCHAR(35) REFERENCES River DEFERRABLE INITIALLY DEFERRED,
Lake VARCHAR(35) REFERENCES Lake DEFERRABLE INITIALLY DEFERRED,
Sea VARCHAR(35) REFERENCES Sea DEFERRABLE INITIALLY DEFERRED,
Length NUMERIC CONSTRAINT RiverLength CHECK (Length >= 0),
Mountains VARCHAR(35),
SourceAltitude NUMERIC,
);
CREATE TABLE geo_Mountain
(
Mountain VARCHAR(35) REFERENCES Mountain DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GMountainKey PRIMARY KEY (Province,Country,Mountain),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_Desert
(
Desert VARCHAR(35) REFERENCES Desert DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GDesertKey PRIMARY KEY (Province, Country, Desert),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_Island
(
Island VARCHAR(35) REFERENCES Island DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GIslandKey PRIMARY KEY (Province, Country, Island),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_River
(
River VARCHAR(35) REFERENCES River DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GRiverKey PRIMARY KEY (Province ,Country, River),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_Sea
(
Sea VARCHAR(35) REFERENCES Sea DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GSeaKey PRIMARY KEY (Province, Country, Sea),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_Lake
(
Lake VARCHAR(35) REFERENCES Lake DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GLakeKey PRIMARY KEY (Province, Country, Lake),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_Source
(
River VARCHAR(35) REFERENCES River DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GSourceKey PRIMARY KEY (Province, Country, River),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE geo_Estuary
(
River VARCHAR(35) REFERENCES River DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Country VARCHAR(4) , -- PRIMARY REFERENCES Province
Province VARCHAR(35) , -- PRIMARY REFERENCES Province
CONSTRAINT GEstuaryKey PRIMARY KEY (Province, Country, River),
CONSTRAINT Province_FKey FOREIGN KEY (Province, Country) REFERENCES Province(Name, Country) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE mergesWith
(
Sea1 VARCHAR(35) REFERENCES Sea DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Sea2 VARCHAR(35) REFERENCES Sea DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
CONSTRAINT MergesWithKey PRIMARY KEY (Sea1, Sea2)
);
CREATE TABLE located
(
City VARCHAR(35) , -- REFERENCES City
Province VARCHAR(35) , -- REFERENCES City
Country VARCHAR(4) , -- REFERENCES City
River VARCHAR(35) REFERENCES River DEFERRABLE INITIALLY DEFERRED,
Lake VARCHAR(35) REFERENCES Lake DEFERRABLE INITIALLY DEFERRED,
Sea VARCHAR(35) REFERENCES Sea DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT City_FKey FOREIGN KEY (City, Country, Province) REFERENCES City(Name, Country, Province) DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT located_U_River UNIQUE (City, Country, Province, River),
CONSTRAINT located_U_Lake UNIQUE (City, Country, Province, Lake),
CONSTRAINT located_U_Sea UNIQUE (City, Country, Province, Sea)
);
CREATE TABLE locatedOn
(
City VARCHAR(35) , -- PRIMARY REFERENCES City
Province VARCHAR(35) , -- PRIMARY REFERENCES City
Country VARCHAR(4) , -- PRIMARY REFERENCES City
Island VARCHAR(35) REFERENCES Island DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
CONSTRAINT locatedOnKey PRIMARY KEY (City, Province, Country, Island),
CONSTRAINT City_FKey FOREIGN KEY (City, Country, Province) REFERENCES City(Name, Country, Province) DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE islandIn
(
Island VARCHAR(35) REFERENCES Island DEFERRABLE INITIALLY DEFERRED,
Sea VARCHAR(35) REFERENCES Sea DEFERRABLE INITIALLY DEFERRED,
Lake VARCHAR(35) REFERENCES Lake DEFERRABLE INITIALLY DEFERRED,
River VARCHAR(35) REFERENCES River DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT islandIn_U_Sea UNIQUE (Island, Sea),
CONSTRAINT islandIn_U_Lake UNIQUE (Island, Lake),
CONSTRAINT islandIn_U_River UNIQUE (Island, River)
);
CREATE TABLE MountainOnIsland
(
Mountain VARCHAR(35) REFERENCES Mountain DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
Island VARCHAR(35) REFERENCES Island DEFERRABLE INITIALLY DEFERRED, -- PRIMARY
CONSTRAINT MntIslKey PRIMARY KEY (Mountain, Island)
);
|
SELECT s.Name,
s.Manufacturer
FROM Spaceships s
LEFT JOIN Journeys j ON s.Id=j.SpaceshipId
LEFT JOIN TravelCards tc ON j.Id=tc.JourneyId
LEFT JOIN Colonists c ON c.Id=tc.ColonistId
WHERE DATEDIFF(YEAR,c.BirthDate,'01/01/2019')<30 AND tc.JobDuringJourney='Pilot'
ORDER BY s.Name
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.11 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 10.3.0.5771
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping structure for table npress.codeblock
CREATE TABLE IF NOT EXISTS `codeblock` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`content` text,
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `UQ_88c8731f45a50f1c39a2917b3a5` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.codeblock: ~2 rows (approximately)
DELETE FROM `codeblock`;
/*!40000 ALTER TABLE `codeblock` DISABLE KEYS */;
INSERT INTO `codeblock` (`id`, `name`, `slug`, `content`, `status`, `created_at`, `updated_at`) VALUES
(1, 'My first code block', 'my-first-code-block', '<p>My first code block content</p>', 'active', '2020-06-22 22:38:23', '2020-06-22 22:38:23'),
(2, 'Course Card', 'course-card', '<div class="card">\n <img class="card-img-top" src="{{ img_src }}" alt="Card image cap">\n <div class="card-body">\n <h5 class="card-title">{{ title }}</h5>\n </div>\n <div class="card-footer d-flex justify-content-between">\n <div>\n {{ attendants|default(0) }} <i class="fas fa-users"></i>\n {{ stars|default(0) }} <i class="fas fa-star"></i>\n </div>\n <div class="rating"> \n {% for i in range(1, 5) %}\n <i class="{{ i <= rating ? \'fas\' : \'far\' }} fa-star"></i> \n {% endfor %}\n </div>\n </div>\n</div>', 'active', '2020-06-23 20:50:53', '2020-06-23 20:50:53');
/*!40000 ALTER TABLE `codeblock` ENABLE KEYS */;
-- Dumping structure for table npress.comment
CREATE TABLE IF NOT EXISTS `comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`page_id` int(11) NOT NULL,
`parent_id` int(11) NOT NULL DEFAULT '0',
`author_name` varchar(255) NOT NULL,
`author_email` varchar(255) NOT NULL,
`content` text,
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `FK_3b52abe435455a9c92a856baf76` (`page_id`),
CONSTRAINT `FK_3b52abe435455a9c92a856baf76` FOREIGN KEY (`page_id`) REFERENCES `page` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.comment: ~1 rows (approximately)
DELETE FROM `comment`;
/*!40000 ALTER TABLE `comment` DISABLE KEYS */;
INSERT INTO `comment` (`id`, `page_id`, `parent_id`, `author_name`, `author_email`, `content`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 0, 'Comment title', '<EMAIL>', 'My first comment', 'active', '2020-06-22 22:38:22', '2020-06-22 22:38:22');
/*!40000 ALTER TABLE `comment` ENABLE KEYS */;
-- Dumping structure for table npress.file
CREATE TABLE IF NOT EXISTS `file` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`uri` varchar(255) NOT NULL,
`type` varchar(128) NOT NULL,
`html_title` text,
`html_alt` text,
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `UQ_89b4fe084a7f36a2ddf04cc427f` (`uri`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.file: ~22 rows (approximately)
DELETE FROM `file`;
/*!40000 ALTER TABLE `file` DISABLE KEYS */;
INSERT INTO `file` (`id`, `name`, `uri`, `type`, `html_title`, `html_alt`, `status`, `created_at`, `updated_at`) VALUES
(1, '8ecc0262-92c8-4459-9b0e-ef0de283dd56.jpg', '/uploads/8ecc0262-92c8-4459-9b0e-ef0de283dd56.jpg', 'image/jpeg', '', '', 'active', '2020-06-22 22:39:31', '2020-06-22 22:39:31'),
(2, 'zovu css.txt', '/uploads/zovu css.txt', 'text/plain', '', '', 'active', '2020-06-22 23:26:56', '2020-06-22 23:26:56'),
(3, 'poze playform.txt', '/uploads/poze playform.txt', 'text/plain', '', '', 'active', '2020-06-22 23:26:59', '2020-06-22 23:26:59'),
(4, 'logo.png', '/uploads/logo.png', 'image/png', '', '', 'active', '2020-06-23 19:41:17', '2020-06-23 19:41:17'),
(5, 'pexels-photo-448877.jpeg', '/uploads/pexels-photo-448877.jpeg', 'image/jpeg', '', '', 'active', '2020-06-23 19:52:30', '2020-06-23 19:52:30'),
(6, 'pexels-photo-716276.jpeg', '/uploads/pexels-photo-716276.jpeg', 'image/jpeg', '', '', 'active', '2020-06-23 19:52:30', '2020-06-23 19:52:30'),
(7, 'blog-5-450x445.jpg', '/uploads/blog-5-450x445.jpg', 'image/jpeg', '', '', 'active', '2020-06-23 22:34:44', '2020-06-23 22:34:44'),
(8, 'pexels-photo-301920.jpeg', '/uploads/pexels-photo-301920.jpeg', 'image/jpeg', '', '', 'active', '2020-06-25 14:41:38', '2020-06-25 14:41:38'),
(9, 'book-4.jpg', '/uploads/book-4.jpg', 'image/jpeg', '', '', 'active', '2020-06-25 15:19:00', '2020-06-25 15:19:00'),
(10, 'team5-8-480x300.jpg', '/uploads/team5-8-480x300.jpg', 'image/jpeg', '', '', 'active', '2020-06-28 16:43:42', '2020-06-28 16:43:42'),
(11, 'team3-8-480x300.jpg', '/uploads/team3-8-480x300.jpg', 'image/jpeg', '', '', 'active', '2020-06-28 16:43:44', '2020-06-28 16:43:44'),
(12, 'team6-480x300.jpg', '/uploads/team6-480x300.jpg', 'image/jpeg', '', '', 'active', '2020-06-28 16:43:46', '2020-06-28 16:43:46'),
(13, 'larozse-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', '/uploads/larozse-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', 'image/png', '', '', 'active', '2020-06-28 17:21:25', '2020-06-28 17:21:25'),
(14, 'bolier-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', '/uploads/bolier-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', 'image/png', '', '', 'active', '2020-06-28 17:21:27', '2020-06-28 17:21:27'),
(15, 'mapmaster-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', '/uploads/mapmaster-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', 'image/png', '', '', 'active', '2020-06-28 17:21:29', '2020-06-28 17:21:29'),
(16, 'darkside-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', '/uploads/darkside-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', 'image/png', '', '', 'active', '2020-06-28 17:21:31', '2020-06-28 17:21:31'),
(17, 'madrin-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', '/uploads/madrin-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png', 'image/png', '', '', 'active', '2020-06-28 17:21:33', '2020-06-28 17:21:33'),
(18, 'pexels-photo-108148.jpeg', '/uploads/pexels-photo-108148.jpeg', 'image/jpeg', '', '', 'active', '2020-06-28 18:04:23', '2020-06-28 18:04:23'),
(19, 'pexels-photo-374016.jpeg', '/uploads/pexels-photo-374016.jpeg', 'image/jpeg', '', '', 'active', '2020-06-28 18:04:23', '2020-06-28 18:04:23'),
(20, 'blog-5.jpg', '/uploads/blog-5.jpg', 'image/jpeg', '', '', 'active', '2020-06-28 18:04:23', '2020-06-28 18:04:23'),
(21, 'hands-people-woman-working.jpg', '/uploads/hands-people-woman-working.jpg', 'image/jpeg', '', '', 'active', '2020-06-28 18:04:23', '2020-06-28 18:04:23'),
(22, 'blog-4.jpg', '/uploads/blog-4.jpg', 'image/jpeg', '', '', 'active', '2020-06-28 18:04:23', '2020-06-28 18:04:23');
/*!40000 ALTER TABLE `file` ENABLE KEYS */;
-- Dumping structure for table npress.menu
CREATE TABLE IF NOT EXISTS `menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`is_default` int(1) NOT NULL DEFAULT '0',
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.menu: ~1 rows (approximately)
DELETE FROM `menu`;
/*!40000 ALTER TABLE `menu` DISABLE KEYS */;
INSERT INTO `menu` (`id`, `name`, `slug`, `is_default`, `status`, `created_at`, `updated_at`) VALUES
(1, 'My First Menu', 'first-menu', 1, 'active', '2020-06-22 22:38:22', '2020-06-22 22:38:22');
/*!40000 ALTER TABLE `menu` ENABLE KEYS */;
-- Dumping structure for table npress.menu_item
CREATE TABLE IF NOT EXISTS `menu_item` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`menu_id` int(11) NOT NULL,
`parent_id` int(11) NOT NULL DEFAULT '0',
`order` int(11) NOT NULL DEFAULT '0',
`label` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.menu_item: ~1 rows (approximately)
DELETE FROM `menu_item`;
/*!40000 ALTER TABLE `menu_item` DISABLE KEYS */;
INSERT INTO `menu_item` (`id`, `menu_id`, `parent_id`, `order`, `label`, `slug`, `url`, `status`, `created_at`, `updated_at`) VALUES
(3, 1, 0, 0, 'Home', 'home', '/home', 'active', '2020-06-28 18:34:22', '2020-06-28 18:34:22');
/*!40000 ALTER TABLE `menu_item` ENABLE KEYS */;
-- Dumping structure for table npress.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`timestamp` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.migrations: ~1 rows (approximately)
DELETE FROM `migrations`;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` (`id`, `timestamp`, `name`) VALUES
(1, 1564669039537, 'Tables1564669039537');
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
-- Dumping structure for table npress.page
CREATE TABLE IF NOT EXISTS `page` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`uri` varchar(255) NOT NULL,
`content` text,
`custom_css` text,
`custom_js` text,
`seo_title` varchar(255) DEFAULT NULL,
`seo_keywords` text,
`seo_description` text,
`seo_robots` varchar(255) DEFAULT NULL,
`show_comment_section` int(1) NOT NULL DEFAULT '1',
`show_comment_form` int(1) NOT NULL DEFAULT '1',
`show_sidebar` int(1) NOT NULL DEFAULT '1',
`sidebar_content` text,
`is_homepage` int(1) NOT NULL DEFAULT '0',
`header_full_width` int(1) NOT NULL DEFAULT '0',
`header_content` text,
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `UQ_3e65301a379e6ca2c468c700aa9` (`uri`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.page: ~2 rows (approximately)
DELETE FROM `page`;
/*!40000 ALTER TABLE `page` DISABLE KEYS */;
INSERT INTO `page` (`id`, `title`, `uri`, `content`, `custom_css`, `custom_js`, `seo_title`, `seo_keywords`, `seo_description`, `seo_robots`, `show_comment_section`, `show_comment_form`, `show_sidebar`, `sidebar_content`, `is_homepage`, `header_full_width`, `header_content`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Home', '/home', '<div class="container mb-5">\n <h2>Popular courses</h2>\n <div class="row">\n <div class="col-12">\n <div class="carousel slide" data-ride="carousel" data-interval="20000">\n <div class="carousel-inner">\n <div class="carousel-item">\n <div class="row">\n <div class="col-4">[[course-card img_src="/uploads/blog-5-450x445.jpg" attendants="2" stars="1" rating="4" title="Sample course"]]</div>\n <div class="col-4">[[course-card img_src="/uploads/blog-5-450x445.jpg" attendants="4" stars="1" rating="5" title="Sample"]]</div>\n <div class="col-4">[[course-card img_src="/uploads/blog-5-450x445.jpg" title="Sample"]]</div>\n </div>\n </div>\n <div class="carousel-item active">\n <div class="row">\n <div class="col-4">[[course-card img_src="/uploads/blog-5-450x445.jpg" attendants=2 stars=1 title="Sample"]]</div>\n <div class="col-4">[[course-card img_src="/uploads/blog-5-450x445.jpg" attendants=4 stars=1 title="Sample"]]</div>\n <div class="col-4">[[course-card img_src="/uploads/blog-5-450x445.jpg" title="Sample"]]</div>\n </div>\n </div> \n </div>\n <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">\n \n <span class="sr-only">Previous</span>\n </a>\n <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">\n \n <span class="sr-only">Next</span>\n </a>\n </div>\n </div>\n </div>\n</div>\n<div class="achievements py-5 text-white text-center font-weight-bold">\n <h2 class="font-weight-bold">CENTER ACHIEVEMENTS</h2>\n <p>Here you can review some statistics about our Education Center</p>\n <div class="row mt-5">\n <div class="col-sm">\n <span class="d-block text-warning">10,328</span>\n FOREIGN FOLLOWERS\n </div>\n <div class="col-sm">\n <span class="d-block text-warning">549</span>\n CLASSES COMPLETE\n </div>\n <div class="col-sm">\n <span class="d-block text-warning">6,789</span>\n STUDENTS ENROLLED\n </div>\n </div>\n</div>\n<div class="bg-light py-5 mb-5">\n<div class="container">\n <div class="row">\n <div class="col-sm">\n <img class="img-fluid" src="/uploads/book-4.jpg">\n </div>\n <div class="col-sm d-flex align-items-center">\n <div>\n <h2 class="font-weight-bold">HIGH QUALITY EDUCATION</h2>\n <p>Dis class porro pretium dignissimos veritatis, nostrud natus curae, animi diamlorem? Netus, quia mus, proident quaerat iaculis nascetur sodales, vulputate, sequi mollitia class repellat, aliquip aliquid. Justo iste veniam amet,\n </p>\n </div>\n </div>\n </div>\n </div>\n</div>\n<div class="container mb-5">\n <h2 class="font-weight-bold">Top courses</h2>\n <a href="#">View all</a>\n <div class="row mt-4">\n <div class="col-sm">\n <a href="#" class="d-block course-holder">\n <span class="course-bg" style="background-image: url(/uploads/pexels-photo-374016.jpeg)"></span>\n <span class="course-info">Getting started</span>\n </a>\n </div>\n <div class="col-sm mt-4 mt-sm-0">\n <div class="row">\n <div class="col-6">\n <a href="#" class="d-block course-holder">\n <span class="course-bg" style="background-image: url(/uploads/pexels-photo-108148.jpeg)"></span>\n <span class="course-info">Photography Fundamentals</span>\n </a>\n </div>\n <div class="col-6">\n <a href="#" class="d-block course-holder">\n <span class="course-bg" style="background-image: url(/uploads/blog-5.jpg)"></span>\n <span class="course-info">Affiliate Marketing</span>\n </a>\n </div>\n <div class="col-6">\n <a href="#" class="d-block course-holder mt-4">\n <span class="course-bg" style="background-image: url(/uploads/hands-people-woman-working.jpg)"></span><span class="course-info">The Complete HTML5/CSS3</span>\n </a></div>\n <div class="col-6">\n <a href="#" class="d-block course-holder mt-4">\n <span class="course-bg" style="background-image: url(/uploads/blog-4.jpg)"></span>\n <span class="course-info">Become a SEO Master</span></a>\n </div>\n </div>\n </div>\n </div>\n</div>\n<div class="bg-light py-5">\n <div class="container">\n <h2 class="font-weight-bold">Our Teachers</h2>\n <div class="row">\n <div class="col-sm">\n <img src="/uploads/team5-8-480x300.jpg" class="img-fluid mb-3">\n <h4><NAME></h4>\n <p>Donec a felis sed ligula aliquet sollicitudin a in elit. Nunc at commodo erat, fringilla egestas tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae.</p>\n <a href="#">View details</a>\n </div>\n <div class="col-sm">\n <img src="/uploads/team3-8-480x300.jpg" class="img-fluid mb-3">\n <h4><NAME></h4>\n <p>Donec a felis sed ligula aliquet sollicitudin a in elit. Nunc at commodo erat, fringilla egestas tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae.</p>\n <a href="#">View details</a>\n </div>\n <div class="col-sm">\n <img src="/uploads/team6-480x300.jpg" class="img-fluid mb-3">\n <h4><NAME></h4>\n <p>Donec a felis sed ligula aliquet sollicitudin a in elit. Nunc at commodo erat, fringilla egestas tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae.</p>\n <a href="#">View details</a>\n </div>\n </div>\n </div>\n</div>\n<div class="what-will-you-learn bg-secondary py-5 text-white">\n <div class="container">\n <h2 class="font-weight-bold">WHAT WILL YOU LEARN</h2>\n <div class="row text-center">\n <div class="col-sm">\n <div class="bg-primary py-5 my-2">\n <i class="fas fa-lightbulb d-block mb-3"></i>\n Logical Idea\n </div>\n </div>\n <div class="col-sm">\n <div class="bg-info py-5 my-2">\n <i class="fas fa-globe d-block mb-3"></i>\n Web development\n </div>\n </div>\n <div class="col-sm">\n <div class="bg-success py-5 my-2">\n <i class="fas fa-random d-block mb-3"></i>\n Social Marketing\n </div>\n </div>\n <div class="col-sm">\n <div class="bg-warning py-5 my-2">\n <i class="fas fa-laptop d-block mb-3"></i>\n Graphic & Design\n </div>\n </div>\n <div class="col-sm">\n <div class="bg-danger py-5 my-2">\n <i class="fas fa-money-bill-alt d-block mb-3"></i>\n Business & Finance\n </div>\n </div>\n </div>\n </div>\n</div>\n<div class="py-5">\n <div class="container">\n <h2 class="font-weight-bold">Our partners</h2>\n <div class="row">\n <div class="col-sm">\n <img src="/uploads/larozse-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png" class="img-fluid">\n </div>\n <div class="col-sm">\n <img src="/uploads/bolier-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png" class="img-fluid">\n </div>\n <div class="col-sm">\n <img src="/uploads/mapmaster-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png" class="img-fluid">\n </div>\n <div class="col-sm">\n <img src="/uploads/larozse-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png" class="img-fluid">\n </div>\n <div class="col-sm">\n <img src="/uploads/bolier-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png" class="img-fluid">\n </div>\n <div class="col-sm">\n <img src="/uploads/mapmaster-nq4e6i9q73t7ji58wdo2xdpg98xnq2yq4m6cd6afoc.png" class="img-fluid">\n </div>\n </div>\n </div>\n</div>', 'header .carousel-item h2{\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%,-50%);\n color: #fff;\n z-index: 1;\n}\n@media (max-width: 767px){\n header .carousel-item h2{\n font-size: 1.5rem\n }\n}\nheader .carousel-item img{\n max-height: 100vh;\n object-fit: cover;\n}\n.benefit-box{\n margin-top: -30px;\n}\n.benefit-box .fas{\n font-size: 56px;\n}\n.achievements{\n padding-left: 2rem;\n padding-right: 2rem;\n background-image: url(/uploads/pexels-photo-301920.jpeg);\n background-repeat: no-repeat;\n background-size: cover;\n background-attachment: fixed;\n}\n.achievements .text-warning{\n font-size: 32px;\n}\n.what-will-you-learn i{\n font-size: 32px;\n}\n.course-bg{\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n display: block;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n width: calc(100% + 40px);\n max-width: none;\n min-height: 100.6%;\n}\n.course-info{\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n color: #fff;\n text-align: center;\n padding-top: 15px;\n padding-bottom: 15px;\n background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.8)), to(transparent));\n background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0, transparent 100%);\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.course-holder{\n position: relative;\n padding-bottom: 65%;\n background-color: #495057;\n overflow: hidden;\n border-radius: 0;\n}', '', '', '', '', '', 1, 1, 0, '', 1, 1, '<div class="carousel slide" data-ride="carousel" data-interval="10000">\n <div class="carousel-inner">\n <div class="carousel-item active">\n <h2>E-Learning</h2>\n <img class="d-block w-100" src=" /uploads/pexels-photo-716276.jpeg" alt="Second slide" />\n </div>\n <div class="carousel-item">\n <h2>Welcome to Education</h2>\n <img class="d-block w-100" src="/uploads/pexels-photo-448877.jpeg" alt="First slide" />\n </div> \n </div>\n <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">\n <span class="carousel-control-prev-icon" aria-hidden="true"></span>\n <span class="sr-only">Previous</span>\n </a>\n <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">\n <span class="carousel-control-next-icon" aria-hidden="true"></span>\n <span class="sr-only">Next</span>\n </a>\n</div>\n <div class="benefit-box container text-white mb-5">\n <div class="row">\n <div class="col-sm bg-success px-5 py-3">\n <div class="d-flex align-items-center">\n <div>\n <h3>Courses Online</h3>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n </div>\n <i class="fas fa-graduation-cap"></i>\n </div>\n </div>\n <div class="col-sm bg-warning px-5 py-3">\n <div class="d-flex align-items-center">\n <div>\n <h3>Apply Now</h3>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n </div>\n <i class="fas fa-trophy"></i>\n </div>\n </div>\n <div class="col-sm bg-primary px-5 py-3">\n <div class="d-flex align-items-center">\n <div>\n <h3>Certified Teachers</h3>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n </div>\n <i class="fas fa-pencil-alt"></i>\n </div>\n </div>\n </div>\n </div>', 'active', '2021-01-31 02:00:00', '2020-06-22 22:38:22'),
(2, 'Another sample page', '/another-sample-page', '<h2>Another sample page h2</h2><h3>Another sample page h3</h3><p>Another sample page first paragraph</p>', NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, NULL, 0, 0, NULL, 'active', '2020-06-22 22:38:22', '2020-06-22 22:38:22');
/*!40000 ALTER TABLE `page` ENABLE KEYS */;
-- Dumping structure for table npress.setting
CREATE TABLE IF NOT EXISTS `setting` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(128) NOT NULL,
`value` text NOT NULL,
`options` text,
`name` varchar(128) DEFAULT NULL,
`description` text,
`status` varchar(16) NOT NULL,
`input_type` varchar(64) DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `UQ_1c4c95d773004250c157a744d6e` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.setting: ~10 rows (approximately)
DELETE FROM `setting`;
/*!40000 ALTER TABLE `setting` DISABLE KEYS */;
INSERT INTO `setting` (`id`, `key`, `value`, `options`, `name`, `description`, `status`, `input_type`, `created_at`, `updated_at`) VALUES
(1, 'admin_email', '<EMAIL>', NULL, 'Admin Email', 'Where to send notification emails', 'active', 'text', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(2, 'site_name', 'Education', 'null', 'Site Name', 'Will be displayed in case a logo is not set', 'active', 'text', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(3, 'site_logo', '/uploads/logo.png', 'null', 'Site Logo', 'Site Logo', 'active', 'image', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(4, 'active_theme', 'education', '[]', 'Active Theme', 'Active Theme', 'active', 'select', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(5, 'recaptcha_enabled', '0', 'null', 'Recaptcha Enabled', 'Recaptcha Enabled', 'active', 'checkbox', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(6, 'recaptcha_site_key', '', NULL, 'Recaptcha Site Key', 'Recaptcha Site Key', 'active', 'text', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(7, 'google_analytics_script', '', NULL, 'Google Analytics Script', 'Paste the code snippet here', 'active', 'textarea', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(8, 'recaptcha_secret_key', '', NULL, 'Recaptcha Secret Key', 'Recaptcha Secret Key', 'active', 'text', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(9, 'navbar_layout', 'logo-left-menu-right', '[{"label":"Logo left, menu right","value":"logo-left-menu-right"},{"label":"Logo right, menu left","value":"logo-right-menu-left"}]', 'Navbar layout', 'Navbar layout', 'active', 'select', '2020-06-22 22:38:22', '2020-06-22 22:38:22'),
(10, 'site_width', 'container-fluid', '[{"label":"Full width","value":"container-fluid"},{"label":"Boxed","value":"container"}]', 'Site width', 'Full width or boxed', 'active', 'select', '2020-06-22 22:38:22', '2020-06-22 22:38:22');
/*!40000 ALTER TABLE `setting` ENABLE KEYS */;
-- Dumping structure for table npress.user
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`salt` varchar(255) NOT NULL,
`status` varchar(16) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `UQ_e12875<PASSWORD>` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- Dumping data for table npress.user: ~1 rows (approximately)
DELETE FROM `user`;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` (`id`, `email`, `password`, `salt`, `status`, `created_at`, `updated_at`) VALUES
(1, '<EMAIL>', '<PASSWORD>4e9a7b481993b6449386d7ca9f46606e49e55a472877', '90136f0e500493e216fc27b097c79055', 'active', '2020-06-22 22:38:22', '2020-06-22 22:38:22');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
<filename>extension/tpcds/dsdgen/queries/46.sql
SELECT c_last_name,
c_first_name,
ca_city,
bought_city,
ss_ticket_number,
amt,
profit
FROM
(SELECT ss_ticket_number,
ss_customer_sk,
ca_city bought_city,
sum(ss_coupon_amt) amt,
sum(ss_net_profit) profit
FROM store_sales,
date_dim,
store,
household_demographics,
customer_address
WHERE store_sales.ss_sold_date_sk = date_dim.d_date_sk
AND store_sales.ss_store_sk = store.s_store_sk
AND store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
AND store_sales.ss_addr_sk = customer_address.ca_address_sk
AND (household_demographics.hd_dep_count = 4
OR household_demographics.hd_vehicle_count= 3)
AND date_dim.d_dow IN (6,
0)
AND date_dim.d_year IN (1999,
1999+1,
1999+2)
AND store.s_city IN ('Fairview',
'Midway')
GROUP BY ss_ticket_number,
ss_customer_sk,
ss_addr_sk,
ca_city) dn,
customer,
customer_address current_addr
WHERE ss_customer_sk = c_customer_sk
AND customer.c_current_addr_sk = current_addr.ca_address_sk
AND current_addr.ca_city <> bought_city
ORDER BY c_last_name NULLS FIRST,
c_first_name NULLS FIRST,
ca_city NULLS FIRST,
bought_city NULLS FIRST,
ss_ticket_number NULLS FIRST
LIMIT 100;
|
<filename>airbyte-integrations/bases/base-normalization/integration_tests/normalization_test_output/mysql/test_nested_streams/second_output/airbyte_ctes/test_normalization/nested_stream_with_co_3double_array_data_ab3.sql
create view _airbyte_test_normalization.`nested_stream_with_co_3double_array_data_ab3__dbt_tmp` as (
-- SQL model to build a hash column based on the values of this record
select
md5(cast(concat(coalesce(cast(_airbyte_partition_hashid as char), ''), '-', coalesce(cast(id as char), '')) as char)) as _airbyte_double_array_data_hashid,
tmp.*
from _airbyte_test_normalization.`nested_stream_with_co_3double_array_data_ab2` tmp
-- double_array_data at nested_stream_with_complex_columns_resulting_into_long_names/partition/double_array_data
where 1 = 1
);
|
<gh_stars>1-10
DO
$$
BEGIN
IF NOT EXISTS(
SELECT
FROM pg_user
WHERE usename = 'cool_user')
THEN
CREATE USER cool_user
WITH PASSWORD '<PASSWORD>';
END IF;
CREATE SCHEMA IF NOT EXISTS cool_schema;
ALTER SCHEMA cool_schema
OWNER TO cool_user;
GRANT ALL PRIVILEGES ON SCHEMA cool_schema TO cool_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA cool_schema TO cool_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA cool_schema TO cool_user;
END
$$;
|
-- randexpr1.test
--
-- db eval {SELECT case (select ( - - -(+max(c))+min(e)-(count(*))+cast(avg(t1.e) AS integer)-min(t1.a)*(cast(avg(11) AS integer))) from t1) when t1.d then t1.c else case (select max(a) from t1) when -t1.b then case when not 17<>case when t1.e<=t1.d or ((t1.e))=t1.e then t1.f when e>=t1.b then 11 else t1.d end or d in (t1.f,t1.a,t1.a) then c | 17 when t1.f between t1.a and -t1.e then d else t1.c end else t1.c end end-t1.c FROM t1 WHERE NOT (not (exists(select 1 from t1 where a<>11+t1.d-t1.a+(select count(distinct t1.d)++max(case e when coalesce((select 11 from t1 where a>=case when coalesce((select f from t1 where exists(select 1 from t1 where 13 in (t1.c,13,t1.a))),(d))+f not between d and t1.e then d else (t1.c) end-13),(d))-t1.d then t1.a else 17 end) from t1)) and not a<(d)*19))}
SELECT case (select ( - - -(+max(c))+min(e)-(count(*))+cast(avg(t1.e) AS integer)-min(t1.a)*(cast(avg(11) AS integer))) from t1) when t1.d then t1.c else case (select max(a) from t1) when -t1.b then case when not 17<>case when t1.e<=t1.d or ((t1.e))=t1.e then t1.f when e>=t1.b then 11 else t1.d end or d in (t1.f,t1.a,t1.a) then c | 17 when t1.f between t1.a and -t1.e then d else t1.c end else t1.c end end-t1.c FROM t1 WHERE NOT (not (exists(select 1 from t1 where a<>11+t1.d-t1.a+(select count(distinct t1.d)++max(case e when coalesce((select 11 from t1 where a>=case when coalesce((select f from t1 where exists(select 1 from t1 where 13 in (t1.c,13,t1.a))),(d))+f not between d and t1.e then d else (t1.c) end-13),(d))-t1.d then t1.a else 17 end) from t1)) and not a<(d)*19))
|
GO
USE [SoftUni]
GO
INSERT INTO [Towns]
VALUES (
'Sofia'
) , (
'Plovdiv'
) , (
'Varna'
) , (
'Burgas'
)
GO
INSERT INTO [Departments]
VALUES (
'Engineering'
) , (
'Sales'
) , (
'Marketing'
) , (
'Software Development'
) , (
'Quality Assurance'
)
GO
INSERT INTO [Employees]
VALUES (
'Ivan', 'Ivanov', 'Ivanov', '.NET Developer', 4, '2013-02-01', 3500.00, NULL
) , (
'Petar', 'Petrov', 'Petrov', 'Senior Engineer', 1, '2004-03-02', 4000.00, NULL
) , (
'Maria', 'Petrova', 'Ivanova', 'Intern', 5, '2016-08-28', 525.25, NULL
) , (
'Georgi', 'Teziev', 'Ivanov', 'CEO', 2, '2007-12-09', 3000.00, NULL
) , (
'Peter', 'Pan', 'Pan', 'Intern', 3, '2016-08-28', 599.88, NULL
)
|
<filename>src/main/sql/coding.sql
-- username=coding, password=<PASSWORD>
-- mysql is used
CREATE DATABASE if NOT EXISTS `coding` DEFAULT CHARACTER SET = utf8mb4;
CREATE TABLE `bid` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`source_id` varchar(255),
`source` varchar(255),
`bid` decimal(8,5),
`updated_at` timestamp null,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
<filename>application/weixin/install.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS `wp_custom_menu` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`pid` int(10) NULL COMMENT '一级菜单',
`title` varchar(50) NOT NULL COMMENT '菜单名',
`from_type` char(50) NULL COMMENT '菜单内容',
`type` varchar(30) NULL COMMENT '类型',
`jump_type` char(10) NULL COMMENT '推送类型',
`addon` char(50) NULL COMMENT '选择插件',
`sucai_type` varchar(50) NULL COMMENT '素材类型',
`keyword` varchar(100) NULL COMMENT '关联关键词',
`url` varchar(255) NULL COMMENT '关联URL',
`sort` tinyint(4) NULL COMMENT '排序号',
`pbid` int(10) NULL COMMENT '公众号id',
`target_id` int(10) NULL COMMENT '选择内容',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci CHECKSUM=0 ROW_FORMAT=DYNAMIC DELAY_KEY_WRITE=0;
INSERT INTO `wp_model` (`name`,`title`,`extend`,`relation`,`need_pk`,`field_sort`,`field_group`,`attribute_list`,`template_list`,`template_add`,`template_edit`,`list_grid`,`list_row`,`search_key`,`search_list`,`create_time`,`update_time`,`status`,`engine_type`,`addon`) VALUES ('custom_menu','自定义菜单','0','','1','["pid","title","from_type","type","jump_type","addon","sucai_type","keyword","url","sort"]','1:基础','','','','','title:10%菜单名\r\nkeyword:10%关联关键词\r\nurl:50%关联URL\r\nsort:5%排序号\r\nid:10%操作:[EDIT]|编辑,[DELETE]|删除','20','title','','1394518309','1446533816','1','MyISAM','weixin');
|
<filename>snprc_ehr/resources/queries/study/CulturePivot.sql<gh_stars>1-10
/*
* Copyright (c) 2019 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/******************************************************************************
Non Ova & Parasite (O&P) result set.
srr 04.02.2019
******************************************************************************/
SELECT
p.runid,
p.Id,
p.date,
p.serviceTestId.testName as TestName,
p.runId.serviceRequested as PanelName,
GROUP_CONCAT(p.qualresult) as QResults
FROM study.labworkResults as p
inner join snprc_ehr.labwork_panels as lt
on p.serviceTestid = lt.rowId
and lt.ServiceId.Dataset='Culture'
where p.id is not null
group by p.runid, p.Id, p.date,p.serviceTestId.testName, p.runId.serviceRequested
PIVOT QResults by TestName IN
(select t.testName from snprc_ehr.labwork_panels t
where t.includeInPanel = true
and t.ServiceId.Dataset = 'Culture'
order by t.TestName asc
);
|
<reponame>TheMolkaPL/odengymnasiet.se<filename>src/main/resources/schema.sql
CREATE TABLE IF NOT EXISTS `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`title` varchar(32) NOT NULL,
`path` varchar(64) NOT NULL,
`priority` int(11) NOT NULL,
`text` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`),
UNIQUE KEY `path` (`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`name` varchar(32) NOT NULL,
`role_name` varchar(32) NOT NULL,
`priority` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `marketings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`image` varchar(256) NOT NULL,
`fixed` tinyint(1) NOT NULL,
`position` double NOT NULL,
`deployed` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `menus` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`year` smallint(6) NOT NULL,
`week` tinyint(4) NOT NULL,
`day` tinyint(7) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `menu_dishes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`menu_id` int(11) NOT NULL,
`text` varchar(64) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK__menus` (`menu_id`),
CONSTRAINT `FK__menus` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `open_houses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`start` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`end` timestamp NULL DEFAULT NULL,
`description` text NOT NULL,
`deployed` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `open_house_programs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`open_house_id` int(11) NOT NULL,
`program_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_open_house_programs_open_houses` (`open_house_id`),
KEY `FK_open_house_programs_programs` (`program_id`),
CONSTRAINT `FK_open_house_programs_open_houses` FOREIGN KEY (`open_house_id`) REFERENCES `open_houses` (`id`),
CONSTRAINT `FK_open_house_programs_programs` FOREIGN KEY (`program_id`) REFERENCES `programs` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `persons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`first_name` varchar(32) NOT NULL,
`last_name` varchar(32) NOT NULL,
`contactable` tinyint(1) NOT NULL,
`priority` int(11) NOT NULL,
`email` varchar(32) NOT NULL,
`telephone` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `person_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`person_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
`role` varchar(64) NOT NULL,
`focused` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`),
KEY `FK_person_groups_persons` (`person_id`),
KEY `FK_person_groups_groups` (`group_id`),
CONSTRAINT `FK_person_groups_groups` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`),
CONSTRAINT `FK_person_groups_persons` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `programs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`title` varchar(32) NOT NULL,
`subtitle` varchar(32) DEFAULT NULL,
`path` varchar(32) NOT NULL,
`icon` varchar(256) NOT NULL,
`priority` int(11) NOT NULL,
`marketing` varchar(256) NOT NULL,
`recommended` tinyint(4) NOT NULL,
`open` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`),
UNIQUE KEY `path` (`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `program_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`program_id` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`url` varchar(256) NOT NULL,
`format` varchar(16) NOT NULL,
`size` double NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_program_files_programs` (`program_id`),
CONSTRAINT `FK_program_files_programs` FOREIGN KEY (`program_id`) REFERENCES `programs` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `student_services` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`name` varchar(32) NOT NULL,
`url` varchar(256) NOT NULL,
`priority` int(11) NOT NULL,
`navbar` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
CREATE OR REPLACE TRIGGER "MEDIA_RELATIONS_CHK" before insert OR UPDATE ON media_relations
for each row
declare
numrows number := 0;
tabl VARCHAR2(38);
colName VARCHAR2(38);
BEGIN
-- makes sure that the string after the last space in media_relationship resolves to a valid table name
tabl := upper(SUBSTR(:NEW.media_relationship,instr(:NEW.media_relationship,' ',-1)+1));
SELECT COUNT(*) INTO numrows FROM USEr_tables WHERE upper(table_name)=upper(tabl);
IF numrows=0 THEN
raise_application_error(
-20001,
'Invalid media_relationship'
);
END IF;
select COUNT(column_name) INTO numrows from
user_constraints,
user_cons_columns
where
user_constraints.CONSTRAINT_NAME=user_cons_columns.CONSTRAINT_NAME and
user_constraints.CONSTRAINT_TYPE='P' and
user_constraints.TABLE_NAME=tabl;
IF numrows=0 THEN
raise_application_error(
-20001,
'Primary key not found.'
);
END IF;
select COLUMN_NAME INTO colName from
user_constraints,
user_cons_columns
where
user_constraints.CONSTRAINT_NAME=user_cons_columns.CONSTRAINT_NAME and
user_constraints.CONSTRAINT_TYPE='P' and
user_constraints.TABLE_NAME=tabl;
execute immediate 'SELECT COUNT(*) FROM ' || tabl || ' WHERE ' || colName || '=' || :NEW.related_primary_key INTO numrows;
IF numrows=0 THEN
raise_application_error(
-20001,
'Related record not found.'
);
END IF;
END;
ALTER TRIGGER "MEDIA_RELATIONS_CHK" ENABLE
|
<filename>mysql-db-script.sql<gh_stars>1-10
-- auto-generated definition
create table sys_export_conf
(
id varchar(32) not null
primary key,
column_conf_json varchar(1024) null comment '数据、列关系配置json',
bean_id varchar(64) null comment 'spring bean id',
method_name varchar(64) null comment 'spring method name',
create_id bigint null comment '创建人',
tm_create datetime null comment '创建时间',
update_id bigint null comment '更新人',
tm_update datetime null comment '更新时间',
remark varchar(512) null comment 'remark',
is_del int default 0 null comment '逻辑删除标识'
);
create table wms.sys_export_plan
(
id varchar(32) not null,
user_id bigint null,
bean_id varchar(128) null comment 'spring bean id',
method_name varchar(128) null comment 'bean''s method name',
request_params varchar(1024) null comment '导出表格表头信息配置json',
line_count bigint null comment '数据行数',
url varchar(1024) null comment 'http下载地址',
plan_status varchar(10) null comment '计划状态:待执行、执行成功、执行失败',
retry_qty int default 0 null comment '异常重试次数',
i18n varchar(16) null comment '国际化标记符',
failed_msg varchar(1024) null comment '错误消息',
tm_create datetime null comment '创建时间',
tm_success datetime null comment '完成时间',
is_del int default 0 null comment '删除标识,0=未删除,1=删除',
constraint sys_export_plan_id_uindex
unique (id)
)
comment '导出计划表';
alter table wms.sys_export_plan
add primary key (id);
-- 执行此SQL可直接运行基本Demo
INSERT INTO sys_export_conf (id, column_conf_json, bean_id, method_name, create_id, tm_create, update_id, tm_update, remark, is_del) VALUES ('test11111', '{
"testName":"测试名称",
"testContent":"测试内容"
}', 'exampleHandler', null, null, '2019-10-22 09:19:51', null, null, null, 0);
|
CREATE INDEX idx_first_name ON public.authors(first_name)
CREATE INDEX idx_last_name ON public.authors(last_name)
|
<filename>components/config-mgmt-service/backend/postgres/schema/sql/05_policy_rev.up.sql
CREATE TABLE IF NOT EXISTS policy_rev (
id TEXT PRIMARY KEY,
policy_name TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS policy_rev_id ON policy_rev (id);
CREATE TABLE IF NOT EXISTS cookbook_lock (
policy_id TEXT PRIMARY KEY,
policy_rev_id TEXT NOT NULL,
cookbook_name TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS cook_lock_policy_rev_id ON cookbook_lock (policy_rev_id);
|
<gh_stars>1000+
-- using the most lately added client as a foreign key
INSERT INTO hydra_oauth2_consent_request (challenge, verifier, client_id, subject, request_url, skip, requested_scope, csrf, authenticated_at, requested_at, oidc_context)
SELECT 'challenge-0001', 'verifier-0001', hydra_client.id, 'subject-0001', 'http://request/0001', true, 'requested_scope-0001_1', 'csrf-0001', now(), now(), '{"display": "display-0001"}'
FROM hydra_client
ORDER BY hydra_client.pk DESC
LIMIT 1;
INSERT INTO hydra_oauth2_authentication_request (challenge, verifier, client_id, subject, request_url, skip, requested_scope, csrf, authenticated_at, requested_at, oidc_context)
SELECT 'challenge-0001', 'verifier-0001', hydra_client.id, 'subject-0001', 'http://request/0001', true, 'requested_scope-0001_1', 'csrf-0001', now(), now(), '{"display": "display-0001"}'
FROM hydra_client
ORDER BY hydra_client.pk DESC
LIMIT 1;
INSERT INTO hydra_oauth2_authentication_session
(id, authenticated_at, subject)
VALUES
('auth_session-0001', now(), 'subject-0001');
INSERT INTO hydra_oauth2_consent_request_handled
(challenge, granted_scope, remember, remember_for, error, requested_at, session_access_token, session_id_token, authenticated_at, was_used)
VALUES
('challenge-0001', 'granted_scope-0001_1', true, 0001, '{}', now(), '{"session_access_token-0001": "0001"}', '{"session_id_token-0001": "0001"}', now(), true);
INSERT INTO hydra_oauth2_authentication_request_handled
(challenge, subject, remember, remember_for, error, acr, requested_at, authenticated_at, was_used)
VALUES
('challenge-0001', 'subject-0001', true, 0001, '{}', 'acr-0001', now(), now(), true);
|
<reponame>sridhargoudrangu/gpdb
-- @Description UAOCS MVCC readcommit and insert + vacuum
-- Transaction 2 of 2 (vacuum)
--
select pg_sleep(3);
insert into sto_uaocs_mvcc_status (workload, script) values('readcommit_concurr_ins_vacuum', 't2_insert_tuples');
select count(*) as only_visi_rows from sto_uaocs_mvcc_vacuum;
set gp_select_invisible = true;
select count(*) as visi_and_invisi_rows from sto_uaocs_mvcc_vacuum;
set gp_select_invisible = false;
update sto_uaocs_mvcc_status set updover = CURRENT_TIMESTAMP
where workload='readcommit_concurr_ins_vacuum'
AND script='t2_insert_tuples';
set transaction isolation level READ COMMITTED;
vacuum full sto_uaocs_mvcc_vacuum ;
update sto_uaocs_mvcc_status set endtime = CURRENT_TIMESTAMP
where workload='readcommit_concurr_ins_vacuum'
AND script='t2_insert_tuples';
select count(*) as only_visi_rows from sto_uaocs_mvcc_vacuum;
set gp_select_invisible = true;
select count(*) as visi_and_invisi_rows from sto_uaocs_mvcc_vacuum;
set gp_select_invisible = false;
|
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字remote非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists remote;
create sequence remote start 100 cache 50;
drop sequence remote;
--关键字带双引号-成功
drop sequence if exists "remote";
create sequence "remote" start 100 cache 50;
drop sequence "remote";
--关键字带单引号-合理报错
drop sequence if exists 'remote';
--关键字带反引号-合理报错
drop sequence if exists `remote`;
|
<reponame>phouthasak/BasketBallCheckinApp<filename>src/main/resources/db/migration/V6__CREATE_NON_PLAYER_CHECKIN_TABLE.sql
DROP TABLE IF EXISTS NON_PLAYER_CHECKIN;
CREATE TABLE NON_PLAYER_CHECKIN (
checkIn_id INT(10) auto_increment primary key,
event_id INT(10) not null,
sponsor_id INT(10) not null,
first_name VARCHAR(100) not null,
last_name VARCHAR(100) not null,
check_in_status TINYINT default 0 not null,
created_date DATETIME not null,
created_by VARCHAR(100) not null,
updated_date DATETIME not null,
updated_by VARCHAR(100) not null,
active TINYINT default 1 not null,
FOREIGN KEY (event_id) references events(event_id),
FOREIGN KEY (sponsor_id) references player(player_id)
);
|
Select p.*
From [UserProfile] p
Where p.[userName] = @0
|
-- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jun 15, 2017 at 08:38 AM
-- Server version: 5.6.35-cll-lve
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `epec`
--
-- --------------------------------------------------------
--
-- Table structure for table `reclamos`
--
CREATE TABLE IF NOT EXISTS `reclamos` (
`index` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`telefono` int(100) NOT NULL,
`reclamo` varchar(10000) NOT NULL,
`aprobado` varchar(20) NOT NULL,
UNIQUE KEY `index` (`index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `reclamos`
--
INSERT INTO `reclamos` (`index`, `nombre`, `email`, `telefono`, `reclamo`, `aprobado`) VALUES
(1, 'naza cb', '<EMAIL>', 21447, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus justo sed nisl faucibus commodo. Praesent sodales consequat mollis. Ut nec nibh urna. Nulla sit amet tempus lacus. Nullam iaculis tellus nec iaculis tempus. Nullam sit amet est ipsum. Nulla cursus euismod magna, eu vulputate mi convallis dictum. Vestibulum accumsan nibh vitae tincidunt gravida. Donec neque odio, rhoncus in bibendum vitae, sagittis ut ante. Cras iaculis placerat lacus eu faucibus. Ut non venenatis nisi. Sed mauris nisi, sagittis in ultrices in, dictum ac velit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.', 'no'),
(2, 'naza cbszbzbdzd', '<EMAIL>', 2147483647, 'ACSsVsVv', 'no'),
(3, 'Fabri', '<EMAIL>', 23754875, 'si', 'no'),
(4, 'Nazareno', '<EMAIL>', 351240304, 'Mimensaje es anda a hacrt re coger por un orangutan PHP!!!!', 'no');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<filename>migrations/000001_init_schema.up.sql
CREATE SEQUENCE global_id_sequence CYCLE;
CREATE OR REPLACE FUNCTION id_generator(OUT result bigint) AS $$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
now_millis bigint;
-- the id of this DB shard, must be set for each
-- schema shard you have - you could pass this as a parameter too
shard_id int := 1;
BEGIN
SELECT nextval('global_id_sequence') % 1024 INTO seq_id;
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 1000) INTO now_millis;
result := (now_millis - our_epoch) << 23;
result := result | (shard_id << 10);
result := result | (seq_id);
END;
$$ LANGUAGE PLPGSQL;
CREATE TABLE users(
user_id BIGINT PRIMARY KEY NOT NULL DEFAULT id_generator(),
firebase_uid VARCHAR(32) NOT NULL UNIQUE,
name VARCHAR(32) NOT NULL DEFAULT '',
is_customer BOOLEAN NOT NULL DEFAULT false);
|
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (1, 'Clarence', 'Ho');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (2, 'Scott', 'Tiger');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (3, 'John', 'Smith');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (4, 'Peter', 'Jackson');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (5, 'Jacky', 'Chan');
|
CREATE TABLE IF NOT EXISTS `TaskRecords` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`title` varchar(128) NOT NULL,
`skip` BOOLEAN,
`completed` BOOLEAN,
`createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=compressed;
|
SELECT s.FirstName,
s.LastName,
COUNT(st.TeacherId) AS [TeachersCount]
FROM Students AS s
JOIN StudentsTeachers AS st ON st.StudentId = s.Id
GROUP BY s.FirstName,
s.LastName
|
-- file:tsearch.sql ln:171 expect:true
SELECT to_tsquery('english', '(a <-> 1) <-> 2')
|
---------------------
-- home_security --
---------------------
CREATE KEYSPACE home_security WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE home_security;
CREATE TABLE home (
home_id text PRIMARY KEY,
address text,
alt_phone text,
city text,
contact_name text,
email text,
guest_code text,
main_code text,
phone text,
phone_password text,
state text,
zip text
);
COPY home (home_id, address, city, state, zip, contact_name, phone, alt_phone, phone_password, email, main_code, guest_code) FROM 'home.csv' WITH header = true AND delimiter = '|';
CREATE TABLE activity (
home_id text,
datetime timestamp,
code_used text,
event text,
PRIMARY KEY (home_id, datetime)
) WITH CLUSTERING ORDER BY (datetime DESC);
COPY activity (home_id, datetime, event, code_used) FROM 'activity.csv' WITH header = true AND delimiter = '|';
-----------------------
-- vehicle_tracker --
-----------------------
CREATE KEYSPACE vehicle_tracker WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE vehicle_tracker;
CREATE TABLE location (
vehicle_id text,
date text,
time timestamp,
latitude double,
longitude double,
PRIMARY KEY ((vehicle_id, date), time)
) WITH CLUSTERING ORDER BY (time DESC);
COPY location (vehicle_id, date, time, latitude, longitude) FROM 'location.csv' WITH header = true AND delimiter = '|';
|
<filename>base-datos/db/VIEWS_SQL/con_dialogue_view.sql
CREATE VIEW con_dialogue AS
SELECT
d.file_id,
d.date,
c.macro,
region.iso as region_iso,
region.name as region_name,
region.numero as region_number,
comuna.name as comuna_name
FROM
comuna,
region,
person as p,
contribution as c,
person_contribution as pc,
dialogue as d
WHERE
d.comuna = comuna.id and
comuna.region_iso = region.iso and
p.file_id = d.file_id AND
p.person_id=pc.person_id AND
c.con_id=pc.con_id
GROUP BY
d.file_id,
d.date,
c.macro,
region.iso,
region.name,
region.numero,
comuna.name;
|
select directories from `table_stats/spark_generated/.stats.drill`;
|
<reponame>serhat-dirik/location-service-fuse
DROP TABLE IF EXISTS locations;
CREATE TABLE locations (
id integer NOT NULL,
name varchar(255) NOT NULL,
lat varchar(30) NOT NULL,
lng varchar(30) NOT NULL,
location_type varchar(255) NOT NULL,
status varchar(1) NOT NULL
);
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (1,'Johannesburg','-25.879392','28.029105','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (2,'Boston','42.34651','-71.05148','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (3,'Riyadh','26.602074','46.890817','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (4,'Barcelona','41.394274','2.145745','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (5,'Raleigh','35.77518','-78.63763','Headquarter','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (6,'Mexico City','19.426913','-99.171802','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (7,'Sunnyvale','37.37797','-122.03336','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (8,'London','51.509815','0.085312','Headquarter','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (9,'Sydney','-33.82272','151.208372','Headquarter','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (10,'New Delhi','28.551827','77.122683','Local Office','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (11,'Rio de Janeiro','-22.950996','-43.1766953','Headquarter','1');
INSERT INTO locations (id,name,lat,lng,location_type,status) VALUES (12,'Tokyo','35.645852','139.711016','Local Office','1');
|
USE CommentBot
GO
DROP TABLE IF EXISTS dbo.Subreddits
GO
CREATE TABLE dbo.Subreddits (
Subreddit_ID NVARCHAR(128) PRIMARY KEY CLUSTERED NOT NULL,
Subreddit_Short_URL NVARCHAR(256) NOT NULL,
Subreddit_Full_URL AS CONCAT('https://www.reddit.com', Subreddit_Short_URL),
Last_Update_User NVARCHAR(128) DEFAULT SUSER_NAME() NOT NULL,
Last_Update_Datetime DATETIME2 DEFAULT GETDATE() NOT NULL
)
DROP TABLE IF EXISTS dbo.Posts
GO
CREATE TABLE dbo.Posts (
Post_ID NVARCHAR(128) PRIMARY KEY CLUSTERED NOT NULL,
Subreddit_ID NVARCHAR(128) NOT NULL,
Title NVARCHAR(512) NOT NULL,
Upvotes INT NOT NULL,
Downvotes INT NOT NULL,
Score INT NOT NULL,
Author NVARCHAR(256) NOT NULL,
Created_Epoch BIGINT NOT NULL,
Created_Datetime AS DATEADD(S, Created_Epoch, '1 Jan 1970'),
Post_Permalink NVARCHAR(256) NOT NULL,
Post_Full_Permalink AS CONCAT('https://www.reddit.com', Post_Permalink),
Last_Update_User NVARCHAR(128) DEFAULT SUSER_NAME() NOT NULL,
Last_Update_Datetime DATETIME2 DEFAULT GETDATE() NOT NULL
)
GO
DROP TABLE IF EXISTS dbo.Comments
GO
CREATE TABLE dbo.Comments (
Comment_ID NVARCHAR(128) PRIMARY KEY CLUSTERED NOT NULL,
Body NVARCHAR(MAX) NULL,
Upvotes INT NOT NULL,
Downvotes INT NOT NULL,
Score INT NOT NULL,
Author NVARCHAR(256) NOT NULL,
Created_Epoch BIGINT NOT NULL,
Created_Datetime AS DATEADD(S, Created_Epoch, '1 Jan 1970'),
Post_Permalink NVARCHAR(256) NOT NULL,
Post_Full_Permalink AS CONCAT('https://www.reddit.com', Post_Permalink),
Last_Update_User NVARCHAR(128) DEFAULT SUSER_NAME() NOT NULL,
Last_Update_Datetime DATETIME2 DEFAULT GETDATE() NOT NULL
)
|
<reponame>eluinstra/ebms-core
--
-- Copyright 2011 Clockwork
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
RENAME TABLE ebms_event TO delivery_task;
RENAME INDEX i_ebms_event TO i_delivery_task;
RENAME TABLE ebms_event_log TO delivery_log;
RENAME TABLE ebms_message_event TO message_event;
RENAME INDEX i_ebms_message_event TO i_message_event;
create table qrtz_job_details
(
sched_name varchar(120) not null,
job_name varchar(80) not null,
job_group varchar(80) not null,
description varchar(120),
job_class_name varchar(128) not null,
is_durable integer not null,
is_nonconcurrent integer not null,
is_update_data integer not null,
requests_recovery integer not null,
job_data blob(2000),
primary key (sched_name,job_name,job_group)
);
create table qrtz_triggers
(
sched_name varchar(120) not null,
trigger_name varchar(80) not null,
trigger_group varchar(80) not null,
job_name varchar(80) not null,
job_group varchar(80) not null,
description varchar(120),
next_fire_time bigint,
prev_fire_time bigint,
priority integer,
trigger_state varchar(16) not null,
trigger_type varchar(8) not null,
start_time bigint not null,
end_time bigint,
calendar_name varchar(80),
misfire_instr smallint,
job_data blob(2000),
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,job_name,job_group) references qrtz_job_details(sched_name,job_name,job_group)
);
create table qrtz_simple_triggers
(
sched_name varchar(120) not null,
trigger_name varchar(80) not null,
trigger_group varchar(80) not null,
repeat_count bigint not null,
repeat_interval bigint not null,
times_triggered bigint not null,
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
);
create table qrtz_cron_triggers
(
sched_name varchar(120) not null,
trigger_name varchar(80) not null,
trigger_group varchar(80) not null,
cron_expression varchar(120) not null,
time_zone_id varchar(80),
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
);
create table qrtz_simprop_triggers
(
sched_name varchar(120) not null,
trigger_name varchar(200) not null,
trigger_group varchar(200) not null,
str_prop_1 varchar(512),
str_prop_2 varchar(512),
str_prop_3 varchar(512),
int_prop_1 int,
int_prop_2 int,
long_prop_1 bigint,
long_prop_2 bigint,
dec_prop_1 numeric(13,4),
dec_prop_2 numeric(13,4),
bool_prop_1 varchar(1),
bool_prop_2 varchar(1),
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
);
create table qrtz_blob_triggers
(
sched_name varchar(120) not null,
trigger_name varchar(80) not null,
trigger_group varchar(80) not null,
blob_data blob(2000),
primary key (sched_name,trigger_name,trigger_group),
foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
);
create table qrtz_calendars
(
sched_name varchar(120) not null,
calendar_name varchar(80) not null,
calendar blob(2000) not null,
primary key (calendar_name)
);
create table qrtz_fired_triggers
(
sched_name varchar(120) not null,
entry_id varchar(95) not null,
trigger_name varchar(80) not null,
trigger_group varchar(80) not null,
instance_name varchar(80) not null,
fired_time bigint not null,
sched_time bigint not null,
priority integer not null,
state varchar(16) not null,
job_name varchar(80),
job_group varchar(80),
is_nonconcurrent integer,
requests_recovery integer,
primary key (sched_name,entry_id)
);
create table qrtz_paused_trigger_grps
(
sched_name varchar(120) not null,
trigger_group varchar(80) not null,
primary key (sched_name,trigger_group)
);
create table qrtz_scheduler_state
(
sched_name varchar(120) not null,
instance_name varchar(80) not null,
last_checkin_time bigint not null,
checkin_interval bigint not null,
primary key (sched_name,instance_name)
);
create table qrtz_locks
(
sched_name varchar(120) not null,
lock_name varchar(40) not null,
primary key (sched_name,lock_name)
);
|
<filename>posda/posdatools/queries/sql/LastNPhiScans.sql
-- Name: LastNPhiScans
-- Schema: posda_phi_simple
-- Columns: ['id', 'start_time', 'end_time', 'duration', 'description', 'to_scan', 'scanned']
-- Args: ['n']
-- Tags: ['tag_usage', 'simple_phi', 'phi_status']
-- Description: Status of PHI scans
--
select
phi_scan_instance_id as id,
start_time,
end_time,
end_time - start_time as duration,
description,
num_series as to_scan,
num_series_scanned as scanned
from
phi_scan_instance
order by id desc
limit ?
|
<reponame>goldmansachs/obevo-kata
CREATE PROCEDURE SP480(OUT MYCOUNT INTEGER) SPECIFIC SP480_42153 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE90;SELECT COUNT(*)INTO MYCOUNT FROM TABLE62;SELECT COUNT(*)INTO MYCOUNT FROM TABLE445;SELECT COUNT(*)INTO MYCOUNT FROM VIEW39;SELECT COUNT(*)INTO MYCOUNT FROM VIEW64;SELECT COUNT(*)INTO MYCOUNT FROM VIEW68;CALL SP289(MYVAR);CALL SP229(MYVAR);CALL SP445(MYVAR);CALL SP742(MYVAR);END
GO
|
<filename>Master/Appleseed/WebSites/Appleseed/Setup/Scripts/1.4.0.1803.sql<gh_stars>10-100
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_MoveModuleToNewTab]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_MoveModuleToNewTab]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_DeleteModuleToRecycler]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_DeleteModuleToRecycler]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_GetModuleSettingsForIndividualModule]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_GetModuleSettingsForIndividualModule]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_GetModulesInRecycler]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_GetModulesInRecycler]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_Recycler]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [rb_Recycler]
GO
CREATE TABLE [rb_Recycler] (
[ModuleID] [int] NOT NULL ,
[DateDeleted] [datetime] NOT NULL ,
[DeletedBy] [nvarchar] (250) NULL ,
[OriginalTab] [int] NOT NULL
) ON [PRIMARY]
GO
--Simply changes a module's TabID value to the new value
--Used by recycler to restore modules to tabs
CREATE PROCEDURE rb_MoveModuleToNewTab
(
@ModuleID int,
@TabID int
)
AS
BEGIN TRAN
UPDATE rb_Modules
SET TabID = @TabID
WHERE ModuleID = @ModuleID
DELETE FROM rb_Recycler
WHERE ModuleID = @ModuleID
COMMIT TRAN
GO
CREATE PROCEDURE rb_DeleteModuleToRecycler
(
@ModuleID int,
@DeletedBy nvarchar(250),
@DateDeleted datetime
)
AS
DECLARE @intErrorCode INT
DECLARE @intOldTabId INT
SELECT @intOldTabId = (SELECT TOP 1 TabID FROM rb_Modules WHERE ModuleID = @ModuleID)
IF @intOldTabId <> 0 --IF IT'S NOT ALREADY IN THE RECYCLER
BEGIN --PUT IT THERE
BEGIN TRAN
UPDATE rb_Modules
SET TabID = 0
WHERE ModuleID = @ModuleID
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEM
INSERT INTO rb_Recycler
(ModuleID, DateDeleted, DeletedBy, OriginalTab)
VALUES (@ModuleID, @DateDeleted, @DeletedBy, @intOldTabId)
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEM
COMMIT TRAN
END
ELSE --IT WAS ALREADY IN THE RECYCLER, AND THE USER CALLED 'DELETE' FROM THE RECYCLER MODULE
BEGIN
BEGIN TRAN
DELETE FROM rb_Modules WHERE ModuleID = @ModuleID
DELETE FROM rb_Recycler WHERE ModuleID = @ModuleID
COMMIT TRAN
END
PROBLEM:
IF (@intErrorCode <> 0) BEGIN
PRINT 'Unexpected error occurred!'
ROLLBACK TRAN
END
GO
CREATE PROCEDURE rb_GetModuleSettingsForIndividualModule
(
@ModuleID int
)
AS
/* Get the DataTable of module info */
SELECT TOP 1 *
FROM rb_Modules INNER JOIN
rb_ModuleDefinitions ON rb_Modules.ModuleDefID = rb_ModuleDefinitions.ModuleDefID INNER JOIN
rb_GeneralModuleDefinitions ON rb_ModuleDefinitions.GeneralModDefID = rb_GeneralModuleDefinitions.GeneralModDefID
WHERE (rb_Modules.ModuleID = @ModuleID)
GO
CREATE PROCEDURE rb_GetModulesInRecycler
(
@PortalID int,
@SortField VarChar(50)
)
AS
SELECT
rb_Recycler.DateDeleted,
rb_Recycler.DeletedBy,
rb_Recycler.OriginalTab,
rb_Recycler.ModuleID,
rb_Modules.ModuleTitle,
rb_Tabs.TabName as 'OriginalTabName'
FROM rb_Recycler INNER JOIN
rb_Modules ON rb_Recycler.ModuleID = rb_Modules.ModuleID INNER JOIN
rb_Tabs ON rb_Recycler.OriginalTab = rb_Tabs.TabID
WHERE PortalID = @PortalID
ORDER BY
CASE
WHEN @SortField = 'DateDeleted' THEN CAST(DateDeleted AS VarChar(50))
WHEN @SortField = 'DeletedBy' THEN CAST(DeletedBy AS VarChar(50))
WHEN @SortField = 'OriginalTab' THEN CAST(OriginalTab AS VarChar(50))
WHEN @SortField = 'ModuleID' THEN CAST(rb_Recycler.ModuleID AS VarChar(50))
WHEN @SortField = 'ModuleTitle' THEN CAST(ModuleTitle AS VarChar(50))
WHEN @SortField = 'TabName' THEN CAST(rb_Tabs.TabName AS VarChar(50))
ELSE ModuleTitle
END
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_GetAuthDeleteRolesRecycler]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_GetAuthDeleteRolesRecycler]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_GetAuthViewRolesRecycler]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_GetAuthViewRolesRecycler]
GO
CREATE PROCEDURE rb_GetAuthDeleteRolesRecycler
(
@PortalID int,
@ModuleID int,
@AccessRoles nvarchar (256) OUTPUT,
@DeleteRoles nvarchar (256) OUTPUT
)
AS
SELECT
@AccessRoles = rb_Tabs.AuthorizedRoles,
@DeleteRoles = rb_Modules.AuthorizedDeleteRoles
FROM
rb_Modules
INNER JOIN
rb_Recycler ON rb_Modules.ModuleID = rb_Recycler.ModuleID
INNER join
rb_Tabs ON rb_Recycler.OriginalTab = rb_Tabs.TabID
WHERE
rb_Modules.ModuleID = @ModuleID
AND
rb_Tabs.PortalID = @PortalID
GO
CREATE PROCEDURE rb_GetAuthViewRolesRecycler
(
@PortalID int,
@ModuleID int,
@AccessRoles nvarchar (256) OUTPUT,
@ViewRoles nvarchar (256) OUTPUT
)
AS
SELECT
@AccessRoles = rb_Tabs.AuthorizedRoles,
@ViewRoles = rb_Modules.AuthorizedViewRoles
FROM
rb_Modules
INNER JOIN
rb_Recycler ON rb_Modules.ModuleID = rb_Recycler.ModuleID
INNER join
rb_Tabs ON rb_Recycler.OriginalTab = rb_Tabs.TabID
WHERE
rb_Modules.ModuleID = @ModuleID
AND
rb_Tabs.PortalID = @PortalID
GO
|
<reponame>jiandiao/flowable-engine
update ACT_GE_PROPERTY set VALUE_ = '6.5.1.4' where NAME_ = 'entitylink.schema.version';
|
<reponame>pdv-ru/ClickHouse
drop table if exists t;
create table t (a Int, b Int) engine = MergeTree order by (a, b) settings index_granularity = 400;
insert into t select 0, 0 from numbers(50);
insert into t select 0, 1 from numbers(350);
insert into t select 1, 2 from numbers(400);
insert into t select 2, 2 from numbers(400);
insert into t select 3, 0 from numbers(100);
select sleep(1) format Null; -- sleep a bit to wait possible merges after insert
set max_threads = 1;
optimize table t final;
select sum(a) from t where a in (0, 3) and b = 0;
drop table t;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.