sql
stringlengths
6
1.05M
<filename>db/db/3table/upright/FM_REGION.sql drop table if exists FM_REGION; /*==============================================================*/ /* Table: FM_REGION */ /*==============================================================*/ create table FM_REGION ( REGION varchar(2) not null comment '地区', REGION_DESC varchar(90) not null comment '名称', INTERNAL_CODE varchar(1) comment '内部码', COMPANY varchar(20) comment '法人', TRAN_TIMESTAMP varchar(17) comment '交易时间戳', TRAN_TIME Decimal(11,0) comment '交易时间', primary key (REGION) ); alter table FM_REGION comment '区域代码 地区基本信息 undefined';
------------DDL for VR documents----------- CREATE TABLE egpt_vacancy_remission_docs ( vacancyremission bigint, document bigint ); ----inerts into application type------------ insert into egpt_application_type values(nextval('seq_egpt_application_type'),'VACANCY_REMISSION','VACANCYREMISSION',7,'Vacancy Remission',now(),null,1,null,null); -----insert into document type--------------- insert into egpt_document_type values(nextval('seq_egpt_document_type'),'Electicity Bill',true,null,'VACANCYREMISSION',(select id from egpt_application_type where code='VACANCY_REMISSION')); insert into egpt_document_type values(nextval('seq_egpt_document_type'),'Property Photocopy',true,null,'VACANCYREMISSION',(select id from egpt_application_type where code='VACANCY_REMISSION')); insert into egpt_document_type values(nextval('seq_egpt_document_type'),'Other Documents',false,null,'VACANCYREMISSION',(select id from egpt_application_type where code='VACANCY_REMISSION'));
<reponame>navikt/tiltaksgjennomforing-backend alter table avtale_innhold add column manedslonn100pst integer;
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[DaysInAMonth] ( @pDate DATETIME ) RETURNS INT AS BEGIN RETURN CASE WHEN MONTH(@pDate) IN (1, 3, 5, 7, 8, 10, 12) THEN 31 WHEN MONTH(@pDate) IN (4, 6, 9, 11) THEN 30 ELSE CASE WHEN (YEAR(@pDate) % 4 = 0 AND YEAR(@pDate) % 100 != 0) OR (YEAR(@pDate) % 400 = 0) THEN 29 ELSE 28 END END END GO
<reponame>sdslabs/leaderboard SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `access_tokens` ( `userid` varchar(255) NOT NULL, `service` varchar(255) NOT NULL, `access_token` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `scores` ( `userid` varchar(255) NOT NULL, `service` varchar(255) NOT NULL, `score` int(7) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
<reponame>CSCfi/antero<gh_stars>1-10 USE [VipunenTK] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__isan_syntymamaa_id] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_tutkinnon_toteuma] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_syntymamaa_id] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_sukupuoli] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opiskelijan_olo] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opetushallinnon_koulutus] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maassaolo] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_toisen_asteen_koul_aloittaminen] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_kork_koul_aloittaminen] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusryhma] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusluokitus_historia] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutuksen_opetuskieli] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kieli] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kansalaisuus_id] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_ika] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_hetu_ok] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_edeltavan_vuoden_asuinpaikka] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_asuinkunta_sama_vai_eri_kuin_aiemmin_id] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul_historia] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_historia] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aineisto] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio2] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio1] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] DROP CONSTRAINT IF EXISTS [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidin_syntymamaa_id] GO /****** Object: Table [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] Script Date: 23.3.2018 8:57:15 ******/ DROP TABLE IF EXISTS [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] GO /****** Object: Table [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] Script Date: 23.3.2018 8:57:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]( [tilastovuosi] [varchar](4) NULL, [sukupuoli_id] [int] NULL, [syntymavuosi] [varchar](10) NULL, [jarjestys_syntymavuosi] [int] NULL, [kotikunta_id] [int] NULL, [kotikunta_historia_id] [int] NULL, [asuinkunta_sama_vai_eri_kuin_aiemmin_id] [int] NULL, [edeltavan_vuoden_asuinpaikka_id] [int] NULL, [suomeen_muuttamisvuosi] [varchar](30) NULL, [jarjestys_suomeen_muuttamisvuosi] [int] NULL, [aidinkieli_versio4_id] [int] NULL, [kansalaisuus_id] [int] NULL, [syntymamaa_id] [int] NULL, [aidin_syntymamaa_id] [int] NULL, [isan_syntymamaa_id] [int] NULL, [henkilotunnuksen_oikeellisuus_id] [int] NULL, [koulutusryhma_id] [int] NULL, [opetushallinnon_koulutus_id] [int] NULL, [koulutusluokitus_id] [int] NULL, [koulutusluokitus_historia_id] [int] NULL, [koulutusala_taso2_id] [int] NULL, [koulutuksen_opetuskieli_id] [int] NULL, [koulutuksen_sijaintikunta_id] [int] NULL, [koulutuksen_sijaintikunta_historia_id] [int] NULL, [tutkinnon_aloittamisvuosi] [varchar](10) NULL, [jarjestys_tutkinnon_aloittamisvuosi] [int] NULL, [opiskelijan_olo_id] [int] NULL, [maassaolo_id] [int] NULL, [tutkinnon_toteuma_id] [int] NULL, [aineisto_id] [int] NULL, [koulutussektori_id] [int] NULL, [ika_id] [int] NULL, [ikaryhma1_id] [int] NULL, [ikaryhma2_id] [int] NULL, [suoritusaika] [varchar](10) NULL, [jarjestys_suoritusaika] [int] NULL, [aidinkieli_versio1_id] [int] NULL, [aidinkieli_versio2_id] [int] NULL, [maahantulo_ja_toisen_asteen_koul_aloittaminen_id] [int] NULL, [maahantulo_ja_korkeakoulutuksen_aloittaminen_id] [int] NULL, [koulutuksen_jarjestamismuoto_id] [int] NULL, [aloittaneet] [int] NULL, [opiskelijat] [int] NULL, [tutkinnot] [int] NULL, [aloittaneet_ulkomaalaistausta_kielen_mukaan] [int] NULL, [opiskelijat_ulkomaalaistausta_kielen_mukaan] [int] NULL, [tutkinnot_ulkomaalaistausta_kielen_mukaan] [int] NULL, [aloittaneet_ulkomaalaistausta_vanhempien_synnyinmaan_mukaan] [int] NULL, [opiskelijat_ulkomaalaistausta_vanhempien_synnyinmaan_mukaan] [int] NULL, [tutkinnot_ulkomaalaistausta_vanhempien_synnyinmaan_mukaan] [int] NULL, [aloittaneet_ulkomaalaiset] [int] NULL, [opiskelijat_ulkomaalaiset] [int] NULL, [tutkinnot_ulkomaalaiset] [int] NULL, [aloittaneet_ulkomailla_syntyneet] [int] NULL, [opiskelijat_ulkomailla_syntyneet] [int] NULL, [tutkinnot_ulkomailla_syntyneet] [int] NULL, [hallinnonala2_id] [int] NULL ) ON [PRIMARY] END GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidin_syntymamaa_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidin_syntymamaa_id] FOREIGN KEY([aidin_syntymamaa_id]) REFERENCES [dbo].[d_valtio] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidin_syntymamaa_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidin_syntymamaa_id] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio1]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio1] FOREIGN KEY([aidinkieli_versio1_id]) REFERENCES [dbo].[d_aidinkieli_versio1] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio1]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio1] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio2]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio2] FOREIGN KEY([aidinkieli_versio2_id]) REFERENCES [dbo].[d_aidinkieli_versio2] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio2]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aidinkieli_versio2] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aineisto]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aineisto] FOREIGN KEY([aineisto_id]) REFERENCES [dbo].[d_aineisto] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aineisto]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_aineisto] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus] FOREIGN KEY([kotikunta_id]) REFERENCES [dbo].[d_alueluokitus] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_historia]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_historia] FOREIGN KEY([kotikunta_historia_id]) REFERENCES [dbo].[d_alueluokitus_historia] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_historia]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_historia] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul] FOREIGN KEY([koulutuksen_sijaintikunta_id]) REFERENCES [dbo].[d_alueluokitus] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul_historia]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul_historia] FOREIGN KEY([koulutuksen_sijaintikunta_historia_id]) REFERENCES [dbo].[d_alueluokitus_historia] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul_historia]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_alueluokitus_koul_historia] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_asuinkunta_sama_vai_eri_kuin_aiemmin_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_asuinkunta_sama_vai_eri_kuin_aiemmin_id] FOREIGN KEY([asuinkunta_sama_vai_eri_kuin_aiemmin_id]) REFERENCES [dbo].[d_asuinkunta_sama_vai_eri_kuin_aiemmin] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_asuinkunta_sama_vai_eri_kuin_aiemmin_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_asuinkunta_sama_vai_eri_kuin_aiemmin_id] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_edeltavan_vuoden_asuinpaikka]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_edeltavan_vuoden_asuinpaikka] FOREIGN KEY([edeltavan_vuoden_asuinpaikka_id]) REFERENCES [dbo].[d_edeltavan_vuoden_asuinpaikka] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_edeltavan_vuoden_asuinpaikka]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_edeltavan_vuoden_asuinpaikka] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_hetu_ok]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_hetu_ok] FOREIGN KEY([henkilotunnuksen_oikeellisuus_id]) REFERENCES [dbo].[d_hetu_ok] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_hetu_ok]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_hetu_ok] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_ika]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_ika] FOREIGN KEY([ika_id]) REFERENCES [dbo].[d_ika] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_ika]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_ika] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kansalaisuus_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kansalaisuus_id] FOREIGN KEY([kansalaisuus_id]) REFERENCES [dbo].[d_valtio] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kansalaisuus_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kansalaisuus_id] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kieli]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kieli] FOREIGN KEY([aidinkieli_versio4_id]) REFERENCES [dbo].[d_kieli] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kieli]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_kieli] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutuksen_opetuskieli]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutuksen_opetuskieli] FOREIGN KEY([koulutuksen_opetuskieli_id]) REFERENCES [dbo].[d_kieli] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutuksen_opetuskieli]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutuksen_opetuskieli] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusluokitus_historia]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusluokitus_historia] FOREIGN KEY([koulutusluokitus_historia_id]) REFERENCES [dbo].[d_koulutusluokitus_historia] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusluokitus_historia]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusluokitus_historia] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusryhma]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusryhma] FOREIGN KEY([koulutusryhma_id]) REFERENCES [dbo].[d_koulutusryhma] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusryhma]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_koulutusryhma] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_kork_koul_aloittaminen]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_kork_koul_aloittaminen] FOREIGN KEY([maahantulo_ja_korkeakoulutuksen_aloittaminen_id]) REFERENCES [dbo].[d_maahantulo_ja_opiskelun_aloittaminen] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_kork_koul_aloittaminen]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_kork_koul_aloittaminen] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_toisen_asteen_koul_aloittaminen]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_toisen_asteen_koul_aloittaminen] FOREIGN KEY([maahantulo_ja_toisen_asteen_koul_aloittaminen_id]) REFERENCES [dbo].[d_maahantulo_ja_opiskelun_aloittaminen] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_toisen_asteen_koul_aloittaminen]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maahantulo_ja_toisen_asteen_koul_aloittaminen] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maassaolo]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maassaolo] FOREIGN KEY([maassaolo_id]) REFERENCES [dbo].[d_maassaolo] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maassaolo]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_maassaolo] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opetushallinnon_koulutus]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opetushallinnon_koulutus] FOREIGN KEY([opetushallinnon_koulutus_id]) REFERENCES [dbo].[d_opetushallinnon_koulutus] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opetushallinnon_koulutus]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opetushallinnon_koulutus] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opiskelijan_olo]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opiskelijan_olo] FOREIGN KEY([opiskelijan_olo_id]) REFERENCES [dbo].[d_opiskelijan_olo] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opiskelijan_olo]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_opiskelijan_olo] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_sukupuoli]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_sukupuoli] FOREIGN KEY([sukupuoli_id]) REFERENCES [dbo].[d_sukupuoli] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_sukupuoli]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_sukupuoli] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_syntymamaa_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_syntymamaa_id] FOREIGN KEY([syntymamaa_id]) REFERENCES [dbo].[d_valtio] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_syntymamaa_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_syntymamaa_id] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_tutkinnon_toteuma]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_tutkinnon_toteuma] FOREIGN KEY([tutkinnon_toteuma_id]) REFERENCES [dbo].[d_tutkinnon_toteuma] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_tutkinnon_toteuma]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__d_tutkinnon_toteuma] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__isan_syntymamaa_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] WITH CHECK ADD CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__isan_syntymamaa_id] FOREIGN KEY([isan_syntymamaa_id]) REFERENCES [dbo].[d_valtio] ([id]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__isan_syntymamaa_id]') AND parent_object_id = OBJECT_ID(N'[dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk]')) ALTER TABLE [dbo].[f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk] CHECK CONSTRAINT [f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk__isan_syntymamaa_id] GO USE [ANTERO]
drop table if exists `ods_socialnetwork_model_runtime_origin_log`; create table `ods_socialnetwork_model_runtime_origin_log` ( `id` bigint not null auto_increment comment 'unique id for db', `model_id` bigint not null comment 'unique id for each model', `round` int not null comment 'the round of the data', `average_score` double comment 'average visiting score of this round', `recom_count` int comment 'total recommendation count of this round', primary key (`id`) ) engine = innodb default charset = utf8mb4 comment 'runtime origin log'; drop table if exists `ods_socialnetwork_model_parameter_origin_log`; create table `ods_socialnetwork_model_parameter_origin_log` ( `id` bigint not null auto_increment comment 'unique id for db', `model_id` bigint not null comment 'unique id for each model', `grid_length` int comment 'grid length', `population` int comment 'population', `rounds` int comment 'total rounds', `recom_type` int comment 'recommendation type', `start_time` bigint comment 'the timestamp start running', primary key (`id`) ) engine = innodb default charset = utf8mb4 comment 'parameter origin_log';
CREATE SCHEMA IF NOT exists extensions; CREATE EXTENSION IF NOT EXISTS pg_stat_statements with schema extensions; CREATE EXTENSION IF NOT EXISTS uuid-ossp with schema extensions; CREATE EXTENSION IF NOT EXISTS pgcrypto with schema extensions; CREATE EXTENSION IF NOT EXISTS postgis with schema extensions; CREATE EXTENSION IF NOT EXISTS fuzzystrmatch with schema extensions; CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder with schema extensions; --this one is optional if you want to use the rules based standardizer (pagc_normalize_address) CREATE EXTENSION IF NOT EXISTS address_standardizer with schema extensions;
/* Navicat Premium Data Transfer Source Server : ultilmateshell Source Server Type : SQLite Source Server Version : 3017000 Source Schema : main Target Server Type : SQLite Target Server Version : 3017000 File Encoding : 65001 Date: 05/09/2021 14:30:39 */ -- ---------------------------- -- Table structure for note -- ---------------------------- DROP TABLE IF EXISTS "note"; CREATE TABLE "note" ( "id" INTEGER NOT NULL, "title" TEXT NOT NULL, "content" TEXT NOT NULL, "create_time" TEXT NOT NULL, "modify_time" TEXT NOT NULL, "comment" TEXT NOT NULL DEFAULT '没有备注哦', PRIMARY KEY ("id") );
<gh_stars>0 INSERT INTO table1 (name) VALUES ('nagaitis'); INSERT INTO table1 (name) VALUES ('messi'); INSERT INTO table1 (name) VALUES ('<NAME>'); INSERT INTO table1 (name) VALUES ('<NAME>'); INSERT INTO table1 (name) VALUES ('<NAME>'); INSERT INTO table1 (name) VALUES ('<NAME>'); INSERT INTO table1 (name) VALUES ('krivaldo'); INSERT INTO table1 (name) VALUES ('penaldo'); INSERT INTO table1 (name) VALUES ('analdo'); INSERT INTO table1 (name) VALUES ('<NAME>'); INSERT INTO table2 (fk1_table1) VALUES (1); INSERT INTO table2 (fk1_table1) VALUES (1); INSERT INTO table2 (fk1_table1) VALUES (3); INSERT INTO table2 (fk1_table1) VALUES (4); INSERT INTO table2 (fk1_table1) VALUES (6); INSERT INTO table2 (fk1_table1) VALUES (6); INSERT INTO table3 (fk1_table2) VALUES (1); INSERT INTO table3 (fk1_table2) VALUES (2); INSERT INTO table3 (fk1_table2) VALUES (2); INSERT INTO table3 (fk1_table2) VALUES (5); INSERT INTO table3 (fk1_table2) VALUES (5); INSERT INTO table3 (fk1_table2) VALUES (5); INSERT INTO table3 (fk1_table2) VALUES (5); INSERT INTO table3 (fk1_table2) VALUES (6);
CREATE TABLE role ( id SERIAL PRIMARY KEY, name VARCHAR(20) ); CREATE TABLE users ( id SERIAL PRIMARY KEY, name VARCHAR(20), login VARCHAR(20) UNIQUE , email VARCHAR (50) UNIQUE , createDate TIMESTAMP, role_id INTEGER REFERENCES role(id) );
<gh_stars>0 -- Generation time: Fri, 23 Nov 2018 12:16:20 +0000 -- Host: mysql.hostinger.ro -- DB name: u574849695_21 /*!40030 SET NAMES UTF8 */; /*!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 */; /*!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 */; DROP TABLE IF EXISTS `cities`; CREATE TABLE `cities` ( `name` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `cities` VALUES ('Lockmanfurt'), ('Titusshire'), ('North Huldaport'), ('New Ritafort'), ('Lake Shadland'), ('Lake Kip'), ('Robertsstad'), ('North Nina'), ('Lake Johannstad'), ('East Marcelton'), ('Port Brendan'), ('Dedrickfurt'), ('South Clement'), ('Lake Gerry'), ('West Geoffreyshire'), ('Lake Roselyntown'), ('Claudetown'), ('Liammouth'), ('South Jared'), ('Zacheryland'), ('East Tyrell'), ('Carsonmouth'), ('West Kamilleview'), ('Mitchellberg'), ('Kassulkeburgh'), ('New Edmundville'), ('Walkerberg'), ('Lake Nicholehaven'), ('Port Korbin'), ('New Brycenmouth'), ('North Harley'), ('West Margie'), ('East Katrina'), ('Wintheisermouth'), ('Lake Eloiseborough'), ('East Danika'), ('Port Ethaborough'), ('West Triston'), ('Lake Robertaport'), ('East Alysaport'), ('Rempelhaven'), ('Lake Marcelinoville'), ('South Laceyside'), ('Markusstad'), ('Vallieville'), ('West Kayceeland'), ('Willowville'), ('Greenholtmouth'), ('Port Joesphton'), ('Darrellberg'), ('Hoppefort'), ('Ryderland'), ('Lake Gennaroberg'), ('Kunzeside'), ('East Flavieburgh'), ('Yoshikoburgh'), ('Torphymouth'), ('West Jakobview'), ('North Merritt'), ('Rolfsonview'), ('Michelfort'), ('West Seamus'), ('North Noemy'), ('East Samsonhaven'), ('Lake Brionnamouth'), ('South Lonzoport'), ('Antoneberg'), ('Lake Camila'), ('West Caterinaberg'), ('Weimanntown'), ('Lake Casper'), ('Marvinmouth'), ('Port Moriahhaven'), ('East Filiberto'), ('Durganbury'), ('Haleystad'), ('Port Tate'), ('West Theodoreton'), ('Stehrville'), ('Port Enosside'), ('Bradtkeville'), ('Michaelaport'), ('Omaville'), ('Millston'), ('Schillerfurt'), ('South Madelinefort'), ('Jerdemouth'), ('Earlenechester'), ('Port Pattietown'), ('Gleichnermouth'), ('Petraport'), ('McGlynnfort'), ('Ryanburgh'), ('North Haleyport'), ('North Lindsay'), ('Millsfort'), ('Jettiemouth'), ('Lake Cordeliaberg'), ('Jadaport'), ('Millermouth'); /*!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 */;
/****** Object: Table [dbo].[T_Dataset_Info] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[T_Dataset_Info]( [Dataset_ID] [int] NOT NULL, [ScanCountMS] [int] NOT NULL, [ScanCountMSn] [int] NOT NULL, [TIC_Max_MS] [real] NULL, [TIC_Max_MSn] [real] NULL, [BPI_Max_MS] [real] NULL, [BPI_Max_MSn] [real] NULL, [TIC_Median_MS] [real] NULL, [TIC_Median_MSn] [real] NULL, [BPI_Median_MS] [real] NULL, [BPI_Median_MSn] [real] NULL, [Elution_Time_Max] [real] NULL, [Scan_Types] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Last_Affected] [datetime] NOT NULL, [ProfileScanCount_MS] [int] NULL, [ProfileScanCount_MSn] [int] NULL, [CentroidScanCount_MS] [int] NULL, [CentroidScanCount_MSn] [int] NULL, CONSTRAINT [PK_T_Dataset_ScanInfo] PRIMARY KEY CLUSTERED ( [Dataset_ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY] ) ON [PRIMARY] GO GRANT VIEW DEFINITION ON [dbo].[T_Dataset_Info] TO [DDL_Viewer] AS [dbo] GO ALTER TABLE [dbo].[T_Dataset_Info] WITH CHECK ADD CONSTRAINT [FK_T_Dataset_Info_T_Dataset] FOREIGN KEY([Dataset_ID]) REFERENCES [dbo].[T_Dataset] ([Dataset_ID]) GO ALTER TABLE [dbo].[T_Dataset_Info] CHECK CONSTRAINT [FK_T_Dataset_Info_T_Dataset] GO
use [ProyectoBD] DECLARE @xmlData XML SET @xmlData = ( SELECT * FROM OPENROWSET(BULK 'C:\Users\eastorga\Documents\GitHub\Tarea-Programada-BD-1-3-\DatosTarea2.xml', SINGLE_BLOB) AS xmlData ); INSERT INTO dbo.Departamentos(ID, NombreDep) SELECT T.Item.value('@Id', 'INT'), T.Item.value('@Nombre', 'VARCHAR(128)') FROM @xmlData.nodes('Datos/Departamentos/Departamento') as T(Item) INSERT INTO dbo.Obrero(Nombre, IdTipoDocIdentidad, ValorDocIdentidad, IdDepartamento, Puesto, FechaNacimiento, Borrado) SELECT T.Item.value('@Nombre', 'VARCHAR(128)'), T.Item.value('@IdTipoIdentificacion', 'INT'), T.Item.value('@ValorDocumentoIdentificacion', 'INT'), T.Item.value('@IdDepartamento', 'INT'), T.Item.value('@Puesto', 'VARCHAR(128)'), T.Item.value('@FechaNacimiento', 'Date'), 1 FROM @xmlData.nodes('Datos/Empleados/Empleado') as T(Item) INSERT INTO dbo.Puesto(NombreP, SalarioXHora, Borrado) SELECT T.Item.value('@Nombre', 'VARCHAR(128)'), T.Item.value('@SalarioXHora', 'MONEY'), 1 FROM @xmlData.nodes('Datos/Puestos/Puesto') as T(Item) INSERT INTO dbo.TipoDocIdentidad(ID, NombreTip) SELECT T.Item.value('@Id', 'INT'), T.Item.value('@Nombre', 'VARCHAR(128)') FROM @xmlData.nodes('Datos/Tipo_Doc/TipoDocuIdentidad') as T(Item) INSERT INTO dbo.Usuarios(Nombre, Password) SELECT T.Item.value('@Nombre', 'VARCHAR(16)'), T.Item.value('@Password', 'VARCHAR(16)') FROM @xmlData.nodes('Datos/Usuarios/Usuario') as T(Item)
<filename>scripts/redash_PGSQL_queries/query_49.sql /* Name: <NAME> Data source: 1 Created By: admin Last Update At: 2021-07-02T17:18:35.149Z */ SELECT key || ': ' || r.cell_id as series, r.cycle_index, r.test_time, value FROM (SELECT cell_id, trunc(cycle_index,0) as cycle_index, test_time, json_build_object('ah_d', TRUNC(ah_d,3)) AS line FROM cycle_data where cell_id IN ({{cell_id}}) and ah_eff<1.1) as r JOIN LATERAL json_each_text(r.line) ON (key ~ '[ah]_[d]') where cast(value as numeric)!=0 GROUP by r.cell_id, r.cycle_index, r.test_time, json_each_text.key, json_each_text.value order by r.cell_id,r.cycle_index, key
--test implicit type conversion of nchar type create table nchar_conversion( col1 datetime, col2 date, col3 time, col4 timestamp, col5 double, col6 float, col7 numeric, col8 bigint, col9 int, col10 short, col11 monetary, col12 bit(50), col13 bit varying, col14 char(30), col15 varchar, col16 nchar(30), col17 nchar varying, col18 set, col19 multiset, col20 list, col21 sequence, col22 blob, col23 clob ); --[ok]datetime insert into nchar_conversion(col1) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); select col1 from nchar_conversion order by 1; --[ok]date insert into nchar_conversion(col2) values (cast(n'11/08/2010 16:10:22' as nchar(30))); select col2 from nchar_conversion order by 1; --[ok]time insert into nchar_conversion(col3) values (cast(n'11/08/2010 16:10:22' as nchar(30))); select col3 from nchar_conversion order by 1; --[ok]timestamp insert into nchar_conversion(col4) values (cast(n'11/08/2010 16:10:22' as nchar(30))); select col4 from nchar_conversion order by 1; --[ok]double insert into nchar_conversion(col5) values (cast(n'12323423423.3453' as nchar(30))); select col5 from nchar_conversion order by 1; --[ok]float insert into nchar_conversion(col6) values (cast(n'63454334.565' as nchar(30))); select col6 from nchar_conversion order by 1; --[ok]numeric insert into nchar_conversion(col7) values (cast(n'4325.56534' as nchar(30))); select col7 from nchar_conversion order by 1; --[ok]bigint insert into nchar_conversion(col8) values (cast(n'123412345645' as nchar(30))); select col8 from nchar_conversion order by 1; --[ok]int insert into nchar_conversion(col9) values (cast(n'83923423' as nchar(30))); select col9 from nchar_conversion order by 1; --[ok]short insert into nchar_conversion(col10) values (cast(n'4321' as nchar(30))); select col10 from nchar_conversion order by 1; --[ok]monetary insert into nchar_conversion(col11) values (cast(n'78273923.2342' as nchar(30))); select col11 from nchar_conversion order by 1; --[ok]bit insert into nchar_conversion(col12) values (cast(n'b1010111' as nchar(30))); select col12 from nchar_conversion order by 1; --[ok]varbit insert into nchar_conversion(col13) values (cast(n'b1010111' as nchar(30))); select col13 from nchar_conversion order by 1; --[ok]char insert into nchar_conversion(col14) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); select col14 from nchar_conversion order by 1; --[ok]nchar insert into nchar_conversion(col15) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); select col15 from nchar_conversion order by 1; --[nr]nchar insert into nchar_conversion(col16) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); select col16 from nchar_conversion order by 1; --[ok]varnchar insert into nchar_conversion(col17) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); select col17 from nchar_conversion order by 1; --[er]set insert into nchar_conversion(col18) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); --[er]multiset insert into nchar_conversion(col19) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); --[er]list insert into nchar_conversion(col20) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); --[er]sequence insert into nchar_conversion(col21) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); --[er]blob insert into nchar_conversion(col22) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); --[er]clob insert into nchar_conversion(col23) values (cast(n'11/08/2010 16:10:22.123' as nchar(30))); drop table nchar_conversion;
-- @testpoint:opengauss关键字operation(非保留),作为用户名 --关键字explain作为用户名不带引号,创建成功 drop user if exists operation; CREATE USER operation PASSWORD '<PASSWORD>'; drop user operation; --关键字explain作为用户名加双引号,创建成功 drop user if exists "operation"; CREATE USER "operation" PASSWORD '<PASSWORD>'; drop user "operation"; --关键字explain作为用户名加单引号,合理报错 CREATE USER 'operation' PASSWORD '<PASSWORD>'; --关键字explain作为用户名加反引号,合理报错 CREATE USER `operation` PASSWORD '<PASSWORD>';
<filename>Recepies/UPDATE_CONTRAGENTS.sql --Find Contragent ID SELECT LEGAL_NAME, ID_CONTRAGENT, CONTRAGENT_COL FROM FINANCE.CC_CONTRAGENTS WHERE LEGAL_NAME LIKE '%MOSH%' --Picker SELECT * FROM FINANCE.CC_CONTRAGENTS WHERE LEGAL_NAME LIKE '%MOSH%' OR LEGAL_NAME LIKE '%SOFT%' ORDER BY CONTRAGENT_COL; --update contragent UPDATE FINANCE.CC_CONTRAGENTS SET ID_CONTRAGENT = (SELECT DISTINCT ID_CONTRAGENT FROM FINANCE.CC_CONTRAGENTS WHERE LEGAL_NAME LIKE '%DEPOT%'), CONTRAGENT_COL = (SELECT DISTINCT CONTRAGENT_COL FROM FINANCE.CC_CONTRAGENTS WHERE LEGAL_NAME LIKE '%DEPOT%') WHERE LEGAL_NAME = 'STEP - ELSI OOD SOFIA BGR' UPDATE FINANCE.CC_CREDIT_CARD SET ID_CONTRAGENT = (SELECT ID_CONTRAGENT FROM FINANCE.CC_CONTRAGENTS WHERE FINANCE.CC_CONTRAGENTS.LEGAL_NAME = "contragent") --Append to tyhe back of the list INSERT INTO FINANCE.CC_CLASSIFIER (ID_CONTRAGENT) SELECT MAX(ID_CONTRAGENT)+1 FROM FINANCE.CC_CLASSIFIER; UPDATE FINANCE.CC_CONTRAGENTS SET ID_CONTRAGENT = (SELECT MAX(ID_CONTRAGENT) FROM FINANCE.CC_CONTRAGENTS), CONTRAGENT_COL = 'HUMBLEBUNDL' WHERE CONTRAGENT_ID=(SELECT CONTRAGENT_ID FROM CC_CONTRAGENTS_EMP WHERE LEGAL_NAME LIKE '%HUMBLEBUNDL%'); SELECT "contragent" FROM FINANCE.CC_CREDIT_CARD WHERE ID_CONTRAGENT IS NULL AND "contragent" IS NOT NULL;
<gh_stars>0 INSERT INTO burgers (burger_name) VALUES ('Mushroom & Swiss'); INSERT INTO burgers (burger_name) VALUES ('Southwest'); INSERT INTO burgers (burger_name) VALUES ('Buffalo Chicken');
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 11, 2019 at 06:00 AM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.3.1 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 */; -- -- Database: `laravel_admin` -- -- -------------------------------------------------------- -- -- Table structure for table `activity_log` -- CREATE TABLE `activity_log` ( `id` int(10) UNSIGNED NOT NULL, `log_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `subject_id` int(11) DEFAULT NULL, `subject_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `causer_id` int(11) DEFAULT NULL, `causer_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `properties` text COLLATE utf8mb4_unicode_ci, `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 `activity_log` -- INSERT INTO `activity_log` (`id`, `log_name`, `description`, `subject_id`, `subject_type`, `causer_id`, `causer_type`, `properties`, `created_at`, `updated_at`) VALUES (1, 'default', 'LoggedIn', NULL, NULL, 1, 'App\\User', '[]', '2019-08-26 12:47:15', '2019-08-26 12:47:15'), (2, 'default', 'LoggedIn', NULL, NULL, 1, 'App\\User', '[]', '2019-08-26 12:48:22', '2019-08-26 12:48:22'), (3, 'default', 'LoggedIn', NULL, NULL, 1, 'App\\User', '[]', '2019-11-01 04:12:27', '2019-11-01 04:12:27'), (4, 'default', 'LoggedIn', NULL, NULL, 1, 'App\\User', '[]', '2019-11-16 09:47:16', '2019-11-16 09:47:16'), (5, 'default', 'LoggedIn', NULL, NULL, 1, 'App\\User', '[]', '2019-11-19 10:23:13', '2019-11-19 10:23:13'), (6, 'default', 'LoggedIn', NULL, NULL, 1, 'App\\User', '[]', '2019-11-22 10:00:36', '2019-11-22 10:00:36'), (7, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-26 06:50:58', '2019-11-26 06:50:58'), (8, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-26 06:51:53', '2019-11-26 06:51:53'), (9, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-26 07:37:34', '2019-11-26 07:37:34'), (10, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-26 11:08:39', '2019-11-26 11:08:39'), (11, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-29 05:41:26', '2019-11-29 05:41:26'), (12, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-30 04:39:17', '2019-11-30 04:39:17'), (13, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-30 05:37:20', '2019-11-30 05:37:20'), (14, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-30 05:53:42', '2019-11-30 05:53:42'), (15, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-30 05:54:49', '2019-11-30 05:54:49'), (16, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-30 06:06:50', '2019-11-30 06:06:50'), (17, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-11-30 06:07:44', '2019-11-30 06:07:44'), (18, 'default', 'LoggedIn', NULL, NULL, 2, 'App\\User', '[]', '2019-12-11 04:50:40', '2019-12-11 04:50:40'), (19, 'default', 'LoggedIn', NULL, NULL, 24, 'App\\User', '[]', '2019-12-11 04:58:55', '2019-12-11 04:58:55'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) 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, '2019_06_15_070621_add_mobile_user', 1); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mobile` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` enum('active','in-active') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'in-active', `role` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `created_from` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `mobile`, `image`, `status`, `role`, `remember_token`, `created_at`, `created_from`, `updated_at`, `deleted_at`) VALUES (1, 'paras', '<EMAIL>', NULL, '$2y$10$UIzQ0z1/BMunWMjO40fdNOstEq6FlqjSMRAIedU6I3bJ0KrD838Qe', '8634985698', 'admins.jpg', 'in-active', 'admin', NULL, '2019-08-26 12:42:30', NULL, '2019-11-30 06:24:17', NULL), (2, 'demo', '<EMAIL>', NULL, '$2y$10$MVdO6kfLmCRBTzCohsIbjOmx7fDPq3kz8/UmfH1wzJsHOAy4zR9yC', '9834985695', '236832.png', 'in-active', 'admin', NULL, '2019-11-02 07:40:03', NULL, '2019-11-30 06:23:57', NULL), (3, 'test', '<EMAIL>', NULL, '$2y$10$n0Ne.aurC7/ezkmUIgTLRuBJY.5rMkThcJCCzHggmytacQBXe1pyu', NULL, NULL, 'active', 'user', NULL, '2019-11-26 06:54:01', NULL, '2019-11-30 05:03:37', NULL), (7, 'test', '<EMAIL>', NULL, '$2y$10$w8mZnS3J30pwWD9/TEXMLOCCp.iGdMZfz9S8XDdHimQIJuZM29gCK', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:42:31', NULL, '2019-11-30 05:03:49', NULL), (8, 'demo', '<EMAIL>', NULL, '$2y$10$klCt3l34iNE9fK0tsHKFl.xTNNK4SIpKlU23c4CRK8ebHv.72yv.O', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:44:00', NULL, '2019-11-30 05:03:45', NULL), (9, 'dfg', '<EMAIL>', NULL, '$2y$10$BdaVjswuw/oSX.i38aKiouf3O1NtX6Hwb0/.BLJqH89Ee3/4zDg0S', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:46:08', NULL, '2019-11-30 05:03:42', NULL), (10, 'sdf', '<EMAIL>', NULL, '$2y$10$KrJ5xtkDlKTtlY2yVxywl.XViIk0XT43zo88pN69mvqSS0M5mVxg.', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:46:27', NULL, '2019-11-30 05:04:01', NULL), (11, 'dg', '<EMAIL>', NULL, '$2y$10$S9YMJmvn9p5eaPpZMiMRUe3onioD/IE7UxFrywD95YHbRQilfkHfu', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:48:51', NULL, '2019-11-30 05:03:59', NULL), (12, 'zasdf', '<EMAIL>', NULL, '$2y$10$oLB.UKBlaY/UmeGF/hqMBucL14Bu3ekFu8QGOg5biyZ6R7RKnThka', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:49:03', NULL, '2019-11-30 05:03:58', NULL), (13, 'shdfsjh', '<EMAIL>', NULL, '$2y$10$.ipLsI0riHbFh2VEUk16Nu0IXHHosNepW/.k0QNBPiwY7q/I907t6', NULL, NULL, 'active', 'user', NULL, '2019-11-26 09:49:14', NULL, '2019-11-30 05:03:58', NULL), (14, 'asdb', '<EMAIL>', NULL, '$2y$10$jQAE.j1.8jgBVU7x175SLeTaXbkpVYFeNfDJIj4gb7aQiz05yCZYW', '9834985698', '13_404_Error.png', 'active', 'user', NULL, '2019-11-26 10:04:32', NULL, '2019-11-30 05:03:57', NULL), (15, 'sdfsbdlb', '<EMAIL>', NULL, '$2y$10$PO4vf.jt1Hyn9gVOnCALM.A0PCcjk4KrwRBTUJNOOIoC6ZP/A0foK', '9845985687', '796854.jpg', 'active', 'user', NULL, '2019-11-26 10:04:46', NULL, '2019-11-30 05:03:56', NULL), (16, 'jay', '<EMAIL>', NULL, '$2y$10$81fA/c6z.XIGlNJlpGyNzerxhybvjvGXo3r8RBQqKyaCg9tDfq0EO', '9898120235', '767277.jpg', 'active', 'user', NULL, '2019-11-26 10:04:56', NULL, '2019-11-30 05:03:55', NULL), (17, 'sona', '<EMAIL>', NULL, '$2y$10$DZcVNA6bXPQTshI3A/9ghO02KpULHph4OlNWnJtNtT6Z5YxYMHwnK', '9898120234', 'food.jpg', 'active', 'user', NULL, '2019-11-26 10:10:39', NULL, '2019-11-30 05:03:37', NULL), (18, 'dgd', '<EMAIL>', NULL, '$2y$10$T8qf3/7GzXea5GOwkeLq1.GDQE48gyLdVjH3NOoRiPwN6H7AyZzdG', NULL, NULL, 'in-active', 'user', NULL, '2019-11-26 10:10:49', NULL, '2019-11-26 10:10:55', '2019-11-26 10:10:55'), (19, 'sdkfjbqkj', '<EMAIL>', NULL, '$2y$10$mNbJUT.OfQEZGzx37OvYre/KHE/Iajo9jy/SPuh9rRFCIJfHmDOvi', NULL, NULL, 'in-active', 'user', NULL, '2019-11-26 10:32:41', NULL, '2019-11-26 11:12:42', '2019-11-26 11:12:42'), (20, 'dfg', '<EMAIL>', NULL, '$2y$10$expOHnEQs1mp.HE1iG0AvuYtnsQTqFOAJSfRXct.ym7gir3KatLGO', NULL, NULL, 'in-active', 'user', NULL, '2019-11-26 10:32:55', NULL, '2019-11-26 11:12:42', '2019-11-26 11:12:42'), (21, 'asdk', '<EMAIL>', NULL, '$2y$10$TXyqVn7G3Hp54pmT6lGySOos4lC2DEZo1.sMmNX41YcxN/OggFxvK', NULL, NULL, 'in-active', 'user', NULL, '2019-11-26 10:33:05', NULL, '2019-11-26 11:12:09', '2019-11-26 11:12:09'), (22, 'asdkasbdk', '<EMAIL>', NULL, '$2y$10$dwIsvg5Vx.8gLeY1r0uoI.bjooBSSn9r4RDZ6KO5fG4NuxEVOEu5i', NULL, NULL, 'in-active', 'user', NULL, '2019-11-26 10:33:15', NULL, '2019-11-29 06:10:49', '2019-11-29 06:10:49'), (23, 'kajal', '<EMAIL>', NULL, '$2y$10$rVmhQoD7Ky00xK7fhs7u2OTf954h20y63lySb0PRNQ.kes5eesEdW', '9845906789', NULL, 'active', 'user', NULL, '2019-11-29 09:59:04', NULL, '2019-12-11 04:50:53', '2019-12-11 04:50:53'), (24, 'riddhi', '<EMAIL>', NULL, '$2y$10$zCbZy6dQcq2XNyFCXwLm0ek07OPbmKXLU6OWHwIUpivhyFJaUC.xm', '9834985699', NULL, 'active', 'user', NULL, '2019-11-29 10:02:50', NULL, '2019-11-30 05:03:39', NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `activity_log` -- ALTER TABLE `activity_log` ADD PRIMARY KEY (`id`), ADD KEY `activity_log_log_name_index` (`log_name`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- 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 `activity_log` -- ALTER TABLE `activity_log` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; 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 */;
PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE IF NOT EXISTS "migrations" ("id" integer not null primary key autoincrement, "migration" varchar not null, "batch" integer not null); INSERT INTO "migrations" VALUES(130,'2017_02_04_142210_create_users_table',1); INSERT INTO "migrations" VALUES(131,'2017_02_05_065438_create_modules_table',1); INSERT INTO "migrations" VALUES(132,'2017_02_05_065503_create_events_table',1); INSERT INTO "migrations" VALUES(133,'2017_02_05_065524_create_timetables_table',1); INSERT INTO "migrations" VALUES(134,'2017_02_05_065930_create_user_modules_table',1); INSERT INTO "migrations" VALUES(135,'2017_02_05_065951_create_user_timetables_table',1); INSERT INTO "migrations" VALUES(136,'2017_02_05_071317_create_timetable_events_table',1); CREATE TABLE IF NOT EXISTS "users" ("id" integer not null primary key autoincrement, "email" varchar not null, "password" varchar not null, "created_at" datetime null, "updated_at" datetime null); INSERT INTO "users" VALUES(1,'<EMAIL>','$2y$10$tZ80OQ4A5k2fTh0OIWn0yu6XIyG4Tqp1wyieNmaN7ADpNGIk2QpFW','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(2,'<EMAIL>','$2y$10$J.e.2THDGYBUPnRhzQYfAeEBz0lk1/mzYrwppbZc3KOCxXzYcZ3VW','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(3,'<EMAIL>','$2y$10$eJbralJVgqwb.DBrGneixOnKxUd0ve/6OFjKUGVHj.fMl3M7aS/c6','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(4,'<EMAIL>','$2y$10$Abg2fL6BFUMRlvqeQdiPGO5/W9dzU9jUd7g84nPj5g/7GblP3haPC','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(5,'<EMAIL>','$2y$10$ggHQ18AsLXiL2/TURQ/9tO6c.VchNH90HZmhr3Xgp4osLSJmnFmw2','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(6,'<EMAIL>','$2y$10$HHA.F..4S9IDq3BnwC88huoStW81.Dhr6XOfk8ny.yd5qjWM1UzQK','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(7,'<EMAIL>','$2y$10$/AyeY.gqXwQ0erCR9Uzjou2MeZS9eTwSP48BAXQYH4aqIQkGLxsk.','2017-02-18 05:30:30','2017-02-18 05:30:30'); INSERT INTO "users" VALUES(8,'<EMAIL>','$2y$10$DkhdrcIZ224FyjLi/CFvsuuV546IFy8Rsi9lHscaFc9GZHMCgK.dS','2017-02-18 05:30:31','2017-02-18 05:30:31'); INSERT INTO "users" VALUES(9,'<EMAIL>','$2y$10$yxOzbgrqy.sfPBMbSQJIOO2ElNWCJH4QwqWjAYx22ZF.xjgODZ5tq','2017-02-18 05:30:31','2017-02-18 05:30:31'); INSERT INTO "users" VALUES(10,'<EMAIL>','$2y$10$teG/ieF8XhRuNOcK7lAxlupf6VHKRzwMe5GHI.YfoBz6h/FqsJv0W','2017-02-18 05:30:31','2017-02-18 05:30:31'); CREATE TABLE IF NOT EXISTS "modules" ("id" integer not null primary key autoincrement, "code" varchar not null, "name" varchar not null, "description" text not null, "period" varchar not null, "type" integer not null, "created_at" datetime null, "updated_at" datetime null); INSERT INTO "modules" VALUES(1,'cug865','quasi','Mouse, sharply and very soon came to the jury, who instantly made a memorandum of the house!'' (Which was very deep, or she should chance to be ashamed of yourself for asking such a capital one for.','Q4',0,'2017-02-18 05:30:24','2017-02-18 05:30:24'); INSERT INTO "modules" VALUES(2,'tau421','facere','I used to read fairy-tales, I fancied that kind of thing that would happen: ''"Miss Alice! Come here directly, and get ready to sink into the teapot. ''At any rate it would not open any of them..','Q3',1,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(3,'aad683','earum','Mock Turtle drew a long time together.'' ''Which is just the case with MINE,'' said the Duchess: you''d better finish the story for yourself.'' ''No, please go on!'' Alice said very politely, ''for I can''t.','Q1',1,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(4,'xfs356','nostrum','First, she dreamed of little Alice and all must have imitated somebody else''s hand,'' said the Dodo, ''the best way you go,'' said the Hatter, ''when the Queen merely remarking that a moment''s pause..','Q2',1,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(5,'mjs596','quia','Hatter. He had been broken to pieces. ''Please, then,'' said the Rabbit began. Alice gave a little bit of mushroom, and her eyes to see if she were looking over their slates; ''but it seems to like.','S2',2,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(6,'kwl116','voluptatem','Oh my fur and whiskers! She''ll get me executed, as sure as ferrets are ferrets! Where CAN I have ordered''; and she heard a little glass box that was said, and went down on her hand, and Alice heard.','Q4',1,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(7,'tcx041','eos','Hush!'' said the cook. ''Treacle,'' said a whiting to a mouse, That he met in the direction in which case it would make with the day and night! You see the earth takes twenty-four hours to turn into a.','Q1',1,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(8,'txw744','rerum','I''d gone to see if there are, nobody attends to them--and you''ve no idea what to beautify is, I can''t remember,'' said the Queen, who was trembling down to look over their shoulders, that all the.','Q3',0,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(9,'liy650','libero','Alice considered a little, half expecting to see a little bird as soon as the Rabbit, and had to run back into the sky all the same, the next question is, what did the Dormouse indignantly. However,.','Q3',0,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(10,'mqv053','officia','Majesty,'' said Alice in a deep, hollow tone: ''sit down, both of you, and listen to her, still it had made. ''He took me for his housemaid,'' she said to herself. (Alice had no very clear notion how.','Q3',1,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(11,'fjt506','officiis','No, I''ve made up my mind about it; and as it went. So she sat down a very good height indeed!'' said Alice, who felt ready to agree to everything that was linked into hers began to repeat it, when a.','Q2',2,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(12,'stn717','et','But the insolence of his Normans--" How are you thinking of?'' ''I beg your pardon!'' cried Alice hastily, afraid that she ran out of a large canvas bag, which tied up at the flowers and the small ones.','Q3',2,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(13,'rwn773','molestiae','VERY remarkable in that; nor did Alice think it would make with the tarts, you know--'' (pointing with his head!'' or ''Off with her face like the look of the conversation. Alice felt dreadfully.','S1',2,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(14,'aoq647','aut','I can go back by railway,'' she said to herself, ''because of his pocket, and was a dispute going on rather better now,'' she said, ''and see whether it''s marked "poison" or not''; for she had never.','S1',2,'2017-02-18 05:30:25','2017-02-18 05:30:25'); INSERT INTO "modules" VALUES(15,'coo602','beatae','MINE.'' The Queen turned crimson with fury, and, after glaring at her as she could not help bursting out laughing: and when she got up this morning? I almost wish I''d gone to see its meaning. ''And.','S2',0,'2017-02-18 05:30:25','2017-02-18 05:30:25'); CREATE TABLE IF NOT EXISTS "events" ("id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "name" varchar not null, "day" integer not null, "start" time not null, "end" time not null, "date" date null, "language" integer not null, "group" integer null, "creator_id" integer null, "module_id" integer not null, foreign key("creator_id") references "users"("id"), foreign key("module_id") references "modules"("id") on delete cascade); INSERT INTO "events" VALUES(1,'2017-02-18 05:30:25','2017-02-18 05:30:25','aau089 Lesson 7',2,'16:15:39','12:41:10','1986-12-16',2,3,8,8); INSERT INTO "events" VALUES(2,'2017-02-18 05:30:26','2017-02-18 05:30:26','jye728 Lesson 2',3,'14:09:07','00:31:06','1995-05-28',1,2,10,6); INSERT INTO "events" VALUES(3,'2017-02-18 05:30:26','2017-02-18 05:30:26','vuv426 Lesson 6',1,'21:26:42','22:02:07','1990-02-12',1,6,7,1); INSERT INTO "events" VALUES(4,'2017-02-18 05:30:26','2017-02-18 05:30:26','kkq327 Lesson 8',3,'19:14:39','10:59:24','2003-02-23',1,1,4,8); INSERT INTO "events" VALUES(5,'2017-02-18 05:30:26','2017-02-18 05:30:26','bxv601 Lesson 3',4,'07:02:31','12:52:12','1971-02-19',1,3,5,1); INSERT INTO "events" VALUES(6,'2017-02-18 05:30:26','2017-02-18 05:30:26','mui234 Lesson 6',6,'17:35:49','15:11:01','1985-06-22',3,3,2,5); INSERT INTO "events" VALUES(7,'2017-02-18 05:30:26','2017-02-18 05:30:26','xsc006 Lesson 1',1,'14:42:33','21:04:16','2006-05-06',0,4,9,5); INSERT INTO "events" VALUES(8,'2017-02-18 05:30:26','2017-02-18 05:30:26','yyh034 Lesson 5',4,'18:30:51','08:53:27','1997-11-11',1,1,2,1); INSERT INTO "events" VALUES(9,'2017-02-18 05:30:26','2017-02-18 05:30:26','ton798 Lesson 4',0,'19:07:40','11:27:27','2011-07-29',0,4,10,2); INSERT INTO "events" VALUES(10,'2017-02-18 05:30:26','2017-02-18 05:30:26','efn134 Lesson 6',3,'18:56:59','07:06:48','2000-04-25',3,4,6,6); INSERT INTO "events" VALUES(11,'2017-02-18 05:30:26','2017-02-18 05:30:26','nok080 Lesson 5',2,'19:44:05','09:02:55','1984-06-06',1,5,1,4); INSERT INTO "events" VALUES(12,'2017-02-18 05:30:26','2017-02-18 05:30:26','kpt043 Lesson 6',5,'23:13:29','04:23:56','2008-03-09',1,1,9,4); INSERT INTO "events" VALUES(13,'2017-02-18 05:30:27','2017-02-18 05:30:27','ofu565 Lesson 6',6,'10:59:29','04:31:27','2014-10-13',1,6,7,5); INSERT INTO "events" VALUES(14,'2017-02-18 05:30:27','2017-02-18 05:30:27','fcw460 Lesson 4',6,'01:06:35','13:13:27','1988-09-24',2,6,7,9); INSERT INTO "events" VALUES(15,'2017-02-18 05:30:28','2017-02-18 05:30:28','hkh526 Lesson 7',6,'23:35:56','06:05:49','1979-09-15',2,5,5,7); INSERT INTO "events" VALUES(16,'2017-02-18 05:30:28','2017-02-18 05:30:28','sbd467 Lesson 3',5,'18:40:47','18:57:41','1992-06-26',1,6,3,10); INSERT INTO "events" VALUES(17,'2017-02-18 05:30:28','2017-02-18 05:30:28','emm883 Lesson 1',3,'13:42:48','16:24:34','1985-01-07',2,3,7,2); INSERT INTO "events" VALUES(18,'2017-02-18 05:30:28','2017-02-18 05:30:28','utt624 Lesson 9',1,'09:04:53','23:03:13','2013-05-11',3,5,4,2); INSERT INTO "events" VALUES(19,'2017-02-18 05:30:28','2017-02-18 05:30:28','xsc207 Lesson 5',4,'08:10:20','13:53:28','2011-05-22',2,2,7,1); INSERT INTO "events" VALUES(20,'2017-02-18 05:30:28','2017-02-18 05:30:28','juc419 Lesson 6',1,'19:37:47','21:03:09','2002-05-21',1,6,1,4); INSERT INTO "events" VALUES(21,'2017-02-18 05:30:28','2017-02-18 05:30:28','vkq215 Lesson 1',6,'16:41:39','04:37:58','1970-04-18',1,1,4,9); INSERT INTO "events" VALUES(22,'2017-02-18 05:30:28','2017-02-18 05:30:28','dlf749 Lesson 7',0,'09:10:34','09:41:31','2005-05-04',0,5,1,5); INSERT INTO "events" VALUES(23,'2017-02-18 05:30:28','2017-02-18 05:30:28','qkc597 Lesson 0',4,'20:33:20','20:36:55','2001-03-10',2,1,10,7); INSERT INTO "events" VALUES(24,'2017-02-18 05:30:28','2017-02-18 05:30:28','poy229 Lesson 4',5,'18:10:13','01:54:40','1973-07-06',2,4,9,4); INSERT INTO "events" VALUES(25,'2017-02-18 05:30:28','2017-02-18 05:30:28','bgu664 Lesson 5',0,'01:07:42','17:52:21','2009-11-17',2,3,7,8); INSERT INTO "events" VALUES(26,'2017-02-18 05:30:28','2017-02-18 05:30:28','qws304 Lesson 4',6,'12:15:24','22:31:25','1999-05-05',0,2,1,7); INSERT INTO "events" VALUES(27,'2017-02-18 05:30:28','2017-02-18 05:30:28','eca792 Lesson 0',2,'04:32:25','06:58:06','1983-03-06',0,1,10,4); INSERT INTO "events" VALUES(28,'2017-02-18 05:30:28','2017-02-18 05:30:28','mdo394 Lesson 7',5,'12:38:24','20:44:34','2002-12-10',3,3,8,1); INSERT INTO "events" VALUES(29,'2017-02-18 05:30:28','2017-02-18 05:30:28','zdw583 Lesson 5',5,'02:39:32','14:48:29','1997-09-22',2,4,4,3); INSERT INTO "events" VALUES(30,'2017-02-18 05:30:29','2017-02-18 05:30:29','tiq150 Lesson 6',6,'08:46:15','14:26:20','1993-04-14',0,3,9,10); CREATE TABLE IF NOT EXISTS "timetables" ("id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "hash" varchar null, "creator_id" integer not null, foreign key("creator_id") references "users"("id")); INSERT INTO "timetables" VALUES(1,'2017-02-18 05:30:37','2017-02-18 05:30:37',NULL,2); INSERT INTO "timetables" VALUES(2,'2017-02-18 05:30:37','2017-02-18 05:30:37',NULL,10); INSERT INTO "timetables" VALUES(3,'2017-02-18 05:30:37','2017-02-18 05:30:37',NULL,7); INSERT INTO "timetables" VALUES(4,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,6); INSERT INTO "timetables" VALUES(5,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,4); INSERT INTO "timetables" VALUES(6,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,5); INSERT INTO "timetables" VALUES(7,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,2); INSERT INTO "timetables" VALUES(8,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,10); INSERT INTO "timetables" VALUES(9,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,10); INSERT INTO "timetables" VALUES(10,'2017-02-18 05:30:38','2017-02-18 05:30:38',NULL,4); CREATE TABLE IF NOT EXISTS "user_modules" ("id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "user_id" integer not null, "module_id" integer not null, foreign key("user_id") references "users"("id") on delete cascade, foreign key("module_id") references "modules"("id") on delete cascade); INSERT INTO "user_modules" VALUES(1,NULL,NULL,1,5); INSERT INTO "user_modules" VALUES(2,NULL,NULL,1,9); INSERT INTO "user_modules" VALUES(3,NULL,NULL,1,11); INSERT INTO "user_modules" VALUES(4,NULL,NULL,1,4); INSERT INTO "user_modules" VALUES(5,NULL,NULL,1,14); INSERT INTO "user_modules" VALUES(6,NULL,NULL,1,8); INSERT INTO "user_modules" VALUES(7,NULL,NULL,1,15); INSERT INTO "user_modules" VALUES(8,NULL,NULL,1,7); INSERT INTO "user_modules" VALUES(9,NULL,NULL,2,14); INSERT INTO "user_modules" VALUES(10,NULL,NULL,2,14); INSERT INTO "user_modules" VALUES(11,NULL,NULL,2,2); INSERT INTO "user_modules" VALUES(12,NULL,NULL,2,11); INSERT INTO "user_modules" VALUES(13,NULL,NULL,2,14); INSERT INTO "user_modules" VALUES(14,NULL,NULL,2,14); INSERT INTO "user_modules" VALUES(15,NULL,NULL,2,10); INSERT INTO "user_modules" VALUES(16,NULL,NULL,2,12); INSERT INTO "user_modules" VALUES(17,NULL,NULL,2,15); INSERT INTO "user_modules" VALUES(18,NULL,NULL,3,9); INSERT INTO "user_modules" VALUES(19,NULL,NULL,3,6); INSERT INTO "user_modules" VALUES(20,NULL,NULL,3,11); INSERT INTO "user_modules" VALUES(21,NULL,NULL,3,2); INSERT INTO "user_modules" VALUES(22,NULL,NULL,3,15); INSERT INTO "user_modules" VALUES(23,NULL,NULL,3,5); INSERT INTO "user_modules" VALUES(24,NULL,NULL,3,14); INSERT INTO "user_modules" VALUES(25,NULL,NULL,3,12); INSERT INTO "user_modules" VALUES(26,NULL,NULL,3,12); INSERT INTO "user_modules" VALUES(27,NULL,NULL,3,6); INSERT INTO "user_modules" VALUES(28,NULL,NULL,4,5); INSERT INTO "user_modules" VALUES(29,NULL,NULL,4,3); INSERT INTO "user_modules" VALUES(30,NULL,NULL,4,15); INSERT INTO "user_modules" VALUES(31,NULL,NULL,4,12); INSERT INTO "user_modules" VALUES(32,NULL,NULL,4,3); INSERT INTO "user_modules" VALUES(33,NULL,NULL,4,5); INSERT INTO "user_modules" VALUES(34,NULL,NULL,4,8); INSERT INTO "user_modules" VALUES(35,NULL,NULL,4,1); INSERT INTO "user_modules" VALUES(36,NULL,NULL,4,7); INSERT INTO "user_modules" VALUES(37,NULL,NULL,4,13); INSERT INTO "user_modules" VALUES(38,NULL,NULL,4,2); INSERT INTO "user_modules" VALUES(39,NULL,NULL,5,11); INSERT INTO "user_modules" VALUES(40,NULL,NULL,5,14); INSERT INTO "user_modules" VALUES(41,NULL,NULL,5,7); INSERT INTO "user_modules" VALUES(42,NULL,NULL,6,12); INSERT INTO "user_modules" VALUES(43,NULL,NULL,6,6); INSERT INTO "user_modules" VALUES(44,NULL,NULL,6,1); INSERT INTO "user_modules" VALUES(45,NULL,NULL,6,10); INSERT INTO "user_modules" VALUES(46,NULL,NULL,6,14); INSERT INTO "user_modules" VALUES(47,NULL,NULL,6,4); INSERT INTO "user_modules" VALUES(48,NULL,NULL,6,7); INSERT INTO "user_modules" VALUES(49,NULL,NULL,7,3); INSERT INTO "user_modules" VALUES(50,NULL,NULL,7,15); INSERT INTO "user_modules" VALUES(51,NULL,NULL,7,12); INSERT INTO "user_modules" VALUES(52,NULL,NULL,7,15); INSERT INTO "user_modules" VALUES(53,NULL,NULL,7,4); INSERT INTO "user_modules" VALUES(54,NULL,NULL,7,6); INSERT INTO "user_modules" VALUES(55,NULL,NULL,7,1); INSERT INTO "user_modules" VALUES(56,NULL,NULL,7,4); INSERT INTO "user_modules" VALUES(57,NULL,NULL,7,9); INSERT INTO "user_modules" VALUES(58,NULL,NULL,8,14); INSERT INTO "user_modules" VALUES(59,NULL,NULL,8,8); INSERT INTO "user_modules" VALUES(60,NULL,NULL,8,8); INSERT INTO "user_modules" VALUES(61,NULL,NULL,8,13); INSERT INTO "user_modules" VALUES(62,NULL,NULL,8,10); INSERT INTO "user_modules" VALUES(63,NULL,NULL,8,10); INSERT INTO "user_modules" VALUES(64,NULL,NULL,8,2); INSERT INTO "user_modules" VALUES(65,NULL,NULL,8,7); INSERT INTO "user_modules" VALUES(66,NULL,NULL,8,2); INSERT INTO "user_modules" VALUES(67,NULL,NULL,8,12); INSERT INTO "user_modules" VALUES(68,NULL,NULL,8,10); INSERT INTO "user_modules" VALUES(69,NULL,NULL,8,15); INSERT INTO "user_modules" VALUES(70,NULL,NULL,8,5); INSERT INTO "user_modules" VALUES(71,NULL,NULL,8,3); INSERT INTO "user_modules" VALUES(72,NULL,NULL,8,5); INSERT INTO "user_modules" VALUES(73,NULL,NULL,9,9); INSERT INTO "user_modules" VALUES(74,NULL,NULL,9,15); INSERT INTO "user_modules" VALUES(75,NULL,NULL,9,10); INSERT INTO "user_modules" VALUES(76,NULL,NULL,9,14); INSERT INTO "user_modules" VALUES(77,NULL,NULL,9,7); INSERT INTO "user_modules" VALUES(78,NULL,NULL,9,15); INSERT INTO "user_modules" VALUES(79,NULL,NULL,9,8); INSERT INTO "user_modules" VALUES(80,NULL,NULL,9,7); INSERT INTO "user_modules" VALUES(81,NULL,NULL,9,6); INSERT INTO "user_modules" VALUES(82,NULL,NULL,10,6); INSERT INTO "user_modules" VALUES(83,NULL,NULL,10,11); INSERT INTO "user_modules" VALUES(84,NULL,NULL,10,4); INSERT INTO "user_modules" VALUES(85,NULL,NULL,10,10); INSERT INTO "user_modules" VALUES(86,NULL,NULL,10,9); INSERT INTO "user_modules" VALUES(87,NULL,NULL,10,5); INSERT INTO "user_modules" VALUES(88,NULL,NULL,10,4); CREATE TABLE IF NOT EXISTS "user_timetables" ("id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "user_id" integer not null, "timetable_id" integer not null, foreign key("user_id") references "users"("id") on delete cascade, foreign key("timetable_id") references "tables"("id") on delete cascade); INSERT INTO "user_timetables" VALUES(1,NULL,NULL,3,1); INSERT INTO "user_timetables" VALUES(2,NULL,NULL,4,1); INSERT INTO "user_timetables" VALUES(3,NULL,NULL,7,1); INSERT INTO "user_timetables" VALUES(4,NULL,NULL,5,1); INSERT INTO "user_timetables" VALUES(5,NULL,NULL,9,1); INSERT INTO "user_timetables" VALUES(6,NULL,NULL,10,1); INSERT INTO "user_timetables" VALUES(7,NULL,NULL,5,1); INSERT INTO "user_timetables" VALUES(8,NULL,NULL,9,2); INSERT INTO "user_timetables" VALUES(9,NULL,NULL,1,2); INSERT INTO "user_timetables" VALUES(10,NULL,NULL,4,2); INSERT INTO "user_timetables" VALUES(11,NULL,NULL,8,2); INSERT INTO "user_timetables" VALUES(12,NULL,NULL,7,2); INSERT INTO "user_timetables" VALUES(13,NULL,NULL,2,2); INSERT INTO "user_timetables" VALUES(14,NULL,NULL,3,2); INSERT INTO "user_timetables" VALUES(15,NULL,NULL,6,2); INSERT INTO "user_timetables" VALUES(16,NULL,NULL,8,2); INSERT INTO "user_timetables" VALUES(17,NULL,NULL,8,3); INSERT INTO "user_timetables" VALUES(18,NULL,NULL,6,3); INSERT INTO "user_timetables" VALUES(19,NULL,NULL,2,3); INSERT INTO "user_timetables" VALUES(20,NULL,NULL,10,4); INSERT INTO "user_timetables" VALUES(21,NULL,NULL,3,4); INSERT INTO "user_timetables" VALUES(22,NULL,NULL,5,4); INSERT INTO "user_timetables" VALUES(23,NULL,NULL,5,4); INSERT INTO "user_timetables" VALUES(24,NULL,NULL,3,4); INSERT INTO "user_timetables" VALUES(25,NULL,NULL,6,4); INSERT INTO "user_timetables" VALUES(26,NULL,NULL,8,5); INSERT INTO "user_timetables" VALUES(27,NULL,NULL,5,5); INSERT INTO "user_timetables" VALUES(28,NULL,NULL,9,5); INSERT INTO "user_timetables" VALUES(29,NULL,NULL,2,5); INSERT INTO "user_timetables" VALUES(30,NULL,NULL,1,5); INSERT INTO "user_timetables" VALUES(31,NULL,NULL,1,5); INSERT INTO "user_timetables" VALUES(32,NULL,NULL,8,5); INSERT INTO "user_timetables" VALUES(33,NULL,NULL,5,5); INSERT INTO "user_timetables" VALUES(34,NULL,NULL,7,5); INSERT INTO "user_timetables" VALUES(35,NULL,NULL,6,6); INSERT INTO "user_timetables" VALUES(36,NULL,NULL,4,6); INSERT INTO "user_timetables" VALUES(37,NULL,NULL,3,6); INSERT INTO "user_timetables" VALUES(38,NULL,NULL,2,6); INSERT INTO "user_timetables" VALUES(39,NULL,NULL,6,6); INSERT INTO "user_timetables" VALUES(40,NULL,NULL,3,6); INSERT INTO "user_timetables" VALUES(41,NULL,NULL,10,7); INSERT INTO "user_timetables" VALUES(42,NULL,NULL,9,8); INSERT INTO "user_timetables" VALUES(43,NULL,NULL,5,8); INSERT INTO "user_timetables" VALUES(44,NULL,NULL,2,8); INSERT INTO "user_timetables" VALUES(45,NULL,NULL,9,8); INSERT INTO "user_timetables" VALUES(46,NULL,NULL,2,9); INSERT INTO "user_timetables" VALUES(47,NULL,NULL,4,9); INSERT INTO "user_timetables" VALUES(48,NULL,NULL,8,9); INSERT INTO "user_timetables" VALUES(49,NULL,NULL,6,10); INSERT INTO "user_timetables" VALUES(50,NULL,NULL,3,10); INSERT INTO "user_timetables" VALUES(51,NULL,NULL,10,10); INSERT INTO "user_timetables" VALUES(52,NULL,NULL,1,10); INSERT INTO "user_timetables" VALUES(53,NULL,NULL,10,10); INSERT INTO "user_timetables" VALUES(54,NULL,NULL,10,10); INSERT INTO "user_timetables" VALUES(55,NULL,NULL,2,10); CREATE TABLE IF NOT EXISTS "timetable_events" ("id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "event_id" integer not null, "timetable_id" integer not null, foreign key("timetable_id") references "timetables"("id") on delete cascade, foreign key("event_id") references "events"("id") on delete cascade); INSERT INTO "timetable_events" VALUES(1,NULL,NULL,7,1); INSERT INTO "timetable_events" VALUES(2,NULL,NULL,3,1); INSERT INTO "timetable_events" VALUES(3,NULL,NULL,1,1); INSERT INTO "timetable_events" VALUES(4,NULL,NULL,14,1); INSERT INTO "timetable_events" VALUES(5,NULL,NULL,9,1); INSERT INTO "timetable_events" VALUES(6,NULL,NULL,3,1); INSERT INTO "timetable_events" VALUES(7,NULL,NULL,4,1); INSERT INTO "timetable_events" VALUES(8,NULL,NULL,6,1); INSERT INTO "timetable_events" VALUES(9,NULL,NULL,2,1); INSERT INTO "timetable_events" VALUES(10,NULL,NULL,1,1); INSERT INTO "timetable_events" VALUES(11,NULL,NULL,3,1); INSERT INTO "timetable_events" VALUES(12,NULL,NULL,3,1); INSERT INTO "timetable_events" VALUES(13,NULL,NULL,11,1); INSERT INTO "timetable_events" VALUES(14,NULL,NULL,11,1); INSERT INTO "timetable_events" VALUES(15,NULL,NULL,14,1); INSERT INTO "timetable_events" VALUES(16,NULL,NULL,8,1); INSERT INTO "timetable_events" VALUES(17,NULL,NULL,1,2); INSERT INTO "timetable_events" VALUES(18,NULL,NULL,12,2); INSERT INTO "timetable_events" VALUES(19,NULL,NULL,12,2); INSERT INTO "timetable_events" VALUES(20,NULL,NULL,15,2); INSERT INTO "timetable_events" VALUES(21,NULL,NULL,11,2); INSERT INTO "timetable_events" VALUES(22,NULL,NULL,9,2); INSERT INTO "timetable_events" VALUES(23,NULL,NULL,15,2); INSERT INTO "timetable_events" VALUES(24,NULL,NULL,6,2); INSERT INTO "timetable_events" VALUES(25,NULL,NULL,15,2); INSERT INTO "timetable_events" VALUES(26,NULL,NULL,4,2); INSERT INTO "timetable_events" VALUES(27,NULL,NULL,4,2); INSERT INTO "timetable_events" VALUES(28,NULL,NULL,3,2); INSERT INTO "timetable_events" VALUES(29,NULL,NULL,14,2); INSERT INTO "timetable_events" VALUES(30,NULL,NULL,13,2); INSERT INTO "timetable_events" VALUES(31,NULL,NULL,1,2); INSERT INTO "timetable_events" VALUES(32,NULL,NULL,13,3); INSERT INTO "timetable_events" VALUES(33,NULL,NULL,9,3); INSERT INTO "timetable_events" VALUES(34,NULL,NULL,7,3); INSERT INTO "timetable_events" VALUES(35,NULL,NULL,2,3); INSERT INTO "timetable_events" VALUES(36,NULL,NULL,7,3); INSERT INTO "timetable_events" VALUES(37,NULL,NULL,1,3); INSERT INTO "timetable_events" VALUES(38,NULL,NULL,11,3); INSERT INTO "timetable_events" VALUES(39,NULL,NULL,1,3); INSERT INTO "timetable_events" VALUES(40,NULL,NULL,6,3); INSERT INTO "timetable_events" VALUES(41,NULL,NULL,11,3); INSERT INTO "timetable_events" VALUES(42,NULL,NULL,11,3); INSERT INTO "timetable_events" VALUES(43,NULL,NULL,5,3); INSERT INTO "timetable_events" VALUES(44,NULL,NULL,2,3); INSERT INTO "timetable_events" VALUES(45,NULL,NULL,8,3); INSERT INTO "timetable_events" VALUES(46,NULL,NULL,5,3); INSERT INTO "timetable_events" VALUES(47,NULL,NULL,9,3); INSERT INTO "timetable_events" VALUES(48,NULL,NULL,1,3); INSERT INTO "timetable_events" VALUES(49,NULL,NULL,15,3); INSERT INTO "timetable_events" VALUES(50,NULL,NULL,10,3); INSERT INTO "timetable_events" VALUES(51,NULL,NULL,8,3); INSERT INTO "timetable_events" VALUES(52,NULL,NULL,6,3); INSERT INTO "timetable_events" VALUES(53,NULL,NULL,6,3); INSERT INTO "timetable_events" VALUES(54,NULL,NULL,5,3); INSERT INTO "timetable_events" VALUES(55,NULL,NULL,12,3); INSERT INTO "timetable_events" VALUES(56,NULL,NULL,9,3); INSERT INTO "timetable_events" VALUES(57,NULL,NULL,9,3); INSERT INTO "timetable_events" VALUES(58,NULL,NULL,4,3); INSERT INTO "timetable_events" VALUES(59,NULL,NULL,10,3); INSERT INTO "timetable_events" VALUES(60,NULL,NULL,11,3); INSERT INTO "timetable_events" VALUES(61,NULL,NULL,13,4); INSERT INTO "timetable_events" VALUES(62,NULL,NULL,9,4); INSERT INTO "timetable_events" VALUES(63,NULL,NULL,11,4); INSERT INTO "timetable_events" VALUES(64,NULL,NULL,4,4); INSERT INTO "timetable_events" VALUES(65,NULL,NULL,8,4); INSERT INTO "timetable_events" VALUES(66,NULL,NULL,7,4); INSERT INTO "timetable_events" VALUES(67,NULL,NULL,15,4); INSERT INTO "timetable_events" VALUES(68,NULL,NULL,15,4); INSERT INTO "timetable_events" VALUES(69,NULL,NULL,1,4); INSERT INTO "timetable_events" VALUES(70,NULL,NULL,4,4); INSERT INTO "timetable_events" VALUES(71,NULL,NULL,13,4); INSERT INTO "timetable_events" VALUES(72,NULL,NULL,14,5); INSERT INTO "timetable_events" VALUES(73,NULL,NULL,5,5); INSERT INTO "timetable_events" VALUES(74,NULL,NULL,5,5); INSERT INTO "timetable_events" VALUES(75,NULL,NULL,8,5); INSERT INTO "timetable_events" VALUES(76,NULL,NULL,4,5); INSERT INTO "timetable_events" VALUES(77,NULL,NULL,4,5); INSERT INTO "timetable_events" VALUES(78,NULL,NULL,6,5); INSERT INTO "timetable_events" VALUES(79,NULL,NULL,1,6); INSERT INTO "timetable_events" VALUES(80,NULL,NULL,11,6); INSERT INTO "timetable_events" VALUES(81,NULL,NULL,4,6); INSERT INTO "timetable_events" VALUES(82,NULL,NULL,9,6); INSERT INTO "timetable_events" VALUES(83,NULL,NULL,14,6); INSERT INTO "timetable_events" VALUES(84,NULL,NULL,13,6); INSERT INTO "timetable_events" VALUES(85,NULL,NULL,5,6); INSERT INTO "timetable_events" VALUES(86,NULL,NULL,11,6); INSERT INTO "timetable_events" VALUES(87,NULL,NULL,5,6); INSERT INTO "timetable_events" VALUES(88,NULL,NULL,9,6); INSERT INTO "timetable_events" VALUES(89,NULL,NULL,4,6); INSERT INTO "timetable_events" VALUES(90,NULL,NULL,1,6); INSERT INTO "timetable_events" VALUES(91,NULL,NULL,4,6); INSERT INTO "timetable_events" VALUES(92,NULL,NULL,11,6); INSERT INTO "timetable_events" VALUES(93,NULL,NULL,13,6); INSERT INTO "timetable_events" VALUES(94,NULL,NULL,5,6); INSERT INTO "timetable_events" VALUES(95,NULL,NULL,9,6); INSERT INTO "timetable_events" VALUES(96,NULL,NULL,3,6); INSERT INTO "timetable_events" VALUES(97,NULL,NULL,4,6); INSERT INTO "timetable_events" VALUES(98,NULL,NULL,7,6); INSERT INTO "timetable_events" VALUES(99,NULL,NULL,10,6); INSERT INTO "timetable_events" VALUES(100,NULL,NULL,4,6); INSERT INTO "timetable_events" VALUES(101,NULL,NULL,2,7); INSERT INTO "timetable_events" VALUES(102,NULL,NULL,7,7); INSERT INTO "timetable_events" VALUES(103,NULL,NULL,9,7); INSERT INTO "timetable_events" VALUES(104,NULL,NULL,9,7); INSERT INTO "timetable_events" VALUES(105,NULL,NULL,2,7); INSERT INTO "timetable_events" VALUES(106,NULL,NULL,7,7); INSERT INTO "timetable_events" VALUES(107,NULL,NULL,1,7); INSERT INTO "timetable_events" VALUES(108,NULL,NULL,9,7); INSERT INTO "timetable_events" VALUES(109,NULL,NULL,9,7); INSERT INTO "timetable_events" VALUES(110,NULL,NULL,1,7); INSERT INTO "timetable_events" VALUES(111,NULL,NULL,1,7); INSERT INTO "timetable_events" VALUES(112,NULL,NULL,5,7); INSERT INTO "timetable_events" VALUES(113,NULL,NULL,8,7); INSERT INTO "timetable_events" VALUES(114,NULL,NULL,14,8); INSERT INTO "timetable_events" VALUES(115,NULL,NULL,13,8); INSERT INTO "timetable_events" VALUES(116,NULL,NULL,11,8); INSERT INTO "timetable_events" VALUES(117,NULL,NULL,7,8); INSERT INTO "timetable_events" VALUES(118,NULL,NULL,4,8); INSERT INTO "timetable_events" VALUES(119,NULL,NULL,15,8); INSERT INTO "timetable_events" VALUES(120,NULL,NULL,11,8); INSERT INTO "timetable_events" VALUES(121,NULL,NULL,7,8); INSERT INTO "timetable_events" VALUES(122,NULL,NULL,5,8); INSERT INTO "timetable_events" VALUES(123,NULL,NULL,12,8); INSERT INTO "timetable_events" VALUES(124,NULL,NULL,14,8); INSERT INTO "timetable_events" VALUES(125,NULL,NULL,3,8); INSERT INTO "timetable_events" VALUES(126,NULL,NULL,1,8); INSERT INTO "timetable_events" VALUES(127,NULL,NULL,11,8); INSERT INTO "timetable_events" VALUES(128,NULL,NULL,9,8); INSERT INTO "timetable_events" VALUES(129,NULL,NULL,2,8); INSERT INTO "timetable_events" VALUES(130,NULL,NULL,7,8); INSERT INTO "timetable_events" VALUES(131,NULL,NULL,7,8); INSERT INTO "timetable_events" VALUES(132,NULL,NULL,10,8); INSERT INTO "timetable_events" VALUES(133,NULL,NULL,7,8); INSERT INTO "timetable_events" VALUES(134,NULL,NULL,6,8); INSERT INTO "timetable_events" VALUES(135,NULL,NULL,6,8); INSERT INTO "timetable_events" VALUES(136,NULL,NULL,9,8); INSERT INTO "timetable_events" VALUES(137,NULL,NULL,14,8); INSERT INTO "timetable_events" VALUES(138,NULL,NULL,6,8); INSERT INTO "timetable_events" VALUES(139,NULL,NULL,13,9); INSERT INTO "timetable_events" VALUES(140,NULL,NULL,5,9); INSERT INTO "timetable_events" VALUES(141,NULL,NULL,12,10); INSERT INTO "timetable_events" VALUES(142,NULL,NULL,4,10); INSERT INTO "timetable_events" VALUES(143,NULL,NULL,10,10); INSERT INTO "timetable_events" VALUES(144,NULL,NULL,6,10); INSERT INTO "timetable_events" VALUES(145,NULL,NULL,6,10); INSERT INTO "timetable_events" VALUES(146,NULL,NULL,15,10); INSERT INTO "timetable_events" VALUES(147,NULL,NULL,11,10); INSERT INTO "timetable_events" VALUES(148,NULL,NULL,1,10); INSERT INTO "timetable_events" VALUES(149,NULL,NULL,14,10); INSERT INTO "timetable_events" VALUES(150,NULL,NULL,9,10); INSERT INTO "timetable_events" VALUES(151,NULL,NULL,12,10); INSERT INTO "timetable_events" VALUES(152,NULL,NULL,9,10); INSERT INTO "timetable_events" VALUES(153,NULL,NULL,8,10); INSERT INTO "timetable_events" VALUES(154,NULL,NULL,1,10); INSERT INTO "timetable_events" VALUES(155,NULL,NULL,3,10); INSERT INTO "timetable_events" VALUES(156,NULL,NULL,1,10); INSERT INTO "timetable_events" VALUES(157,NULL,NULL,2,10); INSERT INTO "timetable_events" VALUES(158,NULL,NULL,7,10); INSERT INTO "timetable_events" VALUES(159,NULL,NULL,14,10); INSERT INTO "timetable_events" VALUES(160,NULL,NULL,14,10); INSERT INTO "timetable_events" VALUES(161,NULL,NULL,14,10); INSERT INTO "timetable_events" VALUES(162,NULL,NULL,3,10); INSERT INTO "timetable_events" VALUES(163,NULL,NULL,11,10); INSERT INTO "timetable_events" VALUES(164,NULL,NULL,6,10); INSERT INTO "timetable_events" VALUES(165,NULL,NULL,12,10); INSERT INTO "timetable_events" VALUES(166,NULL,NULL,5,10); INSERT INTO "timetable_events" VALUES(167,NULL,NULL,5,10); INSERT INTO "timetable_events" VALUES(168,NULL,NULL,10,10); DELETE FROM sqlite_sequence; INSERT INTO "sqlite_sequence" VALUES('migrations',136); INSERT INTO "sqlite_sequence" VALUES('modules',15); INSERT INTO "sqlite_sequence" VALUES('events',30); INSERT INTO "sqlite_sequence" VALUES('users',10); INSERT INTO "sqlite_sequence" VALUES('user_modules',88); INSERT INTO "sqlite_sequence" VALUES('timetables',10); INSERT INTO "sqlite_sequence" VALUES('timetable_events',168); INSERT INTO "sqlite_sequence" VALUES('user_timetables',55); CREATE UNIQUE INDEX "users_email_unique" on "users" ("email"); CREATE UNIQUE INDEX "modules_code_unique" on "modules" ("code"); CREATE UNIQUE INDEX "events_group_module_id_name_unique" on "events" ("group", "module_id", "name"); CREATE UNIQUE INDEX "timetables_hash_unique" on "timetables" ("hash"); COMMIT;
<filename>database/manager 12-09-2017.sql -- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 12, 2017 at 01:52 AM -- Server version: 5.7.14 -- PHP Version: 5.6.25 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 utf8mb4 */; -- -- Database: `cricket` -- -- -------------------------------------------------------- -- -- Table structure for table `manager` -- CREATE TABLE `manager` ( `id` int(11) NOT NULL, `man_name` varchar(255) NOT NULL, `asst_name` varchar(255) NOT NULL, `team_name` varchar(255) NOT NULL, `rights` int(11) NOT NULL DEFAULT '0' COMMENT '0: manager, 1: admin', `budget` int(11) NOT NULL DEFAULT '100000000', `fix_budget` int(11) NOT NULL DEFAULT '100000000' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `manager` -- INSERT INTO `manager` (`id`, `man_name`, `asst_name`, `team_name`, `rights`, `budget`, `fix_budget`) VALUES (1, '<NAME>', 'Varsha', 'Hit and Run', 0, 100000000, 100000000), (2, '<NAME>', 'Thirta', 'Knight Slayers', 0, 100000000, 100000000), (3, '<NAME>', 'Shruti', 'The Son of Pitches', 0, 100000000, 100000000), (4, '<NAME>', '<NAME>', 'Royal Strikers', 0, 100000000, 100000000), (5, '<NAME>', '<NAME>', 'All Stars XI', 0, 100000000, 100000000), (6, '<NAME>', '<NAME>', '<NAME>', 0, 100000000, 100000000), (7, '<NAME>', 'Sushmita', 'Strike Force XI', 0, 100000000, 100000000), (8, 'Lipika', 'Rammya', 'Storm Riders', 0, 100000000, 100000000), (9, 'admin', '', 'admin', 1, 100000000, 100000000), (10, 'global', '', 'global', 1, 100000000, 100000000); -- -- Indexes for dumped tables -- -- -- Indexes for table `manager` -- ALTER TABLE `manager` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `manager` -- ALTER TABLE `manager` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; /*!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 */;
select * from ScaCompanyDB..MP750100 where MP75012 = '2020-10-12' --which work centres are tied to which product group? goal is to try to see planned vs actual by day. test for rotomoulding as i know what the plan per day is
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 13, 2020 at 05:33 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.27 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 */; -- -- Database: `tubes` -- -- -------------------------------------------------------- -- -- Table structure for table `appoitment` -- CREATE TABLE `appoitment` ( `id` int(11) NOT NULL, `nama_depan` varchar(50) NOT NULL, `nama_belakang` varchar(50) NOT NULL, `hospital` varchar(50) NOT NULL, `tanggal` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `appoitment` -- INSERT INTO `appoitment` (`id`, `nama_depan`, `nama_belakang`, `hospital`, `tanggal`) VALUES (2, 'Syamsul', 'Rizal', 'rs pertamina', '2020-04-14'), (5, 'Syamsul', 'Rizal', 'telkomedika', '2020-04-14'), (17, 'Adham', 'Siwi', 'telkomedika', '2020-05-12'), (18, 'Adham', 'Angga', 'telkomedika', '2020-05-05'), (19, 'Bodat', 'Botak', 'rs pertamina', '2020-05-10'), (20, 'Yusril', 'Udin', 'rs pertamina', '2020-05-02'), (21, 'Erwin', 'Budi', 'rs persahabatan', '2020-05-12'), (22, 'Raihan', 'Nugraha', 'rs persahabatan', '2020-05-09'), (23, 'Kami', 'Budi', 'rs persahabatan', '2020-05-10'), (24, 'bagas', 'Eka', 'rs hermina', '2020-05-08'), (25, 'Ntong', 'setiawan', 'rs hermina', '2020-04-17'), (26, 'Ridhwan', 'Alek', 'rs hermina', '2020-05-09'), (27, 'Adham', 'Erlangga', 'rs jakarta', '2020-05-10'), (28, 'Erlangga', 'Adham', 'rs jakarta', '2020-05-02'), (29, 'Siwi', 'Adham', 'rs jakarta', '2020-04-22'), (30, 'Yusril', 'Ghani', 'rs hasan sadikin', '2020-05-03'), (31, 'Raihan', 'Nugraha', 'rs hasan sadikin', '2020-04-12'), (32, 'Bagas', 'Humas', 'rs hasan sadikin', '2020-04-27'), (33, 'Ferdian', 'Paleika', 'rs santosa', '2020-05-08'), (34, 'Ferdian', 'Akbar', 'rs santosa', '2020-05-09'), (35, 'Ridhwan', 'Nashir', 'rs santosa', '2020-05-05'), (36, 'Buaya', 'Darat', 'rs al ihsan', '2020-05-02'), (37, 'Boyke', 'Meong', 'rs al ihsan', '2020-05-11'), (38, 'Luhut', 'Panjaian', 'rs al ihsan', '2020-05-08'), (39, 'Setyo', 'Novanto', 'rs dr cipto mangunkusumo', '2020-05-06'), (40, 'Luhut', 'Novanto', 'rs dr cipto mangunkusumo', '2020-05-02'), (41, 'Susi', 'Puji', 'rs dr cipto mangunkusumo', '2020-05-09'); -- -------------------------------------------------------- -- -- Table structure for table `hospital` -- CREATE TABLE `hospital` ( `id` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `alamat` text NOT NULL, `slot` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `hospital` -- INSERT INTO `hospital` (`id`, `nama`, `alamat`, `slot`) VALUES (1, 'Telkomedika', 'Telkom University', 4), (9, 'RS Hermina', 'Bandung', 6), (10, 'RS Pertamina', 'Jakarta', 6), (11, 'RS Persahabatan', 'Jakarta', 2), (12, 'RS Jakarta', 'Jakarta', 3), (13, 'RS Hasan Sadikin', 'Bandung', 11), (14, 'RS Santosa', 'Bandung', 5), (15, 'RS Al Ihsan', 'Bandung', 4), (16, 'RS Dr <NAME>', 'Jakarta', 3); -- -------------------------------------------------------- -- -- Table structure for table `news` -- CREATE TABLE `news` ( `id` int(11) NOT NULL, `title` varchar(50) NOT NULL, `isi` text NOT NULL, `foto` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `nama_depan` varchar(128) NOT NULL, `nama_belakang` varchar(128) NOT NULL, `username` varchar(128) NOT NULL, `email` varchar(128) NOT NULL, `password` varchar(128) NOT NULL, `image` varchar(64) NOT NULL, `role_id` int(11) NOT NULL, `date_created` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `nama_depan`, `nama_belakang`, `username`, `email`, `password`, `image`, `role_id`, `date_created`) VALUES (1, 'admin', 'mantap', 'admin', '<EMAIL>', '<PASSWORD>', 'avatar.png', 1, 1587077337), (4, 'Syamsul', 'Rizal', 'syamsul', '<EMAIL>', '123', 'avatar.png', 2, 1587079584), (5, 'Raihan', 'Nugraha', 'raihanns', '<EMAIL>', '123', 'avatar.png', 2, 1587080061), (7, 'Yusril', 'Alaudin', 'yusril', '<EMAIL>', '123', 'avatar.png', 2, 1589381561), (8, 'Adham', 'Erlangga', 'adham', '<EMAIL>', '123', 'avatar.png', 2, 1589381593), (9, 'Ridhwan', 'Nashir', 'ridhwan', '<EMAIL>', '123', 'avatar.png', 2, 1589381630); -- -------------------------------------------------------- -- -- Table structure for table `user_access_menu` -- CREATE TABLE `user_access_menu` ( `id` int(11) NOT NULL, `role_id` int(11) NOT NULL, `menu_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_access_menu` -- INSERT INTO `user_access_menu` (`id`, `role_id`, `menu_id`) VALUES (1, 1, 1), (3, 2, 2), (8, 1, 2), (12, 2, 5), (13, 1, 5), (14, 1, 3), (15, 1, 6); -- -------------------------------------------------------- -- -- Table structure for table `user_menu` -- CREATE TABLE `user_menu` ( `id` int(11) NOT NULL, `menu` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_menu` -- INSERT INTO `user_menu` (`id`, `menu`) VALUES (1, 'Admin'), (2, 'User'), (3, 'Menu'), (5, 'Appointment'), (6, 'Laporan'); -- -------------------------------------------------------- -- -- Table structure for table `user_role` -- CREATE TABLE `user_role` ( `id` int(11) NOT NULL, `role` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_role` -- INSERT INTO `user_role` (`id`, `role`) VALUES (1, 'Admin'), (2, 'Member'); -- -------------------------------------------------------- -- -- Table structure for table `user_sub_menu` -- CREATE TABLE `user_sub_menu` ( `id` int(11) NOT NULL, `menu_id` int(11) NOT NULL, `title` varchar(128) NOT NULL, `url` varchar(128) NOT NULL, `icon` varchar(128) NOT NULL, `is_active` int(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_sub_menu` -- INSERT INTO `user_sub_menu` (`id`, `menu_id`, `title`, `url`, `icon`, `is_active`) VALUES (1, 1, 'Dashboard', 'admin', 'home', 1), (2, 2, 'My Profile', 'user/profile', 'user', 1), (3, 2, 'Edit Profile', 'user/editprofile', 'edit', 1), (4, 3, 'Menu Management', 'menu', 'menu', 1), (5, 3, 'Submenu Management', 'menu/submenu', 'folder', 1), (6, 1, 'Data Rumah Sakit', 'admin/listhospital', 'hard-drive', 1), (7, 4, 'tes', 'tes', 'tes', 1), (8, 1, 'Role', 'admin/role', 'sliders', 1), (9, 5, 'Medical Appointment', 'user/appointment', 'alert-circle', 1), (13, 6, 'Appointment', 'Laporan', 'alert-circle', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `appoitment` -- ALTER TABLE `appoitment` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hospital` -- ALTER TABLE `hospital` ADD PRIMARY KEY (`id`); -- -- Indexes for table `news` -- ALTER TABLE `news` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user_access_menu` -- ALTER TABLE `user_access_menu` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user_menu` -- ALTER TABLE `user_menu` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user_role` -- ALTER TABLE `user_role` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user_sub_menu` -- ALTER TABLE `user_sub_menu` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `appoitment` -- ALTER TABLE `appoitment` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42; -- -- AUTO_INCREMENT for table `hospital` -- ALTER TABLE `hospital` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `news` -- ALTER TABLE `news` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `user_access_menu` -- ALTER TABLE `user_access_menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `user_menu` -- ALTER TABLE `user_menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `user_role` -- ALTER TABLE `user_role` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `user_sub_menu` -- ALTER TABLE `user_sub_menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; 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 */;
 /****** Object: StoredProcedure [dbo].[app_PatronReview_GetAll] Script Date: 01/05/2015 14:43:24 ******/ --Create the Select Proc CREATE PROCEDURE [dbo].[app_PatronReview_GetAll] @pid INT = 0 AS SELECT * FROM [PatronReview] WHERE @PID = PID
create TYPE campaign_history_typ as object ( campaign_id VARCHAR2(50), emails_sent integer, send_time DATE, --VARCHAR2(50), recipient_list_id VARCHAR2(2000), template_id integer, subject_line varchar2(100), from_name varchar2(200), opens integer, unique_opens integer, open_rate integer, clicks integer, cancel_send varchar2(1000) ); / DROP TABLE campaign_history_typ_TBL; create type campaign_history_typ_set as table of campaign_history_typ; / create table campaign_history_typ_tbl ( campaign_id VARCHAR2(50), emails_sent integer, send_time DATE, --VARCHAR2(50), recipient_list_id VARCHAR2(2000), template_id integer, subject_line varchar2(100), from_name varchar2(200), opens integer, unique_opens integer, open_rate integer, clicks integer, cancel_send varchar2(1000) ); / select * --campaign_id, substr(send_time,1,instr(send_time,'+')-1), to_date(substr(send_time,1,instr(send_time,'+')-1), 'YYYY-MM-DD"T"HH24:MI:SS') as send_time --2018-09-13T12:41:09+00:00 YYYY-MM-DDThh:mm:ss+hh:mm from table(blog_mailchimp_pkg.get_campaign_history) --where campaign_id = '0549f6b349'
/* Create index for countStakeholders query optimization */ BEGIN; CREATE INDEX "stake_orders_sAddress" ON stake_orders ("senderId"); COMMIT;
BEGIN; INSERT INTO samples (name) VALUES ('Sample1'); COMMIT;
<filename>migrations/2021-06-10-184018_user/up.sql CREATE TABLE users ( id serial PRIMARY KEY, name varchar(256) NOT NULL );
<filename>business-services/egf-master/src/main/resources/db/migration/dev/V20170629150224__bankaccount_data.sql INSERT INTO egf_bankaccount (id, branchid, glcodeid, fundid, accountnumber, accounttype, description, active, payto, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, 1, 1223, 1, '000000000001', 'OTHER SCHEDULED BANKS', NULL, true, NULL, 'RECEIPTS_PAYMENTS', 1, '2017-05-08 00:00:00', 1, '2017-05-08 00:00:00', 0, 'default'); SELECT setval('seq_egf_bankaccount',(select max(id)+1 from egf_bankaccount));
<filename>tables/_rdebug_stats.sql DROP TABLE IF EXISTS _rdebug_stats; CREATE TABLE _rdebug_stats ( worker_id bigint unsigned not null, routine_schema varchar(64) not null, routine_name varchar(64) not null, statement_id int unsigned not null, count_visits bigint unsigned not null, PRIMARY KEY (worker_id, routine_schema, routine_name, statement_id) ) ENGINE=MyISAM ;
CREATE OR REPLACE FUNCTION pgl_ddl_deploy.set_tag_defaults() RETURNS trigger LANGUAGE plpgsql AS $function$ BEGIN IF NEW.create_tags IS NULL THEN NEW.create_tags = CASE WHEN NEW.include_only_repset_tables THEN pgl_ddl_deploy.standard_repset_only_tags() ELSE pgl_ddl_deploy.standard_create_tags() END; END IF; IF NEW.drop_tags IS NULL THEN NEW.drop_tags = CASE WHEN NEW.include_only_repset_tables THEN NULL ELSE pgl_ddl_deploy.standard_drop_tags() END; END IF; RETURN NEW; END; $function$ ;
INSERT INTO burgers (burger_name, devoured) VALUES ("Cheeseburger", false), ("<NAME>", true), ("Clubhouse Steak", false);
select (select nombre_completo from cartera.cliente where id=m.id_cliente) as nombre_completo_cliente, m.numero_comprobante, m.fecha_emision, (select nombre from inventario.producto where id=d.id_producto) as nombre_producto, d.costo_unitario, (select codigo from inventario.producto where id=d.id_producto) as codigo_producto from inventario.movimiento_inventario m inner join inventario.detalle_movimiento_inventario d on d.id_movimiento_inventario=m.id inner join inventario.producto p on d.id_producto=p.id --where
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jun 08, 2016 at 11:02 AM -- Server version: 5.6.17 -- PHP Version: 5.5.12 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: `dokimi` -- CREATE DATABASE IF NOT EXISTS `dokimi` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `dokimi`; -- -------------------------------------------------------- -- -- Table structure for table `attachments` -- DROP TABLE IF EXISTS `attachments`; CREATE TABLE IF NOT EXISTS `attachments` ( `ID` int(11) NOT NULL, `ID_p` int(11) NOT NULL, `titlos` varchar(255) DEFAULT NULL, `pdf` varchar(255) DEFAULT NULL, `siggrafeas` varchar(255) DEFAULT NULL, `imerominia` varchar(255) DEFAULT NULL, `perigrafi` text, `katigoria` varchar(255) DEFAULT NULL, `rating` int(255) DEFAULT '0', `views` int(255) DEFAULT '0', `rating_n` int(255) DEFAULT '0', PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `attachments` -- INSERT INTO `attachments` (`ID`, `ID_p`, `titlos`, `pdf`, `siggrafeas`, `imerominia`, `perigrafi`, `katigoria`, `rating`, `views`, `rating_n`) VALUES (0, 0, 'attachment1', 'localhost/Project/files/0/0/a.pdf', 'singrafeas1', '2016-06-19', 'Perigrafi1', 'Άλλο', 20, 13, 2), (1, 0, 'attachment2', 'localhost/Project/files/0/0/a.pdf', 'singrafeas1', '2016-06-19', 'Perigrafi1', 'Επιστημονικό Άρθρο', 20, 9, 1), (2, 0, 'attachment3', 'localhost/Project/files/0/0/a.pdf', 'singrafeas1', '2016-06-19', 'Perigrafi1', 'Δημόσια Αρχή', 20, 9, 2), (3, 0, 'attachment4', 'localhost/Project/files/0/0/a.pdf', 'singrafeas1', '2016-06-19', 'Perigrafi1', 'Εταιρικό Έγγραφο', 20, 10, 1), (4, 0, 'attachment5', 'localhost/Project/files/0/0/a.pdf', 'singrafeas1', '2016-06-19', 'Perigrafi1', 'Προσωπική Άποψη/blog', 40, 34, 2), (5, 0, 'titlos_123123', 'www.pdf995.com/samples/pdf.pdf', 'singrafeas_1', '2016-06-08', 'awggawgawawga', 'Άλλο', 0, 1, 0); -- -------------------------------------------------------- -- -- Table structure for table `comments` -- DROP TABLE IF EXISTS `comments`; CREATE TABLE IF NOT EXISTS `comments` ( `ID` int(11) NOT NULL, `ID_a` int(11) NOT NULL, `Username` varchar(255) NOT NULL, `text` text, `imerominia` text, PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `comments` -- INSERT INTO `comments` (`ID`, `ID_a`, `Username`, `text`, `imerominia`) VALUES (0, 0, 'Manolis', 'kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1', '2016-6-5'), (1, 0, 'Manolis', 'kimeno tou comment dokimi2kimeno tou comment dokimi2kimeno tou comment dokimi2kimeno tou comment dokimi2', '2016-6-5'), (2, 0, 'Manolis', 'kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1kimeno tou comment dokimi1', '2016-6-5'), (3, 0, 'Manolis', 'kimeno tou comment dokimi2kimeno tou comment dokimi2kimeno tou comment dokimi2kimeno tou comment dokimi2kimeno tou comment dokimi2kimeno tou comment dokimi2', '2016-6-5'), (4, 0, 'Manolis', 'dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 dokimi123 123 132 ', '2016-10-10'), (5, 4, 'Manolis', 'edw grafoume to comment tou attachment 5', '2016-06-08'), (6, 4, 'Manolis', 'comment noumero 2 dokimazoume tin defteri sira', '2016-06-08'); -- -------------------------------------------------------- -- -- Table structure for table `processes` -- DROP TABLE IF EXISTS `processes`; CREATE TABLE IF NOT EXISTS `processes` ( `ID` int(11) NOT NULL, `User_ID` int(11) NOT NULL, `titlos` varchar(255) DEFAULT NULL, `perigrafi` text, `step1` varchar(255) DEFAULT NULL, `step1b` varchar(255) DEFAULT NULL, `step1e` varchar(255) DEFAULT NULL, `step2` varchar(255) DEFAULT NULL, `step2b` varchar(255) DEFAULT NULL, `step2e` varchar(255) DEFAULT NULL, `step3` varchar(255) DEFAULT NULL, `step3b` varchar(255) DEFAULT NULL, `step3e` varchar(255) DEFAULT NULL, `step4` varchar(255) DEFAULT NULL, `step4b` varchar(255) DEFAULT NULL, `step4e` varchar(255) DEFAULT NULL, `step5` varchar(255) DEFAULT NULL, `step5b` varchar(255) DEFAULT NULL, `step5e` varchar(255) DEFAULT NULL, `step6` varchar(255) DEFAULT NULL, `step6b` varchar(255) DEFAULT NULL, `step6e` varchar(255) DEFAULT NULL, `step7` varchar(255) DEFAULT NULL, `step7b` varchar(255) DEFAULT NULL, `step7e` varchar(255) DEFAULT NULL, `step8` varchar(255) DEFAULT NULL, `step8b` varchar(255) DEFAULT NULL, `step8e` varchar(255) DEFAULT NULL, `step9` varchar(255) DEFAULT NULL, `step9b` varchar(255) DEFAULT NULL, `step9e` varchar(255) DEFAULT NULL, `step10` varchar(255) DEFAULT NULL, `step10b` varchar(255) DEFAULT NULL, `step10e` varchar(255) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `processes` -- INSERT INTO `processes` (`ID`, `User_ID`, `titlos`, `perigrafi`, `step1`, `step1b`, `step1e`, `step2`, `step2b`, `step2e`, `step3`, `step3b`, `step3e`, `step4`, `step4b`, `step4e`, `step5`, `step5b`, `step5e`, `step6`, `step6b`, `step6e`, `step7`, `step7b`, `step7e`, `step8`, `step8b`, `step8e`, `step9`, `step9b`, `step9e`, `step10`, `step10b`, `step10e`) VALUES (0, 0, 'Process1', 'Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 Description1 ', 'step1_1', '2016-06-13', '2016-06-14', 'step2_2', '2016-06-15', '2016-06-16', 'step3_3', '2016-06-19', '2016-06-21', 'step4_4', '2016-06-22', '2016-06-24', 'step5_5', '2016-06-28', '2016-06-30', 'step6_6', '2016-07-03', '2016-07-07', 'step7_7', '2016-07-08', '2016-07-09', 'step8_8', '2016-07-10', '2016-07-11', 'step9_9', '2016-07-13', '2016-07-15', 'step10_10', '2016-07-18', '2016-07-19'), (1, 0, 'process dokimi', 'description process dikimi', 'step1_1_1_1', '2016-06-20', '2016-06-21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (2, 0, 'test', 'test', 'step1_1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (3, 0, NULL, NULL, NULL, '2016-06-24', '2016-06-09', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `ID` int(11) NOT NULL, `Username` varchar(255) NOT NULL, `Password` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `Onoma` varchar(255) DEFAULT NULL, `Eponimo` varchar(255) DEFAULT NULL, `Eksidikefsi` varchar(255) DEFAULT NULL, `Thesi` varchar(255) DEFAULT NULL, `Katigoria1` varchar(255) DEFAULT NULL, `Katigoria2` varchar(255) DEFAULT NULL, `Katigoria3` varchar(255) DEFAULT NULL, `Organismos` varchar(255) DEFAULT NULL, `Katigoria_o` varchar(255) DEFAULT NULL, `Filo` varchar(255) DEFAULT NULL, `Spoudes1` varchar(255) DEFAULT NULL, `Spoudes2` varchar(255) DEFAULT NULL, `Spoudes3` varchar(255) DEFAULT NULL, `Ksenes1` varchar(255) DEFAULT NULL, `ks1_s` varchar(2) DEFAULT NULL, `ks1_w` varchar(2) DEFAULT NULL, `Ksenes2` varchar(255) DEFAULT NULL, `ks2_s` varchar(2) DEFAULT NULL, `ks2_w` varchar(2) DEFAULT NULL, `Ksenes3` varchar(255) DEFAULT NULL, `ks3_s` varchar(2) DEFAULT NULL, `ks3_w` varchar(2) DEFAULT NULL, `Ethnikotita` varchar(255) DEFAULT NULL, `Poli` varchar(255) DEFAULT NULL, `activation` varchar(255) NOT NULL, `status` int(1) NOT NULL DEFAULT '0', `edit_info_1` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`), UNIQUE KEY `username` (`Username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`ID`, `Username`, `Password`, `email`, `Onoma`, `Eponimo`, `Eksidikefsi`, `Thesi`, `Katigoria1`, `Katigoria2`, `Katigoria3`, `Organismos`, `Katigoria_o`, `Filo`, `Spoudes1`, `Spoudes2`, `Spoudes3`, `Ksenes1`, `ks1_s`, `ks1_w`, `Ksenes2`, `ks2_s`, `ks2_w`, `Ksenes3`, `ks3_s`, `ks3_w`, `Ethnikotita`, `Poli`, `activation`, `status`, `edit_info_1`) VALUES (0, 'Manolis', '098f6bcd4621d373cade4e832627b4f6', '<EMAIL>', 'Manolis', 'Andreopoulos', 'Περιβάλλον', 'thesi_123', 'Διοικητική', 'Ακαδημαϊκή', 'Προϊστάμενος-Πρόεδρος', 'Organismos_manolis', 'Δημόσιος Τομέας', 'Άνδρας', 'ΑΕΙ', 'MASTER', 'PHD', '', '', '', '', '', '', '', '', '', 'Greece', '', '098f6bcd4621d373cade4e832627b4f6', 1, 1), (1, 'Dokimi', '098f6bcd4621d373cade4e832627b4f6', 'test', 'Dokimi', 'Test', '', '', '', '', '', '', '', 'Άνδρας', '', '', '', 'agglika', '', '', 'germanika', '', '', '', '', '', 'USA', '', '098f6bcd4621d373cade4e832627b4f6', 1, 1), (2, 'Dokimiasd', '098f6bcd4621d373cade4e832627b4f6', 'testagawgawgawg', 'Dokimiawfawfawf', 'Testawfwafaw', '', '', '', '', '', '', '', 'Άνδρας', '', '', '', 'agglika', '', '', 'germanika', '', '', '', '', '', 'USA', '', '098f6bcd4621d373cade4e832627b4f6', 1, 1); /*!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 */;
INSERT INTO solution_type(solution_type_id, description, title) VALUES (1, 'Builder', 'Builder'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (2, 'Bricklayer', 'Bricklayer'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (3, 'Carpet Fitter', 'Carpet Fitter'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (4, 'Caterer', 'Caterer'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (5, 'Chimney Sweep', 'Chimney Sweep'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (6, 'Cleaner', 'Cleaner'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (7, 'Electrician', 'Electrician'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (8, 'Gardener', 'Gardener'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (9, 'Glazier', 'Glazier'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (10, 'Joiner', 'Joiner'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (11, 'Kitchen Fitter', 'Kitchen Fitter'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (12, 'Landscape Gardener', 'Landscape Gardener'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (13, 'Locksmith', 'Locksmith'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (14, 'Painter and Decorator', 'Painter and Decorator'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (15, 'Plasterer', 'Plasterer'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (16, 'Plumber', 'Plumber'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (17, 'Printer', 'Printer'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (18, 'Roofer', 'Roofer'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (19, 'Tiler', 'Tiler'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (20, 'Tree Surgeon', 'Tree Surgeon'); INSERT INTO solution_type(solution_type_id, description, title) VALUES (21, 'Window Cleaner', 'Window Cleaner'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (22, 'Baker', 'Baker'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (23, 'Hairstylist', 'Hairstylist'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (24, 'Bartender', 'Bartender'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (25, 'Blacksmith', 'Blacksmith'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (26, 'Pastry chef', 'Pastry chef'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (27, 'Piano tuner', 'Piano tuner'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (28, 'Steeplejack', 'Steeplejack'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (29, 'Stonemason', 'Stonemason'); -- INSERT INTO solution_type(solution_type_id, description, title) VALUES (30, 'Welder', 'Welder'); /* solution_task_type */ INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (50, 'Extension', 'Extension', 1); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (51, 'Garage Conversion', 'Garage Conversion', 1); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (52, 'Plastering', 'Plastering', 1); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (53, 'Kitchen Fitting', 'Kitchen Fitting', 1); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (54, 'Bathroom Fitting', 'Bathroom Fitting', 1); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (55, 'Other', 'Other', 1); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (60, 'Garden Wall', 'Garden Wall', 2); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (61, 'Repair Wall', 'Repair Wall', 2); INSERT INTO solution_task_type(solution_task_type_id, description, title, solution_type_id) VALUES (62, 'Other', 'Other', 2); /* solution_task_job_type */ INSERT INTO solution_task_job_type(solution_task_job_type_id, description, title, solution_task_type_id) VALUES (60, 'Test', 'Test', 50); INSERT INTO solution_task_job_type(solution_task_job_type_id, description, title, solution_task_type_id) VALUES (61, 'Test', 'Test', 50); INSERT INTO solution_task_job_type(solution_task_job_type_id, description, title, solution_task_type_id) VALUES (62, 'Test', 'Test', 50); INSERT INTO solution_task_job_type(solution_task_job_type_id, description, title, solution_task_type_id) VALUES (70, 'Test', 'Test', 60); INSERT INTO solution_task_job_type(solution_task_job_type_id, description, title, solution_task_type_id) VALUES (71, 'Test', 'Test', 60); INSERT INTO solution_task_job_type(solution_task_job_type_id, description, title, solution_task_type_id) VALUES (72, 'Test', 'Test', 60);
-- noinspection SqlWithoutWhere DELETE FROM game; ALTER TABLE game DROP CONSTRAINT game_white_token_key; ALTER TABLE game DROP CONSTRAINT game_black_token_key; ALTER TABLE game RENAME white_token TO white_player; ALTER TABLE game RENAME black_token TO black_player; ALTER TABLE game ADD CONSTRAINT game_white_player_fkey FOREIGN KEY (white_player) REFERENCES "user"; ALTER TABLE game ADD CONSTRAINT game_black_player_fkey FOREIGN KEY (black_player) REFERENCES "user";
SET MODE MySQL; --SET IGNORECASE TRUE;
select 'Altering block_cache' as comment; CREATE INDEX IF NOT EXISTS block_cache_timestamp_idx ON block_cache(block_timestamp); CREATE INDEX IF NOT EXISTS block_cache_tx_count_idx ON block_cache(tx_count);
-- phpMyAdmin SQL Dump -- version 3.1.3.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 08, 2015 at 12:49 PM -- Server version: 5.1.33 -- PHP Version: 5.2.9 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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: `database` -- CREATE DATABASE `database` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `database`; -- -------------------------------------------------------- -- -- Table structure for table `table1` -- CREATE TABLE IF NOT EXISTS `table1` ( `table1_id` int(255) unsigned NOT NULL AUTO_INCREMENT, `tb1_colunm1` varchar(1000) DEFAULT NULL, `tb1_colunm2` varchar(1000) DEFAULT NULL, `tb1_colunm3` varchar(1000) DEFAULT NULL, `tb1_colunm4` varchar(1000) DEFAULT NULL, `tb1_colunm5` varchar(1000) DEFAULT NULL, `tb1_colunm6` varchar(1000) DEFAULT NULL, `tb1_colunm7` varchar(1000) DEFAULT NULL, `tb1_colunm8` varchar(1000) DEFAULT NULL, `tb1_colunm9` varchar(1000) DEFAULT NULL, `tb1_colunm10` varchar(1000) DEFAULT NULL, `tb1_colunm11` varchar(1000) DEFAULT NULL, `tb1_colunm12` varchar(1000) DEFAULT NULL, `tb1_colunm13` varchar(1000) DEFAULT NULL, `tb1_colunm14` varchar(1000) DEFAULT NULL, `tb1_colunm15` varchar(1000) DEFAULT NULL, `tb1_colunm16` varchar(1000) DEFAULT NULL, `tb1_colunm17` varchar(1000) DEFAULT NULL, `tb1_colunm18` varchar(1000) DEFAULT NULL, `tb1_colunm19` varchar(1000) DEFAULT NULL, `tb1_colunm20` varchar(1000) DEFAULT NULL, `tb1_colunm21` varchar(1000) DEFAULT NULL, `tb1_colunm22` varchar(1000) DEFAULT NULL, `tb1_colunm23` varchar(1000) DEFAULT NULL, `tb1_colunm24` varchar(1000) DEFAULT NULL, `tb1_colunm25` varchar(1000) DEFAULT NULL, `tb1_colunm26` varchar(1000) DEFAULT NULL, `tb1_colunm27` varchar(1000) DEFAULT NULL, `tb1_colunm28` varchar(1000) DEFAULT NULL, `tb1_colunm29` varchar(1000) DEFAULT NULL, `tb1_colunm30` varchar(1000) DEFAULT NULL, `tb1_colunm31` varchar(255) DEFAULT NULL, `tb1_colunm32` varchar(255) DEFAULT NULL, `tb1_colunm33` varchar(255) DEFAULT NULL, `tb1_colunm34` varchar(255) DEFAULT NULL, `tb1_colunm35` varchar(255) DEFAULT NULL, `tb1_colunm36` varchar(255) DEFAULT NULL, `tb1_colunm37` varchar(255) DEFAULT NULL, `tb1_colunm38` varchar(255) DEFAULT NULL, `tb1_colunm39` varchar(255) DEFAULT NULL, `tb1_colunm40` varchar(255) DEFAULT NULL, `tb1_colunm41` varchar(255) DEFAULT NULL, `tb1_colunm42` varchar(255) DEFAULT NULL, `tb1_colunm43` varchar(255) DEFAULT NULL, `tb1_colunm44` varchar(255) DEFAULT NULL, `tb1_colunm45` varchar(255) DEFAULT NULL, `tb1_colunm46` varchar(255) DEFAULT NULL, `tb1_colunm47` varchar(255) DEFAULT NULL, `tb1_colunm48` varchar(255) DEFAULT NULL, `tb1_colunm49` varchar(255) DEFAULT NULL, `tb1_colunm50` varchar(255) DEFAULT NULL, `tb1_colunm51` varchar(255) DEFAULT NULL, `tb1_colunm52` varchar(255) DEFAULT NULL, `tb1_colunm53` varchar(255) DEFAULT NULL, `tb1_colunm54` varchar(255) DEFAULT NULL, `tb1_colunm55` varchar(255) DEFAULT NULL, `tb1_colunm56` varchar(255) DEFAULT NULL, `tb1_colunm57` varchar(255) DEFAULT NULL, `tb1_colunm58` varchar(255) DEFAULT NULL, `tb1_colunm59` varchar(255) DEFAULT NULL, `tb1_colunm60` varchar(255) DEFAULT NULL, `tb1_colunm61` varchar(255) DEFAULT NULL, `tb1_colunm62` varchar(255) DEFAULT NULL, `tb1_colunm63` varchar(255) DEFAULT NULL, `tb1_colunm64` varchar(255) DEFAULT NULL, `tb1_colunm65` varchar(255) DEFAULT NULL, `tb1_colunm66` varchar(255) DEFAULT NULL, `tb1_colunm67` varchar(255) DEFAULT NULL, `tb1_colunm68` varchar(255) DEFAULT NULL, `tb1_colunm69` varchar(255) DEFAULT NULL, `tb1_colunm70` varchar(255) DEFAULT NULL, `tb1_colunm71` varchar(255) DEFAULT NULL, `tb1_colunm72` varchar(255) DEFAULT NULL, `tb1_colunm73` varchar(255) DEFAULT NULL, `tb1_colunm74` varchar(255) DEFAULT NULL, `tb1_colunm75` varchar(255) DEFAULT NULL, `tb1_colunm76` varchar(255) DEFAULT NULL, `tb1_colunm77` varchar(255) DEFAULT NULL, `tb1_colunm78` varchar(255) DEFAULT NULL, `tb1_colunm79` varchar(255) DEFAULT NULL, `tb1_colunm80` varchar(255) DEFAULT NULL, `tb1_colunm81` varchar(255) DEFAULT NULL, `tb1_colunm82` varchar(255) DEFAULT NULL, `tb1_colunm83` varchar(255) DEFAULT NULL, `tb1_colunm84` varchar(255) DEFAULT NULL, `tb1_colunm85` varchar(255) DEFAULT NULL, `tb1_colunm86` varchar(255) DEFAULT NULL, `tb1_colunm87` varchar(255) DEFAULT NULL, `tb1_colunm88` varchar(255) DEFAULT NULL, `tb1_colunm89` varchar(255) DEFAULT NULL, `tb1_colunm90` varchar(255) DEFAULT NULL, `tb1_colunm91` varchar(255) DEFAULT NULL, `tb1_colunm92` varchar(255) DEFAULT NULL, `tb1_colunm93` varchar(255) DEFAULT NULL, `tb1_colunm94` varchar(255) DEFAULT NULL, `tb1_colunm95` varchar(255) DEFAULT NULL, `tb1_colunm96` varchar(255) DEFAULT NULL, `tb1_colunm97` varchar(255) DEFAULT NULL, `tb1_colunm98` varchar(255) DEFAULT NULL, `tb1_colunm99` varchar(255) DEFAULT NULL, `tb1_colunm100` varchar(255) DEFAULT NULL, PRIMARY KEY (`table1_id`), KEY `table1_id` (`table1_id`), FULLTEXT KEY `tb1_colunm7` (`tb1_colunm7`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=41842 ; -- -------------------------------------------------------- -- -- Table structure for table `table2` -- CREATE TABLE IF NOT EXISTS `table2` ( `table2_id` int(255) unsigned NOT NULL AUTO_INCREMENT, `tb2_colunm1` varchar(1000) DEFAULT NULL, `tb2_colunm2` varchar(1000) DEFAULT NULL, `tb2_colunm3` varchar(1000) DEFAULT NULL, `tb2_colunm4` varchar(1000) DEFAULT NULL, `tb2_colunm5` varchar(1000) DEFAULT NULL, `tb2_colunm6` varchar(1000) DEFAULT NULL, `tb2_colunm7` varchar(1000) DEFAULT NULL, `tb2_colunm8` varchar(1000) DEFAULT NULL, `tb2_colunm9` varchar(1000) DEFAULT NULL, `tb2_colunm10` varchar(1000) DEFAULT NULL, `tb2_colunm11` varchar(1000) DEFAULT NULL, `tb2_colunm12` varchar(1000) DEFAULT NULL, `tb2_colunm13` varchar(1000) DEFAULT NULL, `tb2_colunm14` varchar(1000) DEFAULT NULL, `tb2_colunm15` varchar(1000) DEFAULT NULL, `tb2_colunm16` varchar(1000) DEFAULT NULL, `tb2_colunm17` varchar(1000) DEFAULT NULL, `tb2_colunm18` varchar(1000) DEFAULT NULL, `tb2_colunm19` varchar(1000) DEFAULT NULL, `tb2_colunm20` varchar(1000) DEFAULT NULL, `tb2_colunm21` varchar(1000) DEFAULT NULL, `tb2_colunm22` varchar(1000) DEFAULT NULL, `tb2_colunm23` varchar(1000) DEFAULT NULL, `tb2_colunm24` varchar(1000) DEFAULT NULL, `tb2_colunm25` varchar(1000) DEFAULT NULL, `tb2_colunm26` varchar(1000) DEFAULT NULL, `tb2_colunm27` varchar(1000) DEFAULT NULL, `tb2_colunm28` varchar(1000) DEFAULT NULL, `tb2_colunm29` varchar(1000) DEFAULT NULL, `tb2_colunm30` varchar(1000) DEFAULT NULL, `tb2_colunm31` varchar(255) DEFAULT NULL, `tb2_colunm32` varchar(255) DEFAULT NULL, `tb2_colunm33` varchar(255) DEFAULT NULL, `tb2_colunm34` varchar(255) DEFAULT NULL, `tb2_colunm35` varchar(255) DEFAULT NULL, `tb2_colunm36` varchar(255) DEFAULT NULL, `tb2_colunm37` varchar(255) DEFAULT NULL, `tb2_colunm38` varchar(255) DEFAULT NULL, `tb2_colunm39` varchar(255) DEFAULT NULL, `tb2_colunm40` varchar(255) DEFAULT NULL, `tb2_colunm41` varchar(255) DEFAULT NULL, `tb2_colunm42` varchar(255) DEFAULT NULL, `tb2_colunm43` varchar(255) DEFAULT NULL, `tb2_colunm44` varchar(255) DEFAULT NULL, `tb2_colunm45` varchar(255) DEFAULT NULL, `tb2_colunm46` varchar(255) DEFAULT NULL, `tb2_colunm47` varchar(255) DEFAULT NULL, `tb2_colunm48` varchar(255) DEFAULT NULL, `tb2_colunm49` varchar(255) DEFAULT NULL, `tb2_colunm50` varchar(255) DEFAULT NULL, `tb2_colunm51` varchar(255) DEFAULT NULL, `tb2_colunm52` varchar(255) DEFAULT NULL, `tb2_colunm53` varchar(255) DEFAULT NULL, `tb2_colunm54` varchar(255) DEFAULT NULL, `tb2_colunm55` varchar(255) DEFAULT NULL, `tb2_colunm56` varchar(255) DEFAULT NULL, `tb2_colunm57` varchar(255) DEFAULT NULL, `tb2_colunm58` varchar(255) DEFAULT NULL, `tb2_colunm59` varchar(255) DEFAULT NULL, `tb2_colunm60` varchar(255) DEFAULT NULL, `tb2_colunm61` varchar(255) DEFAULT NULL, `tb2_colunm62` varchar(255) DEFAULT NULL, `tb2_colunm63` varchar(255) DEFAULT NULL, `tb2_colunm64` varchar(255) DEFAULT NULL, `tb2_colunm65` varchar(255) DEFAULT NULL, `tb2_colunm66` varchar(255) DEFAULT NULL, `tb2_colunm67` varchar(255) DEFAULT NULL, `tb2_colunm68` varchar(255) DEFAULT NULL, `tb2_colunm69` varchar(255) DEFAULT NULL, `tb2_colunm70` varchar(255) DEFAULT NULL, `tb2_colunm71` varchar(255) DEFAULT NULL, `tb2_colunm72` varchar(255) DEFAULT NULL, `tb2_colunm73` varchar(255) DEFAULT NULL, `tb2_colunm74` varchar(255) DEFAULT NULL, `tb2_colunm75` varchar(255) DEFAULT NULL, `tb2_colunm76` varchar(255) DEFAULT NULL, `tb2_colunm77` varchar(255) DEFAULT NULL, `tb2_colunm78` varchar(255) DEFAULT NULL, `tb2_colunm79` varchar(255) DEFAULT NULL, `tb2_colunm80` varchar(255) DEFAULT NULL, `tb2_colunm81` varchar(255) DEFAULT NULL, `tb2_colunm82` varchar(255) DEFAULT NULL, `tb2_colunm83` varchar(255) DEFAULT NULL, `tb2_colunm84` varchar(255) DEFAULT NULL, `tb2_colunm85` varchar(255) DEFAULT NULL, `tb2_colunm86` varchar(255) DEFAULT NULL, `tb2_colunm87` varchar(255) DEFAULT NULL, `tb2_colunm88` varchar(255) DEFAULT NULL, `tb2_colunm89` varchar(255) DEFAULT NULL, `tb2_colunm90` varchar(255) DEFAULT NULL, `tb2_colunm91` varchar(255) DEFAULT NULL, `tb2_colunm92` varchar(255) DEFAULT NULL, `tb2_colunm93` varchar(255) DEFAULT NULL, `tb2_colunm94` varchar(255) DEFAULT NULL, `tb2_colunm95` varchar(255) DEFAULT NULL, `tb2_colunm96` varchar(255) DEFAULT NULL, `tb2_colunm97` varchar(255) DEFAULT NULL, `tb2_colunm98` varchar(255) DEFAULT NULL, `tb2_colunm99` varchar(255) DEFAULT NULL, `tb2_colunm100` varchar(255) DEFAULT NULL, PRIMARY KEY (`table2_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=79360 ; -- -------------------------------------------------------- -- -- Table structure for table `table3` -- CREATE TABLE IF NOT EXISTS `table3` ( `table3_id` int(255) unsigned NOT NULL AUTO_INCREMENT, `tb3_colunm1` varchar(1000) DEFAULT NULL, `tb3_colunm2` varchar(1000) DEFAULT NULL, `tb3_colunm3` varchar(1000) DEFAULT NULL, `tb3_colunm4` varchar(1000) DEFAULT NULL, `tb3_colunm5` varchar(1000) DEFAULT NULL, `tb3_colunm6` varchar(1000) DEFAULT NULL, `tb3_colunm7` varchar(1000) DEFAULT NULL, `tb3_colunm8` varchar(1000) DEFAULT NULL, `tb3_colunm9` varchar(1000) DEFAULT NULL, `tb3_colunm10` varchar(1000) DEFAULT NULL, `tb3_colunm11` varchar(1000) DEFAULT NULL, `tb3_colunm12` varchar(1000) DEFAULT NULL, `tb3_colunm13` varchar(1000) DEFAULT NULL, `tb3_colunm14` varchar(1000) DEFAULT NULL, `tb3_colunm15` varchar(1000) DEFAULT NULL, `tb3_colunm16` varchar(1000) DEFAULT NULL, `tb3_colunm17` varchar(1000) DEFAULT NULL, `tb3_colunm18` varchar(1000) DEFAULT NULL, `tb3_colunm19` varchar(1000) DEFAULT NULL, `tb3_colunm20` varchar(1000) DEFAULT NULL, `tb3_colunm21` varchar(1000) DEFAULT NULL, `tb3_colunm22` varchar(1000) DEFAULT NULL, `tb3_colunm23` varchar(1000) DEFAULT NULL, `tb3_colunm24` varchar(1000) DEFAULT NULL, `tb3_colunm25` varchar(1000) DEFAULT NULL, `tb3_colunm26` varchar(1000) DEFAULT NULL, `tb3_colunm27` varchar(1000) DEFAULT NULL, `tb3_colunm28` varchar(1000) DEFAULT NULL, `tb3_colunm29` varchar(1000) DEFAULT NULL, `tb3_colunm30` varchar(1000) DEFAULT NULL, PRIMARY KEY (`table3_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `table4` -- CREATE TABLE IF NOT EXISTS `table4` ( `table4_id` int(255) unsigned NOT NULL AUTO_INCREMENT, `tb4_colunm1` varchar(1000) DEFAULT NULL, `tb4_colunm2` varchar(1000) DEFAULT NULL, `tb4_colunm3` varchar(1000) DEFAULT NULL, `tb4_colunm4` varchar(1000) DEFAULT NULL, `tb4_colunm5` varchar(1000) DEFAULT NULL, `tb4_colunm6` varchar(1000) DEFAULT NULL, `tb4_colunm7` varchar(1000) DEFAULT NULL, `tb4_colunm8` varchar(1000) DEFAULT NULL, `tb4_colunm9` varchar(1000) DEFAULT NULL, `tb4_colunm10` varchar(1000) DEFAULT NULL, `tb4_colunm11` varchar(1000) DEFAULT NULL, `tb4_colunm12` varchar(1000) DEFAULT NULL, `tb4_colunm13` varchar(1000) DEFAULT NULL, `tb4_colunm14` varchar(1000) DEFAULT NULL, `tb4_colunm15` varchar(1000) DEFAULT NULL, `tb4_colunm16` varchar(1000) DEFAULT NULL, `tb4_colunm17` varchar(1000) DEFAULT NULL, `tb4_colunm18` varchar(1000) DEFAULT NULL, `tb4_colunm19` varchar(1000) DEFAULT NULL, `tb4_colunm20` varchar(1000) DEFAULT NULL, `tb4_colunm21` varchar(1000) DEFAULT NULL, `tb4_colunm22` varchar(1000) DEFAULT NULL, `tb4_colunm23` varchar(1000) DEFAULT NULL, `tb4_colunm24` varchar(1000) DEFAULT NULL, `tb4_colunm25` varchar(1000) DEFAULT NULL, `tb4_colunm26` varchar(1000) DEFAULT NULL, `tb4_colunm27` varchar(1000) DEFAULT NULL, `tb4_colunm28` varchar(1000) DEFAULT NULL, `tb4_colunm29` varchar(1000) DEFAULT NULL, `tb4_colunm30` varchar(1000) DEFAULT NULL, PRIMARY KEY (`table4_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `table5` -- CREATE TABLE IF NOT EXISTS `table5` ( `table5_id` int(255) unsigned NOT NULL AUTO_INCREMENT, `tb5_colunm1` varchar(1000) DEFAULT NULL, `tb5_colunm2` varchar(1000) DEFAULT NULL, `tb5_colunm3` varchar(1000) DEFAULT NULL, `tb5_colunm4` varchar(1000) DEFAULT NULL, `tb5_colunm5` varchar(1000) DEFAULT NULL, `tb5_colunm6` varchar(1000) DEFAULT NULL, `tb5_colunm7` varchar(1000) DEFAULT NULL, `tb5_colunm8` varchar(1000) DEFAULT NULL, `tb5_colunm9` varchar(1000) DEFAULT NULL, `tb5_colunm10` varchar(1000) DEFAULT NULL, `tb5_colunm11` varchar(1000) DEFAULT NULL, `tb5_colunm12` varchar(1000) DEFAULT NULL, `tb5_colunm13` varchar(1000) DEFAULT NULL, `tb5_colunm14` varchar(1000) DEFAULT NULL, `tb5_colunm15` varchar(1000) DEFAULT NULL, `tb5_colunm16` varchar(1000) DEFAULT NULL, `tb5_colunm17` varchar(1000) DEFAULT NULL, `tb5_colunm18` varchar(1000) DEFAULT NULL, `tb5_colunm19` varchar(1000) DEFAULT NULL, `tb5_colunm20` varchar(1000) DEFAULT NULL, `tb5_colunm21` varchar(1000) DEFAULT NULL, `tb5_colunm22` varchar(1000) DEFAULT NULL, `tb5_colunm23` varchar(1000) DEFAULT NULL, `tb5_colunm24` varchar(1000) DEFAULT NULL, `tb5_colunm25` varchar(1000) DEFAULT NULL, `tb5_colunm26` varchar(1000) DEFAULT NULL, `tb5_colunm27` varchar(1000) DEFAULT NULL, `tb5_colunm28` varchar(1000) DEFAULT NULL, `tb5_colunm29` varchar(1000) DEFAULT NULL, `tb5_colunm30` varchar(1000) DEFAULT NULL, PRIMARY KEY (`table5_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `users_tb` -- CREATE TABLE IF NOT EXISTS `users_tb` ( `user_id` int(255) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(1000) DEFAULT NULL, `password` varchar(1000) DEFAULT NULL, `email` varchar(1000) DEFAULT NULL, `group_id` varchar(1000) DEFAULT NULL, `firstname` varchar(255) DEFAULT NULL, `middlename` varchar(255) DEFAULT NULL, `lastname` varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `birthdate` varchar(255) DEFAULT NULL, `contactnumber` varchar(255) DEFAULT NULL, `civilstatus` varchar(255) DEFAULT NULL, `gender` varchar(255) DEFAULT NULL, `designation` varchar(255) DEFAULT NULL, `division` varchar(255) DEFAULT NULL, `details` varchar(1000) DEFAULT NULL, PRIMARY KEY (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=61 ;
# This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; -- --------------------------------------------------------------------- -- admision -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `admision`; CREATE TABLE `admision` ( `idadmision` INTEGER NOT NULL AUTO_INCREMENT, `idpaciente` INTEGER NOT NULL, `idmedico` INTEGER NOT NULL, `idcuarto` INTEGER NOT NULL, `admision_fechaadmision` DATETIME NOT NULL, `admision_fechasalida` DATETIME, `admision_diagnostico` TEXT, `admision_observaciones` TEXT, `admision_status` enum('pagada','no pagada','pendiente') DEFAULT 'pendiente', `admision_total` DECIMAL(10,2), `admision_pagadaen` DATETIME, `admision_tipodepago` enum('Efectivo','Tarjeta de debito','Tarjeta de credito','Cheque','No identificado','SPEI'), `admision_referenciapago` VARCHAR(45), `admision_facturada` TINYINT(1), `admision_registrada` TINYINT(1), PRIMARY KEY (`idadmision`), INDEX `idmedico` (`idmedico`), INDEX `idpaciente` (`idpaciente`), INDEX `idcuarto` (`idcuarto`), CONSTRAINT `idcuarto_admision` FOREIGN KEY (`idcuarto`) REFERENCES `cuarto` (`idcuarto`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idmedico_admision` FOREIGN KEY (`idmedico`) REFERENCES `medico` (`idmedico`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idpaciente_admision` FOREIGN KEY (`idpaciente`) REFERENCES `paciente` (`idpaciente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- admisionanticipo -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `admisionanticipo`; CREATE TABLE `admisionanticipo` ( `idadmisionanticipo` INTEGER NOT NULL AUTO_INCREMENT, `idadmision` INTEGER NOT NULL, `admisionanticipo_fecha` DATETIME NOT NULL, `admisionanticipo_cantidad` DECIMAL(10,2) NOT NULL, `admisionanticipo_nota` TEXT, `admisionanticipo_tipo` enum('Efectivo','Tarjeta de debito','Tarjeta de credito','Cheque','No identificado','SPEI') NOT NULL, PRIMARY KEY (`idadmisionanticipo`), INDEX `idadmision` (`idadmision`), CONSTRAINT `idadmision_admisionanticipo` FOREIGN KEY (`idadmision`) REFERENCES `admision` (`idadmision`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- articulo -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `articulo`; CREATE TABLE `articulo` ( `idarticulo` INTEGER NOT NULL AUTO_INCREMENT, `idproveedor` INTEGER NOT NULL, `idtipo` INTEGER NOT NULL, `articulo_nombre` VARCHAR(300), `articulo_descripcion` TEXT, PRIMARY KEY (`idarticulo`), INDEX `idtipo` (`idtipo`), CONSTRAINT `idtipo_articulo` FOREIGN KEY (`idtipo`) REFERENCES `tipo` (`idtipo`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- articulovariante -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `articulovariante`; CREATE TABLE `articulovariante` ( `idarticulovariante` INTEGER NOT NULL AUTO_INCREMENT, `idarticulo` INTEGER NOT NULL, `articulovariante_codigobarras` VARCHAR(100), `articulovariante_costo` DECIMAL(10,2), `articulovariante_costocaja` DECIMAL(10,2) NOT NULL, `articulovariante_precio` DECIMAL(10,2), `articulovariante_iva` enum('exento','0','16'), `articulovariante_imagen` TEXT, PRIMARY KEY (`idarticulovariante`), INDEX `idproducto` (`idarticulo`), CONSTRAINT `idproducto_articulovariante` FOREIGN KEY (`idarticulo`) REFERENCES `articulo` (`idarticulo`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- articulovariantereorden -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `articulovariantereorden`; CREATE TABLE `articulovariantereorden` ( `idarticulovariantereorden` INTEGER NOT NULL AUTO_INCREMENT, `idlugar` INTEGER NOT NULL, `idarticulovariante` INTEGER NOT NULL, `minimo` DECIMAL(10,2) NOT NULL, `maximo` DECIMAL(10,2) NOT NULL, `reorden` DECIMAL(10,2) NOT NULL, PRIMARY KEY (`idarticulovariantereorden`), INDEX `idlugar` (`idlugar`), INDEX `idarticulovariante` (`idarticulovariante`), CONSTRAINT `idarticulovariante_articulovariantereorden` FOREIGN KEY (`idarticulovariante`) REFERENCES `articulovariante` (`idarticulovariante`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idlugar_articulovariantereorden` FOREIGN KEY (`idlugar`) REFERENCES `lugar` (`idlugar`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- articulovariantevalor -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `articulovariantevalor`; CREATE TABLE `articulovariantevalor` ( `idarticulovariantevalor` INTEGER NOT NULL AUTO_INCREMENT, `idarticulo` INTEGER NOT NULL, `idpropiedad` INTEGER NOT NULL, `idpropiedadvalor` INTEGER NOT NULL, `idarticulovariante` INTEGER NOT NULL, PRIMARY KEY (`idarticulovariantevalor`), INDEX `idarticulo` (`idarticulo`), INDEX `idpropiedad` (`idpropiedad`), INDEX `idpropiedadvalor` (`idpropiedadvalor`), INDEX `idarticulovariante` (`idarticulovariante`), CONSTRAINT `idarticulo_articulovariantevalor` FOREIGN KEY (`idarticulo`) REFERENCES `articulo` (`idarticulo`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idarticulovariante_articulovariantevalor` FOREIGN KEY (`idarticulovariante`) REFERENCES `articulovariante` (`idarticulovariante`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idpropiedad_articulovariantevalor` FOREIGN KEY (`idpropiedad`) REFERENCES `propiedad` (`idpropiedad`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idpropiedadvalor_articulovariantevalor` FOREIGN KEY (`idpropiedadvalor`) REFERENCES `propiedadvalor` (`idpropiedadvalor`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- banco -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `banco`; CREATE TABLE `banco` ( `idbanco` INTEGER NOT NULL AUTO_INCREMENT, `idconceptobanco` INTEGER NOT NULL, `banco_fecha` VARCHAR(100) NOT NULL, `banco_tipomovimiento` enum('cargo','abono') NOT NULL, `banco_cantidad` DECIMAL(10,2) NOT NULL, `banco_balance` DECIMAL(10,2) DEFAULT 0.00 NOT NULL, `banco_comprobante` VARCHAR(255), `banco_nota` TEXT, PRIMARY KEY (`idbanco`), INDEX `idconceptobanco` (`idconceptobanco`), CONSTRAINT `idconceptobanco_banco` FOREIGN KEY (`idconceptobanco`) REFERENCES `conceptobanco` (`idbancotransaccion`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- cajachica -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `cajachica`; CREATE TABLE `cajachica` ( `idcajachica` INTEGER NOT NULL AUTO_INCREMENT, `idconceptocajachica` INTEGER NOT NULL, `cajachica_tipomovimiento` enum('cargo','abono') NOT NULL, `cajachica_cantidad` DECIMAL(10,2), `cajachica_fecha` DATE NOT NULL, `cajachica_balance` DECIMAL(10,2), `cajachica_comprobante` VARCHAR(45), `cajachica_nota` TEXT, `cajachica_pacientedoctor` VARCHAR(255), PRIMARY KEY (`idcajachica`), INDEX `idconceptocajachica` (`idconceptocajachica`), CONSTRAINT `idconceptocajachica_cajachica` FOREIGN KEY (`idconceptocajachica`) REFERENCES `conceptocajachica` (`idconceptocajachica`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- cargoadmision -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `cargoadmision`; CREATE TABLE `cargoadmision` ( `idcargoadmision` INTEGER NOT NULL AUTO_INCREMENT, `idadmision` INTEGER NOT NULL, `idlugarinventario` INTEGER, `idservicio` INTEGER, `cargoadmision_tipo` enum('articulo','servicio') NOT NULL, `cargoadmision_fecha` DATETIME NOT NULL, `cargoadmision_cantidad` DECIMAL(10,2) NOT NULL, `cargoadmision_monto` DECIMAL(10,2) NOT NULL, `cargoadmision_destino` enum('piso','quirofano','farmacia') NOT NULL, PRIMARY KEY (`idcargoadmision`), INDEX `idadmision` (`idadmision`), INDEX `idlugarinventario` (`idlugarinventario`), INDEX `idservicio` (`idservicio`), CONSTRAINT `idadmision_cargoadmision` FOREIGN KEY (`idadmision`) REFERENCES `admision` (`idadmision`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idlugarinventario_cargoadmision` FOREIGN KEY (`idlugarinventario`) REFERENCES `lugarinventario` (`idlugarinventario`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idservicio_cargoadmision` FOREIGN KEY (`idservicio`) REFERENCES `servicio` (`idservicio`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- cargoconsulta -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `cargoconsulta`; CREATE TABLE `cargoconsulta` ( `idcargoconsulta` INTEGER NOT NULL AUTO_INCREMENT, `idconsulta` INTEGER NOT NULL, `idlugarinventario` INTEGER, `idservicio` INTEGER, `cargoconsulta_tipo` enum('articulo','servicio') NOT NULL, `cargoconsulta_fecha` DATETIME NOT NULL, `cantidad` DECIMAL(10,2) NOT NULL, `monto` DECIMAL(10,2) NOT NULL, `cargoconsulta_destino` enum('piso','quirofano','farmacia') NOT NULL, PRIMARY KEY (`idcargoconsulta`), INDEX `idconsulta` (`idconsulta`), INDEX `idlugarinventario` (`idlugarinventario`), INDEX `idservicio` (`idservicio`), CONSTRAINT `idconsulta_cargoconsulta` FOREIGN KEY (`idconsulta`) REFERENCES `consulta` (`idconsulta`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idlugarinventario_cargoconsulta` FOREIGN KEY (`idlugarinventario`) REFERENCES `lugarinventario` (`idlugarinventario`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idservicio_cargoconsulta` FOREIGN KEY (`idservicio`) REFERENCES `servicio` (`idservicio`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- cargoventa -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `cargoventa`; CREATE TABLE `cargoventa` ( `idcargoventa` INTEGER NOT NULL AUTO_INCREMENT, `idventa` INTEGER NOT NULL, `idlugarinventario` INTEGER, `idservicio` INTEGER, `cargoventa_tipo` enum('articulo','servicio') NOT NULL, `cargoventa_fecha` DATETIME NOT NULL, `cantidad` DECIMAL(10,2) NOT NULL, `monto` DECIMAL(10,2) NOT NULL, PRIMARY KEY (`idcargoventa`), INDEX `idlugarinventario` (`idlugarinventario`), INDEX `idservicio` (`idservicio`), INDEX `idventa` (`idventa`), CONSTRAINT `idlugarinventario_cargoventa` FOREIGN KEY (`idlugarinventario`) REFERENCES `lugarinventario` (`idlugarinventario`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idservicio_cargoventa` FOREIGN KEY (`idservicio`) REFERENCES `servicio` (`idservicio`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idventa_cargoventa` FOREIGN KEY (`idventa`) REFERENCES `venta` (`idventa`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- cita -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `cita`; CREATE TABLE `cita` ( `idcita` INTEGER NOT NULL AUTO_INCREMENT, `idpaciente` INTEGER NOT NULL, `idmedico` INTEGER, `cita_fecha` DATE NOT NULL, `cita_hora` TIME NOT NULL, `cita_descripcion` TEXT NOT NULL, PRIMARY KEY (`idcita`), INDEX `idpaciente` (`idpaciente`), INDEX `idmedico` (`idmedico`), CONSTRAINT `idmedico_cita` FOREIGN KEY (`idmedico`) REFERENCES `medico` (`idmedico`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idpaciente_cita` FOREIGN KEY (`idpaciente`) REFERENCES `paciente` (`idpaciente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- conceptobanco -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `conceptobanco`; CREATE TABLE `conceptobanco` ( `idbancotransaccion` INTEGER NOT NULL AUTO_INCREMENT, `bancotransaccion_nombre` VARCHAR(255) NOT NULL, `bancotransaccion_descripcion` TEXT NOT NULL, PRIMARY KEY (`idbancotransaccion`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- conceptocajachica -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `conceptocajachica`; CREATE TABLE `conceptocajachica` ( `idconceptocajachica` INTEGER NOT NULL AUTO_INCREMENT, `conceptocajachica_nombre` VARCHAR(45) NOT NULL, `conceptocajachica_descripcion` TEXT NOT NULL, PRIMARY KEY (`idconceptocajachica`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- consulta -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `consulta`; CREATE TABLE `consulta` ( `idconsulta` INTEGER NOT NULL AUTO_INCREMENT, `idpaciente` INTEGER NOT NULL, `idmedico` INTEGER NOT NULL, `idconsultorio` INTEGER NOT NULL, `consulta_fecha` DATE NOT NULL, `consulta_hora` TIME NOT NULL, `consulta_diagnostico` TEXT, `consulta_observaciones` TEXT, `consulta_status` enum('pagada','no pagada','pendiente') DEFAULT 'pendiente', `consulta_total` DECIMAL(10,2), `consulta_tipodepago` enum('Efectivo','Tarjeta de debito','Tarjeta de credito','Cheque','No identificado','SPEI'), `consulta_referenciapago` VARCHAR(45), `consulta_facturada` TINYINT(1), `consulta_registrada` TINYINT(1), PRIMARY KEY (`idconsulta`), INDEX `idmedico` (`idmedico`), INDEX `idpaciente` (`idpaciente`), INDEX `idconsultorio` (`idconsultorio`), CONSTRAINT `idconsultorio_consulta` FOREIGN KEY (`idconsultorio`) REFERENCES `consultorio` (`idconsultorio`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idmedico_consulta` FOREIGN KEY (`idmedico`) REFERENCES `medico` (`idmedico`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idpaciente_consulta` FOREIGN KEY (`idpaciente`) REFERENCES `paciente` (`idpaciente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- consultaanticipo -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `consultaanticipo`; CREATE TABLE `consultaanticipo` ( `idconsultaanticipo` INTEGER NOT NULL AUTO_INCREMENT, `idconsulta` INTEGER NOT NULL, `consultaanticipo_fecha` DATETIME NOT NULL, `consultaanticipo_cantidad` DECIMAL(10,2) NOT NULL, `consultaanticipo_nota` TEXT, `consultaanticipo_tipo` enum('Efectivo','Tarjeta de debito','Tarjeta de credito','Cheque','No identificado','SPEI') NOT NULL, PRIMARY KEY (`idconsultaanticipo`), INDEX `idconsulta` (`idconsulta`), CONSTRAINT `idconsulta_consultaanticipo` FOREIGN KEY (`idconsulta`) REFERENCES `consulta` (`idconsulta`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- consultorio -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `consultorio`; CREATE TABLE `consultorio` ( `idconsultorio` INTEGER NOT NULL AUTO_INCREMENT, `consultorio_nombre` VARCHAR(300) NOT NULL, `consultorio_descripcion` TEXT NOT NULL, `consultorio_enuso` TINYINT(1) NOT NULL, `consultorio_extension` VARCHAR(45), PRIMARY KEY (`idconsultorio`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- cuarto -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `cuarto`; CREATE TABLE `cuarto` ( `idcuarto` INTEGER NOT NULL AUTO_INCREMENT, `cuarto_nombre` VARCHAR(300) NOT NULL, `cuarto_descripcion` TEXT NOT NULL, `cuarto_enuso` TINYINT(1) NOT NULL, `cuarto_extension` VARCHAR(45), PRIMARY KEY (`idcuarto`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- empleado -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `empleado`; CREATE TABLE `empleado` ( `idempleado` INTEGER NOT NULL AUTO_INCREMENT, `idrol` INTEGER NOT NULL, `empleado_nombre` VARCHAR(45) NOT NULL, `empleado_apellidopaterno` VARCHAR(45) NOT NULL, `empleado_apellidomaterno` VARCHAR(45) NOT NULL, `empleado_nombreusuario` VARCHAR(45) NOT NULL, `empleado_password` VARCHAR(45) NOT NULL, `empleado_email` VARCHAR(100) NOT NULL, `empleado_imagen` VARCHAR(255), PRIMARY KEY (`idempleado`), INDEX `idrol` (`idrol`), CONSTRAINT `idrol_empleado` FOREIGN KEY (`idrol`) REFERENCES `rol` (`idrol`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- empleadofacturacion -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `empleadofacturacion`; CREATE TABLE `empleadofacturacion` ( `idempleadofacturacion` INTEGER NOT NULL AUTO_INCREMENT, `idempleado` INTEGER NOT NULL, `empleadofacturacion_razonsocial` VARCHAR(45), `empleadofacturacion_rfc` VARCHAR(45), `empleadofacturacion_calle` VARCHAR(45), `empleadofacturacion_noexterior` VARCHAR(45), `empleadofacturacion_nointerior` VARCHAR(45), `empleadofacturacion_colonia` VARCHAR(45), `empleadofacturacion_ciudad` VARCHAR(45), `empleadofacturacion_estado` VARCHAR(45), `empleadofacturacion_pais` VARCHAR(45), `empleadofacturacion_codigopostal` VARCHAR(45), `empleadofacturacion_telefono` VARCHAR(45), `empleadofacturacion_email` VARCHAR(45), PRIMARY KEY (`idempleadofacturacion`), INDEX `idempleado` (`idempleado`), CONSTRAINT `idempleado_empleadofacturacion` FOREIGN KEY (`idempleado`) REFERENCES `empleado` (`idempleado`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- especialidad -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `especialidad`; CREATE TABLE `especialidad` ( `idespecialidad` INTEGER NOT NULL AUTO_INCREMENT, `especialidad_nombre` VARCHAR(45) NOT NULL, `especialidad_descripcion` VARCHAR(45), PRIMARY KEY (`idespecialidad`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- factura -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `factura`; CREATE TABLE `factura` ( `idfactura` INTEGER NOT NULL AUTO_INCREMENT, `idadmision` INTEGER, `idventa` INTEGER, `iddatosfacturacion` INTEGER NOT NULL, `idconsulta` INTEGER, `factura_url_xml` VARCHAR(45) NOT NULL, `factura_url_pdf` VARCHAR(45) NOT NULL, `factura_fecha` DATETIME NOT NULL, `factura_sellosat` TEXT NOT NULL, `factura_certificadosat` TEXT NOT NULL, `factura_cadenaoriginal` TEXT, `factura_cfdi` TEXT, `factura_mensaje` TEXT NOT NULL, `factura_qrcode` TEXT, `factura_tipodepago` enum('unico','parcial'), `factura_status` enum('creada','cancelada'), `factura_tipo` enum('ingreso','egreso'), PRIMARY KEY (`idfactura`), INDEX `iddatosfacturacion` (`iddatosfacturacion`), INDEX `idconsulta` (`idconsulta`), CONSTRAINT `idconsulta_factura` FOREIGN KEY (`idconsulta`) REFERENCES `consulta` (`idconsulta`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `iddatosfacturacion_factura` FOREIGN KEY (`iddatosfacturacion`) REFERENCES `pacientefacturacion` (`idpacientefacturacion`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- lugar -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `lugar`; CREATE TABLE `lugar` ( `idlugar` INTEGER NOT NULL AUTO_INCREMENT, `lugar_nombre` VARCHAR(45) NOT NULL, `lugar_descripcion` VARCHAR(45), PRIMARY KEY (`idlugar`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- lugarinventario -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `lugarinventario`; CREATE TABLE `lugarinventario` ( `idlugarinventario` INTEGER NOT NULL AUTO_INCREMENT, `idlugar` INTEGER NOT NULL, `idordencompradetalle` INTEGER NOT NULL, `lugarinventario_cantidad` DECIMAL(10,2) NOT NULL, PRIMARY KEY (`idlugarinventario`), INDEX `idlugar` (`idlugar`), INDEX `idordencompradetalle` (`idordencompradetalle`), CONSTRAINT `idlugar_lugarinventario` FOREIGN KEY (`idlugar`) REFERENCES `lugar` (`idlugar`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idordencompradetalle_lugarinventario` FOREIGN KEY (`idordencompradetalle`) REFERENCES `ordencompradetalle` (`idordencompradetalle`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- medico -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `medico`; CREATE TABLE `medico` ( `idmedico` INTEGER NOT NULL AUTO_INCREMENT, `idespecialidad` INTEGER NOT NULL, `medico_nombre` VARCHAR(45) NOT NULL, `medico_apellidopaterno` VARCHAR(45) NOT NULL, `medico_apellidomaterno` VARCHAR(45) NOT NULL, `medico_calle` VARCHAR(45), `medico_noexterior` VARCHAR(45), `medico_nointerior` VARCHAR(45), `medico_colonia` VARCHAR(45), `medico_codigopostal` VARCHAR(45), `medico_ciudad` VARCHAR(45), `medico_estado` VARCHAR(45), `medico_pais` VARCHAR(45), `medico_telefono` VARCHAR(45), `medico_telefonocelular` VARCHAR(45) NOT NULL, `medico_clave` VARCHAR(45), `medico_dgp` VARCHAR(45) NOT NULL, `medico_ssa` VARCHAR(45), `medico_ae` VARCHAR(45), `medico_fotografia` TEXT, `medico_perfilcompleto` TINYINT(1) NOT NULL, PRIMARY KEY (`idmedico`), INDEX `idespecialidad` (`idespecialidad`), CONSTRAINT `idespecialidad_medico` FOREIGN KEY (`idespecialidad`) REFERENCES `especialidad` (`idespecialidad`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- medicoespecialidad -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `medicoespecialidad`; CREATE TABLE `medicoespecialidad` ( `idmedicoespecialidad` INTEGER NOT NULL AUTO_INCREMENT, `idmedico` INTEGER NOT NULL, `idespecialidad` INTEGER NOT NULL, PRIMARY KEY (`idmedicoespecialidad`), INDEX `idmedico` (`idmedico`), INDEX `idespecialidad` (`idespecialidad`), CONSTRAINT `idespecialidad_medicoespecialidad` FOREIGN KEY (`idespecialidad`) REFERENCES `especialidad` (`idespecialidad`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idmedico_medicoespecialidad` FOREIGN KEY (`idmedico`) REFERENCES `medico` (`idmedico`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- medicofacturacion -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `medicofacturacion`; CREATE TABLE `medicofacturacion` ( `idmedicofacturacion` INTEGER NOT NULL AUTO_INCREMENT, `idmedico` INTEGER NOT NULL, `medicofacturacion_razonsocial` VARCHAR(45), `medicofacturacion_rfc` VARCHAR(45), `medicofacturacion_calle` VARCHAR(45), `medicofacturacion_noexterior` VARCHAR(45), `medicofacturacion_nointerior` VARCHAR(45), `medicofacturacion_colonia` VARCHAR(45), `medicofacturacion_ciudad` VARCHAR(45), `medicofacturacion_estado` VARCHAR(45), `medicofacturacion_pais` VARCHAR(45), `medicofacturacion_codigopostal` VARCHAR(45), `medicofacturacion_telefono` VARCHAR(45), `medicofacturacion_email` VARCHAR(45), PRIMARY KEY (`idmedicofacturacion`), INDEX `idmedico` (`idmedico`), CONSTRAINT `idmedico_medicofacturacion` FOREIGN KEY (`idmedico`) REFERENCES `medico` (`idmedico`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- modulo -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `modulo`; CREATE TABLE `modulo` ( `idmodulo` INTEGER NOT NULL AUTO_INCREMENT, `modulo_nombre` VARCHAR(250) NOT NULL, `modulo_descripcion` TEXT, PRIMARY KEY (`idmodulo`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- ordencompra -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `ordencompra`; CREATE TABLE `ordencompra` ( `idordencompra` INTEGER NOT NULL AUTO_INCREMENT, `idproveedor` INTEGER NOT NULL, `ordencompra_nofactura` VARCHAR(45) NOT NULL, `ordencompra_facturapdf` TEXT, `ordencompra_fecha` DATETIME NOT NULL, `ordencompra_importe` DECIMAL(10,2) NOT NULL, `ordencompra_status` enum('pagada','no pagada','inventario') NOT NULL, `ordencompra_fechaapagar` DATE NOT NULL, `ordencompra_iva` DECIMAL(10,5), PRIMARY KEY (`idordencompra`), INDEX `idproveedor` (`idproveedor`), CONSTRAINT `idproveedor_ordencompra` FOREIGN KEY (`idproveedor`) REFERENCES `proveedor` (`idproveedor`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- ordencompradetalle -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `ordencompradetalle`; CREATE TABLE `ordencompradetalle` ( `idordencompradetalle` INTEGER NOT NULL AUTO_INCREMENT, `idordencompra` INTEGER NOT NULL, `idarticulovariante` INTEGER NOT NULL, `ordencompradetalle_cantidad` DECIMAL(10,2), `ordencompradetalle_costo` DECIMAL(10,2), `ordencompradetalle_precio` DECIMAL(10,2), `ordencompradetalle_importe` DECIMAL(10,2), `ordencompradetalle_caducidad` DATE, `ordencompradetalle_productosporcaja` DECIMAL(10,2), `ordencompradetalle_costocaja` DECIMAL(10,2), `ordencompradetalle_iva` DECIMAL(10,2), `ordencompradetalle_ivaCero` DECIMAL(10,5), `ordencompradetalle_preciocaja` DECIMAL(10,5), PRIMARY KEY (`idordencompradetalle`), INDEX `irordencompra` (`idordencompra`), INDEX `idarticulovariante` (`idarticulovariante`), CONSTRAINT `idarticulovariante_ordencompradetalle` FOREIGN KEY (`idarticulovariante`) REFERENCES `articulovariante` (`idarticulovariante`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idordencompra_ordencompradetalle` FOREIGN KEY (`idordencompra`) REFERENCES `ordencompra` (`idordencompra`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- paciente -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `paciente`; CREATE TABLE `paciente` ( `idpaciente` INTEGER NOT NULL AUTO_INCREMENT, `paciente_nombre` VARCHAR(250) NOT NULL, `paciente_ap` VARCHAR(100) NOT NULL, `paciente_am` VARCHAR(45) NOT NULL, `paciente_calle` VARCHAR(45) NOT NULL, `paciente_noexterior` VARCHAR(45) NOT NULL, `paciente_nointerior` VARCHAR(45) NOT NULL, `paciente_colonia` VARCHAR(45) NOT NULL, `paciente_codigopostal` VARCHAR(5) NOT NULL, `paciente_ciudad` VARCHAR(45) NOT NULL, `paciente_estado` VARCHAR(45) NOT NULL, `paciente_pais` VARCHAR(45) NOT NULL, `paciente_telefono` VARCHAR(45) NOT NULL, `paciente_telefonocelular` VARCHAR(45) NOT NULL, `paciente_fechanacimiento` DATE NOT NULL, `paciente_sexo` enum('Masculino','Femenino') NOT NULL, `paciente_estadocivil` enum('Soltero(a)','Casado(a)','Divorciado(a)','Viudo(a)') NOT NULL, `paciente_ocupacion` VARCHAR(45) NOT NULL, `paciente_conyuge` VARCHAR(45) NOT NULL, `paciente_padre` VARCHAR(45) NOT NULL, `paciente_madre` VARCHAR(45) NOT NULL, `paciente_responsable` VARCHAR(45) NOT NULL, `paciente_telefonoresponsable` VARCHAR(45) NOT NULL, PRIMARY KEY (`idpaciente`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- pacientefacturacion -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `pacientefacturacion`; CREATE TABLE `pacientefacturacion` ( `idpacientefacturacion` INTEGER NOT NULL AUTO_INCREMENT, `idpaciente` INTEGER NOT NULL, `pacientefacturacion_razonsocial` VARCHAR(45), `pacientefacturacion_rfc` VARCHAR(45), `pacientefacturacion_calle` VARCHAR(45), `pacientefacturacion_noexterior` VARCHAR(45), `pacientefacturacion_nointerior` VARCHAR(45), `pacientefacturacion_colonia` VARCHAR(45), `pacientefacturacion_ciudad` VARCHAR(45), `pacientefacturacion_estado` VARCHAR(45), `pacientefacturacion_pais` VARCHAR(45), `pacientefacturacion_codigopostal` VARCHAR(45), `pacientefacturacion_telefono` VARCHAR(45), `pacientefacturacion_email` VARCHAR(45), PRIMARY KEY (`idpacientefacturacion`), INDEX `idpaciente` (`idpaciente`), CONSTRAINT `idpaciente_pacientefacturacion` FOREIGN KEY (`idpaciente`) REFERENCES `paciente` (`idpaciente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- propiedad -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `propiedad`; CREATE TABLE `propiedad` ( `idpropiedad` INTEGER NOT NULL AUTO_INCREMENT, `idarticulo` INTEGER NOT NULL, `propiedad_nombre` VARCHAR(100) NOT NULL, PRIMARY KEY (`idpropiedad`), INDEX `idarticulo` (`idarticulo`), CONSTRAINT `idarticulo_propiedad` FOREIGN KEY (`idarticulo`) REFERENCES `articulo` (`idarticulo`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- propiedadvalor -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `propiedadvalor`; CREATE TABLE `propiedadvalor` ( `idpropiedadvalor` INTEGER NOT NULL AUTO_INCREMENT, `idpropiedad` INTEGER NOT NULL, `idarticulo` INTEGER NOT NULL, `propiedadvalor_nombre` VARCHAR(45), PRIMARY KEY (`idpropiedadvalor`), INDEX `idarticulo` (`idarticulo`), INDEX `idpropiedad` (`idpropiedad`), CONSTRAINT `idarticulo_propiedadvalor` FOREIGN KEY (`idarticulo`) REFERENCES `articulo` (`idarticulo`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idpropiedad_propiedadvalor` FOREIGN KEY (`idpropiedad`) REFERENCES `propiedad` (`idpropiedad`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- proveedor -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `proveedor`; CREATE TABLE `proveedor` ( `idproveedor` INTEGER NOT NULL AUTO_INCREMENT, `proveedor_nombre` VARCHAR(45), `proveedor_contacto` VARCHAR(45), `proveedor_direccion` VARCHAR(45), `proveedor_direccion2` VARCHAR(45), `proveedor_colonia` VARCHAR(45), `proveedor_codigopostal` VARCHAR(45), `proveedor_ciudad` VARCHAR(45), `proveedor_estado` VARCHAR(45), `proveedor_pais` VARCHAR(45), `proveedor_email` VARCHAR(45), `proveedor_telefono` VARCHAR(45), `proveedor_telefonocelular` VARCHAR(45), `proveedor_fax` VARCHAR(45), `proveedor_rfc` VARCHAR(45), PRIMARY KEY (`idproveedor`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- referenciaabono -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `referenciaabono`; CREATE TABLE `referenciaabono` ( `idreferenciaabono` INTEGER NOT NULL AUTO_INCREMENT, `idbanco` INTEGER, `referenciaabono_archivo` TEXT, `referenciaabono_tipo` enum('consulta','admision','venta') NOT NULL, `referenciaabono_referencia` INTEGER NOT NULL, PRIMARY KEY (`idreferenciaabono`), INDEX `idbanco` (`idbanco`), CONSTRAINT `idbanco_referenciaabono` FOREIGN KEY (`idbanco`) REFERENCES `banco` (`idbanco`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- rol -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `rol`; CREATE TABLE `rol` ( `idrol` INTEGER NOT NULL AUTO_INCREMENT, `rol_nombre` VARCHAR(100) NOT NULL, `rol_descripcion` TEXT, PRIMARY KEY (`idrol`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- rolmodulo -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `rolmodulo`; CREATE TABLE `rolmodulo` ( `idrolmodulo` INTEGER NOT NULL AUTO_INCREMENT, `idrol` INTEGER NOT NULL, `idmodulo` INTEGER NOT NULL, PRIMARY KEY (`idrolmodulo`), INDEX `idrol` (`idrol`), INDEX `idmodulo` (`idmodulo`), CONSTRAINT `idmodulo_rolmodulo` FOREIGN KEY (`idmodulo`) REFERENCES `modulo` (`idmodulo`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idrol_rolmodulo` FOREIGN KEY (`idrol`) REFERENCES `rol` (`idrol`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- servicio -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `servicio`; CREATE TABLE `servicio` ( `idservicio` INTEGER NOT NULL AUTO_INCREMENT, `servicio_nombre` VARCHAR(300) NOT NULL, `servicio_descripcion` TEXT NOT NULL, `servicio_precio` DECIMAL(10,2) NOT NULL, `servicio_iva` enum('exento','0','16') NOT NULL, PRIMARY KEY (`idservicio`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- tipo -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `tipo`; CREATE TABLE `tipo` ( `idtipo` INTEGER NOT NULL AUTO_INCREMENT, `tipo_nombre` VARCHAR(300) NOT NULL, `tipo_descripcion` TEXT NOT NULL, PRIMARY KEY (`idtipo`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- traspaso -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `traspaso`; CREATE TABLE `traspaso` ( `idinventariolugar` INTEGER NOT NULL, `idordencompra` INTEGER NOT NULL, `idlugarremitente` INTEGER NOT NULL, `idlugardestinatario` INTEGER NOT NULL, `traspaso_fecha` DATETIME NOT NULL, `traspaso_status` enum('recibido','cancelado','en transito','no recibido') NOT NULL, PRIMARY KEY (`idinventariolugar`,`idlugarremitente`,`idlugardestinatario`), INDEX `idlugarremitente` (`idlugarremitente`), INDEX `idlugardestinantario` (`idlugardestinatario`), INDEX `idordencompra` (`idordencompra`), CONSTRAINT `idlugardestinatario_traspaso` FOREIGN KEY (`idlugardestinatario`) REFERENCES `lugar` (`idlugar`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idlugarremitente_traspaso` FOREIGN KEY (`idlugarremitente`) REFERENCES `lugar` (`idlugar`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idordencompra_traspaso` FOREIGN KEY (`idordencompra`) REFERENCES `ordencompra` (`idordencompra`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- traspasodetalles -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `traspasodetalles`; CREATE TABLE `traspasodetalles` ( `idtraspasodetalles` INTEGER NOT NULL AUTO_INCREMENT, `idtraspaso` INTEGER NOT NULL, `idlugarinventario` INTEGER NOT NULL, `traspaso_cantidad` DECIMAL(10,2) NOT NULL, PRIMARY KEY (`idtraspasodetalles`), INDEX `idtraspaso` (`idtraspaso`), INDEX `idlugarinventario` (`idlugarinventario`), CONSTRAINT `idlugarinventario_traspasodetalles` FOREIGN KEY (`idlugarinventario`) REFERENCES `lugarinventario` (`idlugarinventario`) ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT `idtraspaso_traspasodetalles` FOREIGN KEY (`idtraspaso`) REFERENCES `traspaso` (`idinventariolugar`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- udm -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `udm`; CREATE TABLE `udm` ( `idudm` INTEGER NOT NULL AUTO_INCREMENT, `udm_nombre` VARCHAR(45) NOT NULL, `udm_descripcion` VARCHAR(45), PRIMARY KEY (`idudm`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- venta -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `venta`; CREATE TABLE `venta` ( `idventa` INTEGER NOT NULL AUTO_INCREMENT, `idpaciente` INTEGER NOT NULL, `venta_fecha` DATETIME NOT NULL, `venta_tipodepago` enum('Efectivo','Tarjeta de debito','Tarjeta de credito','Cheque','No identificado','SPEI'), `venta_status` enum('pagada','no pagada','pendiente'), `venta_facturada` TINYINT(1), `venta_registrada` TINYINT(1), `venta_total` DECIMAL(10,2), `venta_referenciapago` VARCHAR(45), PRIMARY KEY (`idventa`), INDEX `idpaciente` (`idpaciente`), CONSTRAINT `idpaciente_venta` FOREIGN KEY (`idpaciente`) REFERENCES `paciente` (`idpaciente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1;
<reponame>decibel/extension_drop<filename>pgxntool/test/pgxntool/finish.sql SELECT finish(); \echo # TRANSACTION INTENTIONALLY LEFT OPEN!
-- @ : pooling peptide sequences ... DROP TABLE IF EXISTS mzIdentML_Peptide; CREATE TABLE mzIdentML_Peptide (UNIQUE(`index`)) ENGINE=MyISAM SELECT min(pep.index) as `index`, bp.sequence, bp.modifier FROM best_peptides_for_quantification bp JOIN peptide pep USING (sequence, modifier) GROUP BY bp.sequence, bp.modifier; -- @ : retrieving peptide sequences ... SELECT * FROM mzIdentML_Peptide;
<reponame>opengauss-mirror/Yat<filename>openGaussBase/testcase/SQL/DDL/Index/Opengauss_Function_DDL_Index_Case0255.sql<gh_stars>0 -- @testpoint: 验证各种分区表操作对全局分区表索引的破坏能力 -- create table test_ugi_255 drop table if exists test_ugi_255; create table test_ugi_255 ( c_id integer not null, c_name varchar(16) default 'omm', c_class varchar(20) not null ) partition by range(c_id) ( partition p1 values less than (1001), partition p2 values less than (2001), partition p3 values less than (3001), partition p4 values less than (4001), partition p5 values less than (5001), partition p6 values less than (6001) ); -- insert 6000 rows of data insert into test_ugi_255(c_id, c_class) select r, '1-1' from generate_series(1,1000) as r; insert into test_ugi_255(c_id, c_class) select r, '1-2' from generate_series(1001,2000) as r; insert into test_ugi_255(c_id, c_class) select r, '1-3' from generate_series(2001,3000) as r; insert into test_ugi_255(c_id, c_class) select r, '1-4' from generate_series(3001,4000) as r; insert into test_ugi_255(c_id, c_class) select r, '1-5' from generate_series(4001,5000) as r; insert into test_ugi_255(c_id, c_class) select r, '1-6' from generate_series(5001,6000) as r; select count(*) from test_ugi_255; -- create global index create index global_index_id_041 on test_ugi_255(c_id) global; -- add partition-can not destroy global_index_id_041 -- global_index_id_041 is usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- table test_ugi_255 have 6 partitions select t1.relname, partstrategy, boundaries from pg_partition t1, pg_class t2 where t1.parentid = t2.oid and t2.relname = 'test_ugi_255' and t1.parttype = 'p' order by relname; -- add partition p7 alter table test_ugi_255 add partition p7 values less than (7001); -- global_index_id_041 is usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- table test_ugi_255 have 7 partitions now select t1.relname, partstrategy, boundaries from pg_partition t1, pg_class t2 where t1.parentid = t2.oid and t2.relname = 'test_ugi_255' and t1.parttype = 'p' order by relname; -- drop partition -- drop partition p7 alter table test_ugi_255 drop partition p7; -- global_index_id_041 is unusable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- rebuild global_index_id_041 alter index global_index_id_041 rebuild; -- global_index_id_041 is usable now select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- table test_ugi_255 have 6 partitions now select t1.relname, partstrategy, boundaries from pg_partition t1, pg_class t2 where t1.parentid = t2.oid and t2.relname = 'test_ugi_255' and t1.parttype = 'p' order by relname; -- move partition-can not destroy global_index_id_041 -- create tablespace tableplace_255 drop tablespace if exists tableplace_255; create tablespace tableplace_255 relative location 'tablespace/tablespace_1'; -- move partition p6 to new tablespace alter table test_ugi_255 move partition p6 tablespace tableplace_255; -- global_index_id_041 is usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- exchange partition -- create table test_ugi_255_temp which is use for exchange drop table if exists test_ugi_255_temp; create table test_ugi_255_temp ( c_id integer not null, c_name varchar(16) default 'omm', c_class varchar(20) not null ); insert into test_ugi_255_temp(c_id, c_class) select r, '1-4' from generate_series(3001,3500) as r; -- inset 500 rows to test_ugi_255_temp select count(*) from test_ugi_255_temp; -- exchange partition p4 with table test_ugi_255_temp alter table test_ugi_255 exchange partition (p4) with table test_ugi_255_temp; -- global_index_id_041 is unusable now select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- table test_ugi_255 contains 5500 rows and table test_ugi_255_temp contains 1000 rows now select count(*) from test_ugi_255; select count(*) from test_ugi_255_temp; -- rebuild global_index_id_041 alter index global_index_id_041 rebuild; -- global_index_id_041 is usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; drop table test_ugi_255_temp; -- {enable|disable} row movement-can not destroy global_index_id_041 -- enable row movement alter table test_ugi_255 enable row movement; -- global_index_id_041 is usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- merge partition -- table test_ugi_255 have 6 partitions select t1.relname, partstrategy, boundaries from pg_partition t1, pg_class t2 where t1.parentid = t2.oid and t2.relname = 'test_ugi_255' and t1.parttype = 'p' order by relname; -- merge partition p2, p3 into partition p_merge alter table test_ugi_255 merge partitions p2, p3 into partition p_merge; -- global_index_id_041 is unusable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- rebuild global_index_id_041 alter index global_index_id_041 rebuild; -- global_index_id_041 is usable now select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- table test_ugi_255 have 5 partitions now select t1.relname, partstrategy, boundaries from pg_partition t1, pg_class t2 where t1.parentid = t2.oid and t2.relname = 'test_ugi_255' and t1.parttype = 'p' order by relname; -- split partition -- split partition p_merge into partition p2, p3 alter table test_ugi_255 split partition p_merge at (2001) into (partition p2, partition p3); -- global_index_id_041 is unusable now select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- rebuild global_index_id_041 alter index global_index_id_041 rebuild; -- global_index_id_041 is usable now select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- table test_ugi_255 have 6 partitions select t1.relname, partstrategy, boundaries from pg_partition t1, pg_class t2 where t1.parentid = t2.oid and t2.relname = 'test_ugi_255' and t1.parttype = 'p' order by relname; -- modify partition-can not destroy global_index_id_041 -- create local index local_index_id_041 create index local_index_id_041 on test_ugi_255(c_id, c_name) local; -- make local index local_index_id_041 unusable alter table test_ugi_255 modify partition p4 unusable local indexes; -- global_index_id_041 is still usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; drop index local_index_id_041; -- truncate partition -- truncate partition p6 alter table test_ugi_255 truncate partition p6; -- global_index_id_041 is unusable now select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- rebuild index global_index_id_041 alter index global_index_id_041 rebuild; -- global_index_id_041 is usable select c.relname, i.indisusable from pg_index i join pg_class c on i.indexrelid = c.oid where i.indrelid = 'test_ugi_255'::regclass order by c.relname; -- clean environment drop table test_ugi_255; drop tablespace tableplace_255;
<filename>cctv.sql -- phpMyAdmin SQL Dump -- version 4.2.12deb2+deb8u2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Feb 21, 2020 at 02:39 AM -- Server version: 5.5.60-0+deb8u1 -- PHP Version: 5.6.40-0+deb8u8 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: `cctv` -- -- -------------------------------------------------------- -- -- Table structure for table `brands` -- CREATE TABLE IF NOT EXISTS `brands` ( `id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `setting` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `menu_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `brands` -- INSERT INTO `brands` (`id`, `name`, `slug`, `setting`, `menu_id`, `created_at`, `updated_at`, `deleted_at`) VALUES (13, 'Honda Motor', 'honda-motor', 'utama', 0, '2020-02-09 16:48:11', '2020-02-09 16:53:57', NULL), (14, 'Yamaha', 'yamaha', 'utama', 0, '2020-02-09 16:48:23', '2020-02-09 16:48:23', NULL), (15, 'Kawasaki', 'kawasaki', 'utama', 0, '2020-02-09 16:48:41', '2020-02-09 16:48:41', NULL), (16, 'Suzuki', 'suzuki', 'utama', 0, '2020-02-09 16:48:55', '2020-02-09 16:48:55', NULL), (17, 'Toyota Mobil', 'toyota-mobil', 'utama', 0, '2020-02-09 16:50:00', '2020-02-09 16:54:59', NULL), (18, 'Honda Mobil', 'honda-mobil', 'utama', 0, '2020-02-09 16:54:14', '2020-02-09 16:54:14', NULL), (19, 'YZF-R15', 'yzf-150', 'submenu', 14, '2020-02-09 16:56:52', '2020-02-09 16:58:47', NULL), (20, 'Ninja 150', 'ninja-150', 'submenu', 15, '2020-02-09 16:58:25', '2020-02-09 16:58:25', NULL), (21, 'KLX 150', 'klx-150', 'submenu', 15, '2020-02-09 16:58:25', NULL, NULL), (22, 'Jazz', 'jazz', 'submenu', 18, '2020-02-14 17:26:17', '2020-02-14 17:26:17', NULL); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE IF NOT EXISTS `migrations` ( `id` int(10) unsigned NOT NULL, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2019_01_08_000002_create_users_table', 1), (2, '2019_01_08_100003_create_password_resets_table', 1), (7, '2019_12_15_123049_create_brands_table', 2), (10, '2019_12_19_092227_create_products_table', 5), (11, '2019_12_19_130004_create_reports_table', 6), (12, '2019_12_19_145928_create_testimonis_table', 6), (13, '2020_01_07_155415_create_stocks_table', 7), (14, '2020_01_07_161402_create_mixes_table', 8), (15, '2020_02_14_215332_create_materials_table', 9); -- -------------------------------------------------------- -- -- Table structure for table `mixes` -- CREATE TABLE IF NOT EXISTS `mixes` ( `id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `brand_id` int(11) unsigned NOT NULL, `sub_brand_id` int(11) NOT NULL, `recin` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `talk` int(11) NOT NULL, `katalis` int(11) NOT NULL, `met` int(11) NOT NULL, `dempul` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `mixes` -- INSERT INTO `mixes` (`id`, `name`, `brand_id`, `sub_brand_id`, `recin`, `talk`, `katalis`, `met`, `dempul`, `created_at`, `updated_at`, `deleted_at`) VALUES (13, 'Winglet', 15, 20, '100', 100, 100, 100, 1, '2020-02-14 02:10:47', NULL, NULL), (14, 'Body Kit Bemper', 18, 22, '100', 100, 100, 100, 1, '2020-02-14 05:26:42', NULL, NULL), (15, 'Cover Tangki', 15, 20, '100', 100, 100, 100, 1, '2020-02-15 03:16:08', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE IF NOT EXISTS `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) 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 `products` -- CREATE TABLE IF NOT EXISTS `products` ( `id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `brand_id` int(10) unsigned NOT NULL, `sub_brand_id` int(11) NOT NULL, `price` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci NOT NULL, `theme` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `photo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL, `noted` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `name`, `brand_id`, `sub_brand_id`, `price`, `description`, `theme`, `color`, `photo`, `status`, `noted`, `slug`, `created_at`, `updated_at`, `deleted_at`) VALUES (2, 'Winglet', 15, 20, '7000000', '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.', 'batik', '-', 'files/photo/20200214173531.jpg', 1, 'Order Minimal 5 pasang (seri) & berlaku kelipatannya', 'winglet', '2020-02-14 02:39:46', '2020-02-16 00:09:53', NULL), (3, 'Body Kit Bemper', 18, 22, '5000000', '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.', 'Costum', 'Costum', 'files/photo/20200214172821.jpg', 1, 'Order Minimal 5 pasang (seri) & berlaku kelipatannya', 'body-kit-bemper', '2020-02-14 05:26:50', '2020-02-16 00:09:13', NULL), (4, 'Cover Tangki', 15, 20, '7000000', '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.', '-', '-', 'files/photo/20200215155947.jpg', 1, 'Order Minimal 5 pasang (seri) & berlaku kelipatannya', 'cover-tangki', '2020-02-15 15:59:48', '2020-02-16 00:09:34', NULL), (5, 'Spoiler', 18, 22, '5000000', '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.', '-', '-', 'files/photo/20200215160431.jpg', 1, 'Order Minimal 5 pasang (seri) & berlaku kelipatannya', 'spoiler', '2020-02-15 16:04:31', '2020-02-16 00:10:13', NULL), (6, 'Side Kit Left', 18, 22, '2500000', 'Lorem ipsum dolor sit amet, consectetur adipiscing...', 'batik', '-', 'files/photo/20200215200229.jpg', 1, '', 'side-kit-left', '2020-02-15 18:24:41', '2020-02-16 00:08:20', NULL), (7, 'Side Kit Right', 18, 22, '5000000', 'Lorem ipsum dolor sit amet, consectetur adipiscing...', '-', '-', 'files/photo/20200215200518.jpg', 1, '', 'side-kit-right', '2020-02-15 20:05:18', '2020-02-16 00:08:02', NULL), (8, 'Spoiler', 14, 19, '5000000', 'Lorem ipsum dolor sit amet, consectetur adipiscing...', '-', '-', 'files/photo/20200215200826.jpg', 1, 'Order Minimal 5 pasang (seri) & berlaku kelipatannya', 'spoiler', '2020-02-15 20:08:26', '2020-02-16 00:07:38', NULL); -- -------------------------------------------------------- -- -- Table structure for table `reports` -- CREATE TABLE IF NOT EXISTS `reports` ( `id` int(10) unsigned NOT NULL, `ip_address` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `address` text COLLATE utf8mb4_unicode_ci NOT NULL, `product_id` int(10) unsigned NOT NULL, `product_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `city` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `qty` int(11) NOT NULL, `price` int(11) NOT NULL, `status` int(11) NOT NULL, `description` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `reports` -- INSERT INTO `reports` (`id`, `ip_address`, `name`, `email`, `phone`, `address`, `product_id`, `product_name`, `city`, `qty`, `price`, `status`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES (2, '10.0.2.2', '<NAME>', '<EMAIL>', '085726242220', 'jalan gejayan ctx 9a', 2, 'Winglet', 'yogayakarta', 1, 7000000, 0, 'tes', '2020-02-17 05:23:25', NULL, NULL), (4, '10.0.2.2', '<NAME>', '<EMAIL>', '085726242220', 'jalan gejayan ctx 9a', 2, 'Winglet', 'yogayakarta', 1, 7000000, 0, 'tes', '2020-02-18 10:59:45', NULL, NULL), (5, '10.0.2.2', '<NAME>', '<EMAIL>', '085726242220', 'jalan gejayan ctx 9a', 6, 'Side Kit Left', 'yogayakarta', 1, 2500000, 0, 'jjj', '2020-02-18 11:57:58', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `sliders` -- CREATE TABLE IF NOT EXISTS `sliders` ( `id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci NOT NULL, `products_id` int(10) unsigned NOT NULL, `status` int(11) NOT NULL, `foto` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `foto_crop` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sliders` -- INSERT INTO `sliders` (`id`, `name`, `description`, `products_id`, `status`, `foto`, `foto_crop`, `created_at`, `updated_at`, `deleted_at`, `slug`) VALUES (1, 'Kami Hadir Untuk Anda | H...', '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.', 2, 1, 'files/photo/20200217144450-ori-.jpg', 'files/photo/20200217144450-crop-.jpg', '2020-02-14 16:54:18', '2020-02-17 14:44:51', NULL, 'kami-hadir-untuk-anda-h-'), (2, 'Kami Hadir Untuk Anda | H...', '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.', 3, 1, 'files/photo/20200217144347-ori-.jpg', 'files/photo/20200217144347-crop-.jpg', '2020-02-14 16:55:04', '2020-02-17 14:43:47', NULL, 'kami-hadir-untuk-anda-h-'); -- -------------------------------------------------------- -- -- Table structure for table `stocks` -- CREATE TABLE IF NOT EXISTS `stocks` ( `id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `qty` int(11) NOT NULL, `size` int(11) NOT NULL, `total_size` int(11) NOT NULL, `other` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `stocks` -- INSERT INTO `stocks` (`id`, `name`, `qty`, `size`, `total_size`, `other`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'Recin', 1, 600, 150, 'liter', '2020-01-07 16:05:23', '2020-01-07 16:05:23', NULL), (2, 'Talk', 1, 600, 150, 'liter', '2020-01-07 16:07:10', '2020-01-07 16:07:10', NULL), (3, 'Katalis', 1, 600, 150, 'liter', '2020-01-07 16:09:16', '2020-01-07 16:10:17', NULL), (4, 'Met', 1, 300, 150, 'liter', '2020-01-07 16:09:35', '2020-01-07 16:09:35', NULL), (5, 'Dempul', 5, 1, 4, 'lembar', '2020-01-07 16:10:00', '2020-01-07 16:10:00', NULL), (11, 'Recin', 2, 600, 0, 'liter', '2020-02-17 10:54:18', '2020-02-17 10:54:18', NULL); -- -------------------------------------------------------- -- -- Table structure for table `stocks_details` -- CREATE TABLE IF NOT EXISTS `stocks_details` ( `id` int(11) unsigned NOT NULL, `name` varchar(100) NOT NULL, `total_size` int(11) NOT NULL, `other` varchar(50) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deteted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- Dumping data for table `stocks_details` -- INSERT INTO `stocks_details` (`id`, `name`, `total_size`, `other`, `created_at`, `updated_at`, `deteted_at`) VALUES (1, 'Dempul', 2, 'Lembar', '2020-02-17 04:00:21', NULL, NULL), (2, 'Met', 600, 'Liter', '2020-02-17 04:00:21', NULL, NULL), (3, 'Talk', 600, 'Liter', '2020-02-17 04:00:21', NULL, NULL), (4, 'Katalis', 600, 'Liter', '2020-02-17 04:00:21', NULL, NULL), (5, 'Recin', 1200, 'Liter', '2020-02-17 10:54:18', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `photo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `password`, `phone`, `photo`, `type`, `status`, `remember_token`, `created_at`, `updated_at`) VALUES (1, '<NAME>', '<EMAIL>', <PASSWORD>', '09988', 'files/photo/20200105041654.jpg', 'admin', 1, 'O98q7mjBLA0KxuS7v88sCGzIxxyKa2yjfJLRc0k1iUrwAfhCNCxAXPYFpFQi', '2019-11-27 14:33:47', '2020-01-05 04:16:54'); -- -- Indexes for dumped tables -- -- -- Indexes for table `brands` -- ALTER TABLE `brands` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `mixes` -- ALTER TABLE `mixes` ADD PRIMARY KEY (`id`), ADD KEY `brand_id` (`brand_id`), ADD KEY `sub_brand_id` (`sub_brand_id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD KEY `products_brand_id_foreign` (`brand_id`); -- -- Indexes for table `reports` -- ALTER TABLE `reports` ADD PRIMARY KEY (`id`), ADD KEY `reports_product_id_foreign` (`product_id`); -- -- Indexes for table `sliders` -- ALTER TABLE `sliders` ADD PRIMARY KEY (`id`), ADD KEY `products_id` (`products_id`); -- -- Indexes for table `stocks` -- ALTER TABLE `stocks` ADD PRIMARY KEY (`id`); -- -- Indexes for table `stocks_details` -- ALTER TABLE `stocks_details` ADD PRIMARY KEY (`id`); -- -- 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 `brands` -- ALTER TABLE `brands` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=23; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `mixes` -- ALTER TABLE `mixes` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `reports` -- ALTER TABLE `reports` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `sliders` -- ALTER TABLE `sliders` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `stocks` -- ALTER TABLE `stocks` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `stocks_details` -- ALTER TABLE `stocks_details` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- Constraints for dumped tables -- -- -- Constraints for table `mixes` -- ALTER TABLE `mixes` ADD CONSTRAINT `mixes_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `products` -- ALTER TABLE `products` ADD CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `reports` -- ALTER TABLE `reports` ADD CONSTRAINT `reports_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `sliders` -- ALTER TABLE `sliders` ADD CONSTRAINT `sliders_product_id_foreign` FOREIGN KEY (`products_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; /*!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 */;
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- 主機: localhost -- 產生時間: 2018 年 01 月 18 日 15:10 -- 伺服器版本: 5.5.56-MariaDB -- PHP 版本: 7.0.25 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 */; -- -- 資料庫: `admin` -- -- -------------------------------------------------------- -- -- 資料表結構 `car` -- CREATE TABLE `car` ( `sn` int(11) NOT NULL, `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '車種', `code` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '車牌', `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `price` int(11) NOT NULL COMMENT '公定價', `checkday` date NOT NULL COMMENT '驗車日', `license` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '行照', `rem` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `car` -- INSERT INTO `car` (`sn`, `type`, `code`, `name`, `price`, `checkday`, `license`, `rem`) VALUES (1, '1', '842-XX', '福壽大巴三排椅36座', 10000, '2018-07-01', '', ''), (2, '1', 'A5-349', 'Isuzu/五十鈴22座椅', 8000, '2018-01-14', '', 'Isuzu/五十鈴 中型遊覽車\r\n豪華三排座椅'), (3, '1', '207-RR', '現代中巴21座', 8500, '0000-00-00', '', 'VW/福斯-九人座'), (4, '1', '209-EE', '福壽大巴三排椅35座', 10000, '0000-00-00', '', '現代 STAREX (2015新款車)'), (5, '1', '769-MM', '大巴四排椅45座', 9000, '0000-00-00', '', 'TOYOTA ALTIS (2015新款車)'), (6, '4', 'RAP-3027', 'TOYOTA VIOS', 2000, '2018-06-29', '', 'TOYOTA VIOS (2015新款車)'), (7, '4', 'RAP-3037', 'TOYOTA ALTIS', 2500, '2018-06-29', '', ''); -- -------------------------------------------------------- -- -- 資料表結構 `car_expend` -- CREATE TABLE `car_expend` ( `sn` int(11) NOT NULL, `gid` int(11) NOT NULL COMMENT 'car_id', `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '項目:油,稅,保養,維修,保險', `price` int(11) NOT NULL COMMENT '金額', `rem` text COLLATE utf8_unicode_ci NOT NULL COMMENT '備註', `date` date NOT NULL COMMENT '日期', `create_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `car_expend` -- INSERT INTO `car_expend` (`sn`, `gid`, `name`, `type`, `price`, `rem`, `date`, `create_at`) VALUES (1, 1, '中油', '0', 1000, '先代墊', '2017-10-12', '2017-10-12 23:39:50'), (2, 1, '換輪胎', '3', 15000, '前面兩顆', '2017-10-12', '2017-10-12 23:40:14'); -- -------------------------------------------------------- -- -- 資料表結構 `customer` -- CREATE TABLE `customer` ( `sn` int(11) NOT NULL, `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '客種: 散客,公司', `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '統編', `address` varchar(70) COLLATE utf8_unicode_ci NOT NULL COMMENT '地址', `tel` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '電話', `phone` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '手機', `birthday` date NOT NULL COMMENT '生日', `rem` text COLLATE utf8_unicode_ci NOT NULL COMMENT '備註', `create_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `customer` -- INSERT INTO `customer` (`sn`, `type`, `name`, `code`, `address`, `tel`, `phone`, `birthday`, `rem`, `create_at`) VALUES (1, '1', '陳美莉', '', '', '', '0912345678', '0000-00-00', '', '2017-10-12 23:43:06'), (2, '2', '台東大民宿', '22233344', '', '07 23456789', '099663366', '0000-00-00', '開三聯', '2017-10-12 23:44:02'), (3, '3', 'XX大飯店', '', '', '', '23', '0000-00-00', '', '2018-01-18 15:07:22'), (4, '4', '旅行社1', '', '', '', '123453', '0000-00-00', '', '2018-01-18 15:07:32'), (5, '5', '同業2', '', '', '', '324t5', '0000-00-00', '', '2018-01-18 15:07:45'); -- -------------------------------------------------------- -- -- 資料表結構 `driver` -- CREATE TABLE `driver` ( `sn` int(11) NOT NULL, `id` varchar(11) COLLATE utf8_unicode_ci NOT NULL COMMENT '身分證號', `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `tel` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '電話', `phone` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '手機', `bank_account` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '銀行帳戶', `address` varchar(70) COLLATE utf8_unicode_ci NOT NULL COMMENT '戶籍地', `address2` varchar(70) COLLATE utf8_unicode_ci NOT NULL COMMENT '通訊地', `pay` int(11) NOT NULL COMMENT '薪資', `license` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '身分證資料', `rem` text COLLATE utf8_unicode_ci NOT NULL COMMENT '備註' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `driver` -- INSERT INTO `driver` (`sn`, `id`, `name`, `tel`, `phone`, `bank_account`, `address`, `address2`, `pay`, `license`, `rem`) VALUES (1, 'A123456789', '高天祥', '22334578', '0987654321', '', '', '', 0, '2471912.jpg', ''), (2, 'A123123123', '勇伯', '987897987', '0987987987', '', '', '', 0, '', ''); -- -------------------------------------------------------- -- -- 資料表結構 `log` -- CREATE TABLE `log` ( `sn` int(11) NOT NULL, `params` text COLLATE utf8_unicode_ci NOT NULL, `IP` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `log` -- INSERT INTO `log` (`sn`, `params`, `IP`, `datetime`) VALUES (1, '[]', '172.16.31.10', '2017-10-20 09:57:15'), (5, '{\"account\":\"ryan\",\"password\":\"<PASSWORD>\"}', '172.16.31.10', '2017-11-07 06:29:44'), (6, '{\"account\":\"A123456789\",\"password\":\"<PASSWORD>`\"}', '192.168.3.11', '2017-11-20 13:43:12'), (7, '{\"account\":\"admin\",\"password\":\"<PASSWORD>\"}', '172.16.31.10', '2017-11-28 14:44:14'), (8, '{\"account\":\"admin\",\"password\":\"<PASSWORD>\"}', '172.16.31.10', '2017-12-19 10:46:41'), (9, '{\"account\":\"\",\"password\":\"\"}', '172.16.31.10', '2018-01-18 04:16:37'); -- -------------------------------------------------------- -- -- 資料表結構 `order_car` -- CREATE TABLE `order_car` ( `sn` int(11) NOT NULL, `customer_id` int(11) NOT NULL, `location` varchar(30) COLLATE utf8_unicode_ci NOT NULL COMMENT '地點', `order_date` date NOT NULL COMMENT '下單日期', `adate` date NOT NULL COMMENT '啟用日', `bdate` date NOT NULL COMMENT '最後使用日', `atime` time NOT NULL, `btime` time NOT NULL, `org_price` int(11) DEFAULT NULL COMMENT '原價', `special_price` int(11) DEFAULT NULL COMMENT '訂單價', `invoice` int(11) NOT NULL COMMENT '發票: 二聯 三聯 免開?', `rem` text COLLATE utf8_unicode_ci COMMENT '訂單備註', `rem_customer` text COLLATE utf8_unicode_ci COMMENT '客戶備註', `rem_drive` text COLLATE utf8_unicode_ci COMMENT '司機備註', `create_at` datetime NOT NULL, `status` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '狀態: 報價未收 , 已收款 , 已開發票, ,結案 , 取消', `readytogo` tinyint(4) NOT NULL COMMENT '確認派車 0 off . 1 go 影響範圍 司機可看到 ' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `order_car` -- INSERT INTO `order_car` (`sn`, `customer_id`, `location`, `order_date`, `adate`, `bdate`, `atime`, `btime`, `org_price`, `special_price`, `invoice`, `rem`, `rem_customer`, `rem_drive`, `create_at`, `status`, `readytogo`) VALUES (1, 1, '', '2017-10-12', '2018-01-29', '2018-01-31', '00:00:00', '00:00:00', NULL, NULL, 2, '訂單備註\r\n訂單備註', NULL, NULL, '2017-10-12 23:45:11', '1', 1), (2, 2, '', '2017-10-12', '2017-12-05', '2017-12-12', '00:00:00', '00:00:00', 0, 222, 2, '11', '22', '3\r\n3\r\n3', '2017-10-12 23:50:06', '2', 1), (4, 1, '台東機場', '2017-11-03', '2017-11-20', '2017-11-20', '03:30:00', '06:30:00', 4500, 4400, 3, 'test1', 'test2', 'test3', '2017-11-03 00:29:08', '1', 0), (5, 1, '台東碼頭', '2017-11-03', '2017-12-01', '2017-12-02', '00:00:00', '00:00:00', 0, 15000, 3, '訂單備註\r\n訂單備註\r\n訂單備註\r\na', '給客戶的備註\r\n給客戶的備註\r\n給客戶的備註\r\nbbb', '要收5000\r\n要收5000\r\n要收5000ccc', '2017-11-03 01:18:21', '2', 0), (6, 1, '', '2017-12-13', '2017-12-26', '2017-12-26', '00:00:00', '00:00:00', 20500, 205, 2, '', '', '', '2017-12-13 15:55:22', '1', 0), (7, 2, '台東碼頭', '2017-12-13', '2017-12-27', '2017-12-27', '00:00:00', '00:00:00', 20500, 205, 2, '', '', '', '2017-12-13 16:28:17', '1', 0), (8, 1, '', '2017-12-13', '2017-12-26', '2017-12-30', '00:00:00', '00:00:00', 22500, 225, 2, '', '', '', '2017-12-13 16:53:53', '1', 0), (9, 1, '台東火車站', '2017-12-13', '2017-12-26', '2017-12-26', '00:00:00', '00:00:00', 2000, 2, 2, '', '', '', '2017-12-13 16:54:59', '1', 1), (10, 2, '台東機場', '2017-12-13', '2017-12-24', '2017-12-24', '00:00:00', '00:00:00', 15000, 1200, 2, '', '', '', '2017-12-13 17:04:33', '1', 0), (11, 2, '', '2017-12-18', '2017-12-10', '2017-12-12', '00:00:00', '00:00:00', 97500, 999999, 2, 'aaaa', 'vvbbb', 'cccc', '2017-12-18 18:29:55', '1', 0), (12, 2, '', '2018-01-11', '2018-01-09', '2018-01-10', '00:00:00', '00:00:00', 36000, 33333, 2, '', '', '', '2018-01-11 16:26:18', '1', 1), (13, 1, '', '2018-01-12', '2018-01-01', '2018-01-31', '00:00:00', '00:00:00', 620000, 500000, 2, '', '', '', '2018-01-12 15:41:50', '1', 1); -- -------------------------------------------------------- -- -- 資料表結構 `order_car_d` -- CREATE TABLE `order_car_d` ( `sn` int(11) NOT NULL, `order_id` int(11) NOT NULL COMMENT '訂單編號', `date` date NOT NULL COMMENT '訂單日期區間轉成每日一筆', `car_id` int(11) NOT NULL, `driver_id` int(11) NOT NULL, `driver_reply` text COLLATE utf8_unicode_ci NOT NULL COMMENT '司機回報', `reply_time` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='訂單細部資料 依造每日可轉派車單'; -- -- 資料表的匯出資料 `order_car_d` -- INSERT INTO `order_car_d` (`sn`, `order_id`, `date`, `car_id`, `driver_id`, `driver_reply`, `reply_time`) VALUES (3, 2, '2017-11-17', 1, 1, 'feawewfAA\n天祥reply', '2017-11-20 21:58:47'), (5, 4, '2017-11-20', 4, 0, 'afwfew\n;lkjhgfds', '2017-11-07 14:34:27'), (6, 5, '2017-11-27', 2, 2, '回報測試', '0000-00-00 00:00:00'), (7, 5, '2017-11-28', 2, 2, 'feowpjwep\nwfaeojpe\npefapojepw\n', '2017-11-04 10:46:16'), (8, 6, '2017-12-26', 1, 1, '', '0000-00-00 00:00:00'), (9, 6, '2017-12-26', 2, 2, '', '0000-00-00 00:00:00'), (10, 7, '2017-12-27', 1, 1, '', '0000-00-00 00:00:00'), (11, 7, '2017-12-27', 2, 2, '', '0000-00-00 00:00:00'), (12, 7, '2017-12-27', 5, 0, '', '0000-00-00 00:00:00'), (13, 8, '2017-12-26', 5, 0, '', '0000-00-00 00:00:00'), (14, 8, '2017-12-26', 6, 0, '', '0000-00-00 00:00:00'), (15, 8, '2017-12-27', 5, 0, '', '0000-00-00 00:00:00'), (16, 8, '2017-12-27', 6, 0, '', '0000-00-00 00:00:00'), (17, 8, '2017-12-28', 5, 0, '', '0000-00-00 00:00:00'), (18, 8, '2017-12-28', 6, 0, '', '0000-00-00 00:00:00'), (19, 8, '2017-12-29', 5, 0, '', '0000-00-00 00:00:00'), (20, 8, '2017-12-29', 6, 0, '', '0000-00-00 00:00:00'), (21, 8, '2017-12-30', 5, 0, '', '0000-00-00 00:00:00'), (22, 8, '2017-12-30', 6, 0, '', '0000-00-00 00:00:00'), (23, 9, '2017-12-26', 6, 0, '', '0000-00-00 00:00:00'), (210, 10, '2017-12-24', 2, 1, '', '0000-00-00 00:00:00'), (211, 10, '2017-12-24', 6, 0, '', '0000-00-00 00:00:00'), (212, 10, '2017-12-24', 3, 2, '', '0000-00-00 00:00:00'), (213, 11, '2017-12-10', 3, 0, '', '0000-00-00 00:00:00'), (214, 11, '2017-12-10', 1, 0, '', '0000-00-00 00:00:00'), (215, 11, '2017-12-10', 3, 0, '', '0000-00-00 00:00:00'), (216, 11, '2017-12-10', 2, 0, '', '0000-00-00 00:00:00'), (217, 11, '2017-12-10', 4, 0, '', '0000-00-00 00:00:00'), (218, 11, '2017-12-11', 3, 0, '', '0000-00-00 00:00:00'), (219, 11, '2017-12-11', 1, 0, '', '0000-00-00 00:00:00'), (220, 11, '2017-12-11', 3, 0, '', '0000-00-00 00:00:00'), (221, 11, '2017-12-11', 2, 0, '', '0000-00-00 00:00:00'), (222, 11, '2017-12-11', 4, 0, '', '0000-00-00 00:00:00'), (223, 11, '2017-12-12', 3, 0, '', '0000-00-00 00:00:00'), (224, 11, '2017-12-12', 1, 0, '', '0000-00-00 00:00:00'), (225, 11, '2017-12-12', 3, 0, '', '0000-00-00 00:00:00'), (226, 11, '2017-12-12', 2, 0, '', '0000-00-00 00:00:00'), (227, 11, '2017-12-12', 4, 0, '', '0000-00-00 00:00:00'), (228, 12, '2018-01-09', 2, 1, '', '0000-00-00 00:00:00'), (229, 12, '2018-01-09', 4, 0, '', '0000-00-00 00:00:00'), (230, 12, '2018-01-10', 2, 1, '', '0000-00-00 00:00:00'), (231, 12, '2018-01-10', 4, 0, '', '0000-00-00 00:00:00'), (418, 13, '2018-01-01', 1, 1, '', '0000-00-00 00:00:00'), (419, 13, '2018-01-01', 2, 2, '', '0000-00-00 00:00:00'), (420, 13, '2018-01-01', 6, 0, '', '0000-00-00 00:00:00'), (421, 13, '2018-01-02', 1, 1, '', '0000-00-00 00:00:00'), (422, 13, '2018-01-02', 2, 2, '', '0000-00-00 00:00:00'), (423, 13, '2018-01-02', 6, 0, '', '0000-00-00 00:00:00'), (424, 13, '2018-01-03', 1, 1, '', '0000-00-00 00:00:00'), (425, 13, '2018-01-03', 2, 2, '', '0000-00-00 00:00:00'), (426, 13, '2018-01-03', 6, 0, '', '0000-00-00 00:00:00'), (427, 13, '2018-01-04', 1, 1, '', '0000-00-00 00:00:00'), (428, 13, '2018-01-04', 2, 2, '', '0000-00-00 00:00:00'), (429, 13, '2018-01-04', 6, 0, '', '0000-00-00 00:00:00'), (430, 13, '2018-01-05', 1, 1, '', '0000-00-00 00:00:00'), (431, 13, '2018-01-05', 2, 2, '', '0000-00-00 00:00:00'), (432, 13, '2018-01-05', 6, 0, '', '0000-00-00 00:00:00'), (433, 13, '2018-01-06', 1, 1, '', '0000-00-00 00:00:00'), (434, 13, '2018-01-06', 2, 2, '', '0000-00-00 00:00:00'), (435, 13, '2018-01-06', 6, 0, '', '0000-00-00 00:00:00'), (436, 13, '2018-01-07', 1, 1, '', '0000-00-00 00:00:00'), (437, 13, '2018-01-07', 2, 2, '', '0000-00-00 00:00:00'), (438, 13, '2018-01-07', 6, 0, '', '0000-00-00 00:00:00'), (439, 13, '2018-01-08', 1, 1, '', '0000-00-00 00:00:00'), (440, 13, '2018-01-08', 2, 2, '', '0000-00-00 00:00:00'), (441, 13, '2018-01-08', 6, 0, '', '0000-00-00 00:00:00'), (442, 13, '2018-01-09', 1, 1, '', '0000-00-00 00:00:00'), (443, 13, '2018-01-09', 2, 2, '', '0000-00-00 00:00:00'), (444, 13, '2018-01-09', 6, 0, '', '0000-00-00 00:00:00'), (445, 13, '2018-01-10', 1, 1, '', '0000-00-00 00:00:00'), (446, 13, '2018-01-10', 2, 2, '', '0000-00-00 00:00:00'), (447, 13, '2018-01-10', 6, 0, '', '0000-00-00 00:00:00'), (448, 13, '2018-01-11', 1, 1, '', '0000-00-00 00:00:00'), (449, 13, '2018-01-11', 2, 2, '', '0000-00-00 00:00:00'), (450, 13, '2018-01-11', 6, 0, '', '0000-00-00 00:00:00'), (451, 13, '2018-01-12', 1, 1, '', '0000-00-00 00:00:00'), (452, 13, '2018-01-12', 2, 2, '', '0000-00-00 00:00:00'), (453, 13, '2018-01-12', 6, 0, '', '0000-00-00 00:00:00'), (454, 13, '2018-01-13', 1, 1, '', '0000-00-00 00:00:00'), (455, 13, '2018-01-13', 2, 2, '', '0000-00-00 00:00:00'), (456, 13, '2018-01-13', 6, 0, '', '0000-00-00 00:00:00'), (457, 13, '2018-01-14', 1, 1, '', '0000-00-00 00:00:00'), (458, 13, '2018-01-14', 2, 2, '', '0000-00-00 00:00:00'), (459, 13, '2018-01-14', 6, 0, '', '0000-00-00 00:00:00'), (460, 13, '2018-01-15', 1, 1, '', '0000-00-00 00:00:00'), (461, 13, '2018-01-15', 2, 2, '', '0000-00-00 00:00:00'), (462, 13, '2018-01-15', 6, 0, '', '0000-00-00 00:00:00'), (463, 13, '2018-01-16', 1, 1, '', '0000-00-00 00:00:00'), (464, 13, '2018-01-16', 2, 2, '', '0000-00-00 00:00:00'), (465, 13, '2018-01-16', 6, 0, '', '0000-00-00 00:00:00'), (466, 13, '2018-01-17', 1, 1, '', '0000-00-00 00:00:00'), (467, 13, '2018-01-17', 2, 2, '', '0000-00-00 00:00:00'), (468, 13, '2018-01-17', 6, 0, '', '0000-00-00 00:00:00'), (469, 13, '2018-01-18', 1, 1, '', '0000-00-00 00:00:00'), (470, 13, '2018-01-18', 2, 2, '', '0000-00-00 00:00:00'), (471, 13, '2018-01-18', 6, 0, '', '0000-00-00 00:00:00'), (472, 13, '2018-01-19', 1, 1, '', '0000-00-00 00:00:00'), (473, 13, '2018-01-19', 2, 2, '', '0000-00-00 00:00:00'), (474, 13, '2018-01-19', 6, 0, '', '0000-00-00 00:00:00'), (475, 13, '2018-01-20', 1, 1, '', '0000-00-00 00:00:00'), (476, 13, '2018-01-20', 2, 2, '', '0000-00-00 00:00:00'), (477, 13, '2018-01-20', 6, 0, '', '0000-00-00 00:00:00'), (478, 13, '2018-01-21', 1, 1, '', '0000-00-00 00:00:00'), (479, 13, '2018-01-21', 2, 2, '', '0000-00-00 00:00:00'), (480, 13, '2018-01-21', 6, 0, '', '0000-00-00 00:00:00'), (481, 13, '2018-01-22', 1, 1, '', '0000-00-00 00:00:00'), (482, 13, '2018-01-22', 2, 2, '', '0000-00-00 00:00:00'), (483, 13, '2018-01-22', 6, 0, '', '0000-00-00 00:00:00'), (484, 13, '2018-01-23', 1, 1, '', '0000-00-00 00:00:00'), (485, 13, '2018-01-23', 2, 2, '', '0000-00-00 00:00:00'), (486, 13, '2018-01-23', 6, 0, '', '0000-00-00 00:00:00'), (487, 13, '2018-01-24', 1, 1, '', '0000-00-00 00:00:00'), (488, 13, '2018-01-24', 2, 2, '', '0000-00-00 00:00:00'), (489, 13, '2018-01-24', 6, 0, '', '0000-00-00 00:00:00'), (490, 13, '2018-01-25', 1, 1, '', '0000-00-00 00:00:00'), (491, 13, '2018-01-25', 2, 2, '', '0000-00-00 00:00:00'), (492, 13, '2018-01-25', 6, 0, '', '0000-00-00 00:00:00'), (493, 13, '2018-01-26', 1, 1, '', '0000-00-00 00:00:00'), (494, 13, '2018-01-26', 2, 2, '', '0000-00-00 00:00:00'), (495, 13, '2018-01-26', 6, 0, '', '0000-00-00 00:00:00'), (496, 13, '2018-01-27', 1, 1, '', '0000-00-00 00:00:00'), (497, 13, '2018-01-27', 2, 2, '', '0000-00-00 00:00:00'), (498, 13, '2018-01-27', 6, 0, '', '0000-00-00 00:00:00'), (499, 13, '2018-01-28', 1, 1, '', '0000-00-00 00:00:00'), (500, 13, '2018-01-28', 2, 2, '', '0000-00-00 00:00:00'), (501, 13, '2018-01-28', 6, 0, '', '0000-00-00 00:00:00'), (502, 13, '2018-01-29', 1, 1, '', '0000-00-00 00:00:00'), (503, 13, '2018-01-29', 2, 2, '', '0000-00-00 00:00:00'), (504, 13, '2018-01-29', 6, 0, '', '0000-00-00 00:00:00'), (505, 13, '2018-01-30', 1, 1, '', '0000-00-00 00:00:00'), (506, 13, '2018-01-30', 2, 2, '', '0000-00-00 00:00:00'), (507, 13, '2018-01-30', 6, 0, '', '0000-00-00 00:00:00'), (508, 13, '2018-01-31', 1, 1, '', '0000-00-00 00:00:00'), (509, 13, '2018-01-31', 2, 2, '', '0000-00-00 00:00:00'), (510, 13, '2018-01-31', 6, 0, '', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- 資料表結構 `peer_order` -- CREATE TABLE `peer_order` ( `sn` int(11) NOT NULL, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `detail` text COLLATE utf8_unicode_ci NOT NULL, `customer_id` int(11) NOT NULL, `order_date` date NOT NULL COMMENT '下單日期', `adate` date NOT NULL COMMENT '啟用日', `bdate` date NOT NULL COMMENT '最後使用日', `atime` time NOT NULL, `btime` time NOT NULL, `cost` int(11) DEFAULT NULL COMMENT '成本', `price` int(11) DEFAULT NULL COMMENT '報價', `invoice` int(11) NOT NULL COMMENT '發票: 二聯 三聯 免開?', `rem` text COLLATE utf8_unicode_ci COMMENT '訂單備註', `create_at` datetime NOT NULL, `status` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '狀態: 報價未收 , 已收款 , 已開發票, ,結案 , 取消' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `peer_order` -- INSERT INTO `peer_order` (`sn`, `name`, `detail`, `customer_id`, `order_date`, `adate`, `bdate`, `atime`, `btime`, `cost`, `price`, `invoice`, `rem`, `create_at`, `status`) VALUES (1, ' 訂單名稱 訂單名稱2', '代訂內容代訂內容\r\n代訂內容2', 1, '2018-01-18', '2018-02-13', '2018-03-03', '00:00:00', '00:00:00', 111112, 222222, 3, '訂單備註\r\n訂單備註2', '2018-01-18 13:40:26', '2'); -- -------------------------------------------------------- -- -- 資料表結構 `user` -- CREATE TABLE `user` ( `sn` int(11) NOT NULL, `account` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `permission` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 資料表的匯出資料 `user` -- INSERT INTO `user` (`sn`, `account`, `password`, `permission`) VALUES (1, 'timo', '74185', '[\"car\",\"car_expend\",\"driver\",\"customer\",\"order_car\",\"calendar\",\"permission\",\"report\"]'), (2, 'aaa', 'bbb', '[\"car\",\"car_expend\",\"driver\",\"customer\",\"order_car\",\"calendar\",\"report\"]'); -- -- 已匯出資料表的索引 -- -- -- 資料表索引 `car` -- ALTER TABLE `car` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `car_expend` -- ALTER TABLE `car_expend` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `customer` -- ALTER TABLE `customer` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `driver` -- ALTER TABLE `driver` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `log` -- ALTER TABLE `log` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `order_car` -- ALTER TABLE `order_car` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `order_car_d` -- ALTER TABLE `order_car_d` ADD PRIMARY KEY (`sn`), ADD KEY `order_id` (`order_id`); -- -- 資料表索引 `peer_order` -- ALTER TABLE `peer_order` ADD PRIMARY KEY (`sn`); -- -- 資料表索引 `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`sn`); -- -- 在匯出的資料表使用 AUTO_INCREMENT -- -- -- 使用資料表 AUTO_INCREMENT `car` -- ALTER TABLE `car` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- 使用資料表 AUTO_INCREMENT `car_expend` -- ALTER TABLE `car_expend` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- 使用資料表 AUTO_INCREMENT `customer` -- ALTER TABLE `customer` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- 使用資料表 AUTO_INCREMENT `driver` -- ALTER TABLE `driver` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- 使用資料表 AUTO_INCREMENT `log` -- ALTER TABLE `log` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- 使用資料表 AUTO_INCREMENT `order_car` -- ALTER TABLE `order_car` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- 使用資料表 AUTO_INCREMENT `order_car_d` -- ALTER TABLE `order_car_d` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=511; -- -- 使用資料表 AUTO_INCREMENT `peer_order` -- ALTER TABLE `peer_order` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- 使用資料表 AUTO_INCREMENT `user` -- ALTER TABLE `user` MODIFY `sn` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;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 */;
create or replace package body com_fos_progress_bar as -- ============================================================================= -- -- FOS = FOEX Open Source (fos.world), by FOEX GmbH, Austria (www.foex.at) -- -- This plug-in provides you with a highly customisable Progress Bar item. -- -- License: MIT -- -- GitHub: https://github.com/foex-open-source/fos-progress-bar -- -- ============================================================================= G_IN_ERROR_HANDLING_CALLBACK boolean := false; -------------------------------------------------------------------------------- -- private function to include the apex error handling function, if one is -- defined on application or page level -------------------------------------------------------------------------------- function error_function_callback ( p_error in apex_error.t_error ) return apex_error.t_error_result is c_cr constant varchar2(1) := chr(10); l_error_handling_function apex_application_pages.error_handling_function%type; l_statement varchar2(32767); l_result apex_error.t_error_result; procedure log_value ( p_attribute_name in varchar2 , p_old_value in varchar2 , p_new_value in varchar2 ) is begin if p_old_value <> p_new_value or (p_old_value is not null and p_new_value is null) or (p_old_value is null and p_new_value is not null) then apex_debug.info('%s: %s', p_attribute_name, p_new_value); end if; end log_value; begin if not g_in_error_handling_callback then g_in_error_handling_callback := true; begin select /*+ result_cache */ coalesce(p.error_handling_function, f.error_handling_function) into l_error_handling_function from apex_applications f, apex_application_pages p where f.application_id = apex_application.g_flow_id and p.application_id (+) = f.application_id and p.page_id (+) = apex_application.g_flow_step_id; exception when no_data_found then null; end; end if; if l_error_handling_function is not null then l_statement := 'declare'||c_cr|| 'l_error apex_error.t_error;'||c_cr|| 'begin'||c_cr|| 'l_error := apex_error.g_error;'||c_cr|| 'apex_error.g_error_result := '||l_error_handling_function||' ('||c_cr|| 'p_error => l_error );'||c_cr|| 'end;'; apex_error.g_error := p_error; begin apex_exec.execute_plsql(l_statement); exception when others then apex_debug.error('error in error handler: %s', sqlerrm); apex_debug.error('backtrace: %s', dbms_utility.format_error_backtrace); end; l_result := apex_error.g_error_result; if l_result.message is null then l_result.message := nvl(l_result.message, p_error.message); l_result.additional_info := nvl(l_result.additional_info, p_error.additional_info); l_result.display_location := nvl(l_result.display_location, p_error.display_location); l_result.page_item_name := nvl(l_result.page_item_name, p_error.page_item_name); l_result.column_alias := nvl(l_result.column_alias, p_error.column_alias); end if; else l_result.message := p_error.message; l_result.additional_info := p_error.additional_info; l_result.display_location := p_error.display_location; l_result.page_item_name := p_error.page_item_name; l_result.column_alias := p_error.column_alias; end if; if l_result.message = l_result.additional_info then l_result.additional_info := null; end if; g_in_error_handling_callback := false; return l_result; exception when others then l_result.message := 'custom apex error handling function failed !!'; l_result.additional_info := null; l_result.display_location := apex_error.c_on_error_page; l_result.page_item_name := null; l_result.column_alias := null; g_in_error_handling_callback := false; return l_result; end error_function_callback; procedure render ( p_item in apex_plugin.t_item , p_plugin in apex_plugin.t_plugin , p_param in apex_plugin.t_item_render_param , p_result in out nocopy apex_plugin.t_item_render_result ) as -- native attributes l_name p_item.name%type := apex_escape.html(p_item.name); l_value p_param.value%type := apex_escape.html(p_param.value); l_classes p_item.element_css_classes%type := p_item.element_css_classes; l_ajax_id varchar2(1000) := apex_plugin.get_ajax_identifier; l_value_arr apex_t_varchar2; l_pct_val varchar2(100); l_msg_val varchar2(100); -- width and height l_width_esc p_item.element_width%type := p_item.element_width; l_height p_item.element_height%type := p_item.element_height; -- init js l_init_js_fn varchar2(32767) := nvl(apex_plugin_util.replace_substitutions(p_item.init_javascript_code), 'undefined'); -- attributes l_default_message p_plugin.attribute_01%type := apex_escape.html(p_plugin.attribute_01); l_shape p_item.attribute_01%type := p_item.attribute_01; l_custom_shape p_item.attribute_02%type := p_item.attribute_02; l_style p_item.attribute_03%type := p_item.attribute_03; l_color p_item.attribute_04%type := p_item.attribute_04; l_trail_color p_item.attribute_05%type := p_item.attribute_05; l_end_color p_item.attribute_06%type := p_item.attribute_06; l_animation p_item.attribute_07%type := p_item.attribute_07; l_duration p_item.attribute_08%type := p_item.attribute_08; l_show_pct p_item.attribute_09%type := p_item.attribute_09; l_show_msg p_item.attribute_10%type := p_item.attribute_10; l_options p_item.attribute_11%type := p_item.attribute_11; l_refresh_interval p_item.attribute_12%type := p_item.attribute_12; l_repetitions p_item.attribute_13%type := p_item.attribute_13; l_num_of_reps p_item.attribute_14%type := p_item.attribute_14; l_items_to_submit p_item.attribute_15%type := apex_plugin_util.page_item_names_to_jquery(p_item.attribute_15); -- local variables FOS_PRB_CLS constant varchar2(100) := 'fos-prb-container'; FOS_PRB_WRAPPER constant varchar2(100) := 'fos-prb-wrapper' ; FOS_PRB_MSG_CLS constant varchar2(100) := 'fos-prb-msg'; l_msg_markup constant varchar2(1000) := '<span class="'|| FOS_PRB_MSG_CLS ||'"></span>'; l_add_timer boolean := instr(l_options, 'add-timer') > 0; l_queue_animations boolean := instr(l_options, 'queue-animations') > 0; begin --debug if apex_application.g_debug then apex_plugin_util.debug_item_render ( p_plugin => p_plugin , p_item => p_item , p_param => p_param ); end if; -- get the values if instr(l_value,':') > 0 then l_value_arr := apex_string.split(l_value,':'); l_pct_val := l_value_arr(1); l_msg_val := l_value_arr(2); else l_pct_val := l_value; end if; -- create the markup sys.htp.p('<div class="'|| FOS_PRB_CLS ||' '|| l_classes || '" ' || p_item.element_attributes ||'>'); -- container open sys.htp.p(' <input id="'|| l_name ||'" type="hidden" name="'|| l_name ||'" value="'|| l_value ||'"></input>'); -- input element sys.htp.p(' <div class="'||FOS_PRB_WRAPPER||' fos-prb-'|| l_shape ||'" id="'|| l_name||'_WRAPPER">'); -- wrapper if l_custom_shape is not null then sys.htp.p(replace(replace(l_custom_shape, '#TRAIL_COLOR#', l_trail_color), '#COLOR#', l_color)); end if; sys.htp.p(' </div>'); -- wrapper close sys.htp.p('</div>'); -- container close apex_json.initialize_clob_output; apex_json.open_object; apex_json.write('ajaxId' , l_ajax_id ); apex_json.write('name' , l_name ); apex_json.write('pctVal' , l_pct_val ); apex_json.write('msgVal' , l_msg_val ); apex_json.write('shape' , l_shape ); apex_json.write('style' , l_style ); apex_json.write('color' , l_color ); apex_json.write('endColor' , l_end_color ); apex_json.write('trailColor' , l_trail_color ); apex_json.write('animation' , l_animation ); apex_json.write('duration' , l_duration ); apex_json.write('showPct' , l_show_pct ); apex_json.write('showMsg' , l_show_msg ); apex_json.write('msg' , l_default_message ); apex_json.write('customShape' , l_custom_shape ); apex_json.write('addTimer' , l_add_timer ); apex_json.write('refreshInterval' , l_refresh_interval ); apex_json.write('repetitions' , l_repetitions ); apex_json.write('numOfReps' , l_num_of_reps ); apex_json.write('itemsToSubmit' , l_items_to_submit ); apex_json.write('queueAnimations' , l_queue_animations ); apex_json.close_object; apex_javascript.add_onload_code('FOS.item.progressBar.init('|| apex_json.get_clob_output ||', '|| l_init_js_fn ||')'); apex_json.free_output; end render; procedure ajax ( p_item in apex_plugin.t_item , p_plugin in apex_plugin.t_plugin , p_param in apex_plugin.t_item_ajax_param , p_result in out nocopy apex_plugin.t_item_ajax_result ) as -- error handling l_apex_error apex_error.t_error; l_result apex_error.t_error_result; l_message varchar2(32000); l_name p_item.name%type := apex_escape.html(p_item.name); l_advanced_setting p_item.attribute_10%type := p_item.attribute_10; l_page_item_to_submit p_item.attribute_11%type := p_item.attribute_11; l_context apex_exec.t_context; l_source_type varchar2(1000); l_source varchar2(32000); l_value_arr apex_t_varchar2; l_value varchar2(1000); l_msg_value varchar2(1000); l_pct_value varchar2(1000); begin --debug if apex_application.g_debug then apex_plugin_util.debug_item ( p_plugin => p_plugin , p_item => p_item ); end if; -- get the page source select item_source_type , item_source into l_source_type , l_source from apex_application_page_items where application_id = :APP_ID and page_id = :APP_PAGE_ID and item_name = l_name ; if instr(l_source_type, 'SQL Query') > 0 then l_context := apex_exec.open_query_context ( p_location => apex_exec.c_location_local_db , p_sql_query => l_source ); while apex_exec.next_row(l_context) loop l_value := apex_exec.get_varchar2(l_context,1); end loop; apex_exec.close(l_context); elsif instr(l_source_type,'PL/SQL Expression') > 0 or l_source_type = 'Expression' then l_value := apex_plugin_util.get_plsql_expression_result ( p_plsql_expression => l_source ); elsif instr(l_source_type, 'PL/SQL Function') > 0 or l_source_type = 'Function' then l_value := apex_plugin_util.get_plsql_function_result ( p_plsql_function => l_source ); -- @todo: support SQL Expressions +20.1 end if; -- get the values if instr(l_value,':') > 0 then l_value_arr := apex_string.split(l_value,':'); l_pct_value := l_value_arr(1); l_msg_value := l_value_arr(2); else l_pct_value := l_value; end if; apex_json.open_object; apex_json.write('success' , true ); apex_json.write('value' , l_pct_value ); apex_json.write('msg' , l_msg_value , true); apex_json.close_object; exception when others then apex_exec.close(l_context); l_message := coalesce(apex_application.g_x01, sqlerrm); l_message := replace(l_message, '#SQLCODE#', apex_escape.html_attribute(sqlcode)); l_message := replace(l_message, '#SQLERRM#', apex_escape.html_attribute(sqlerrm)); l_message := replace(l_message, '#SQLERRM_TEXT#', apex_escape.html_attribute(substr(sqlerrm, instr(sqlerrm, ':')+1))); apex_json.initialize_output; l_apex_error.message := l_message; l_apex_error.ora_sqlcode := sqlcode; l_apex_error.ora_sqlerrm := sqlerrm; l_apex_error.error_backtrace := dbms_utility.format_error_backtrace; l_result := error_function_callback(l_apex_error); apex_json.open_object; apex_json.write('status' , 'error'); apex_json.write('success', false); apex_json.write('errMsg' , SQLERRM); apex_json.close_object; sys.htp.p(apex_json.get_clob_output); apex_json.free_output; end ajax; end; /
-- MySQL dump 10.13 Distrib 8.0.21, for Linux (x86_64) -- -- Host: localhost Database: Travel -- ------------------------------------------------------ -- Server version 8.0.21-0ubuntu0.20.04.4 /*!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 utf8mb4 */; /*!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 `admin` -- DROP TABLE IF EXISTS `admin`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `admin` ( `id_admin` varchar(5) NOT NULL, `nama_admin` varchar(20) DEFAULT NULL, `username` varchar(20) DEFAULT NULL, `password` varchar(20) DEFAULT NULL, PRIMARY KEY (`id_admin`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `admin` -- LOCK TABLES `admin` WRITE; /*!40000 ALTER TABLE `admin` DISABLE KEYS */; INSERT INTO `admin` VALUES ('1','Garr','garr','garr'); /*!40000 ALTER TABLE `admin` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `comentar` -- DROP TABLE IF EXISTS `comentar`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `comentar` ( `id_comentar` varchar(5) NOT NULL, `comentar` text, `nama` varchar(50) DEFAULT NULL, `date` date DEFAULT NULL, `id_destination` varchar(5) DEFAULT NULL, PRIMARY KEY (`id_comentar`), KEY `id_destination` (`id_destination`), CONSTRAINT `comentar_ibfk_2` FOREIGN KEY (`id_destination`) REFERENCES `destinations` (`id_destination`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `comentar` -- LOCK TABLES `comentar` WRITE; /*!40000 ALTER TABLE `comentar` DISABLE KEYS */; INSERT INTO `comentar` VALUES ('2efZ','Give that man a cookie','<NAME>','2020-10-13','tJ7M'),('6hxR','mantap','Jokowi','2020-10-13','CMNX'),('90Ah','pinus mantap','PinusMan','2020-10-13','ypME'),('9k5F','bagus sekali','mr. bean','2020-10-13','tJ7M'),('B4GI','wkwk','suep','2020-10-13','tJ7M'),('cumB','yes nice','Nice','2020-10-13','O0TT'),('g5Ex','i love this place so much','<NAME>','2020-10-13','tJ7M'),('I7cJ','<NAME>','PinusGirls','2020-10-13','ypME'),('i7S5','gege','suep','2020-10-13','O0TT'),('kfoj','gege','suep','2020-10-13','O0TT'),('lOtT','mrbpois','bois','2020-10-13','9EFH'),('mest','gege','suep','2020-10-13','O0TT'),('o2Hd','gege','suep','2020-10-13','O0TT'),('r8SF','i didn\'t realize that this place is mars, Lmao ','<NAME>','2020-10-13','9EFH'),('tys9','yes','Admin','2020-10-13','ypME'),('U9EE','gege','suep','2020-10-13','O0TT'),('vbNi','','','2020-10-13','ypME'),('yAnv','gege','suep','2020-10-13','O0TT'),('znwV','i love bean cuz bean is bean','MrBean','2020-10-13','CMNX'); /*!40000 ALTER TABLE `comentar` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `destinations` -- DROP TABLE IF EXISTS `destinations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `destinations` ( `id_destination` varchar(5) NOT NULL, `nama_dest` varchar(80) DEFAULT NULL, `urlgmaps` text, `image` varchar(50) DEFAULT NULL, `artikel` text, PRIMARY KEY (`id_destination`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `destinations` -- LOCK TABLES `destinations` WRITE; /*!40000 ALTER TABLE `destinations` DISABLE KEYS */; INSERT INTO `destinations` VALUES ('9EFH','Pantai Parangtritis','https://goo.gl/maps/4E99SJbTYsfU59qP7','1600059357.png','Parangtritis merupakan objek wisata yang cukup terkenal di Yogyakarta selain objek pantai lainnya seperti Samas, Baron, Kukup, Krakal dan Glagah. Parangtritis mempunyai keunikan pemandangan yang tidak terdapat pada objek wisata lainnya yaitu selain ombak yang besar juga adanya gunung-gunung pasir di sekitar pantai, yang biasa disebut gumuk. Objek wisata ini sudah dikelola oleh pihak Pemkab Bantul dengan cukup baik, mulai dari fasilitas penginapan maupun pasar yang menjajakan souvenir khas Parangtritis.\r\nDi Parangtritis ada juga ATV, kereta kuda dan kuda yang dapat disewa untuk menyusuri pantai dari timur ke barat. Selain itu Parangtritis juga merupakan tempat untuk olahraga udara/aeromodeling.'),('CMNX','Titik Nol Kilometer Jogja','https://goo.gl/maps/m9FCitnMbu4rDh6V9','index1.jpeg','Titik Nol Kilometer merupakan tempat dimulainya segala kisah tentang Jogja. Di persimpangan ini kamu bisa melihat Jogja secara utuh. Jogja yang semrawut namun syahdu, Jogja yang modern namun tetap mempertahanan lokalitas, Jogja yang mencipta kelu juga rindu.'),('O0TT','Candi Borobudur','https://goo.gl/maps/gbw78hUjgoGJ6BuCA','1601437588.png','Borobudur adalah candi atau kuil Buddha terbesar di dunia, sekaligus salah satu monumen Buddha terbesar di dunia. Monumen ini terdiri atas enam teras berbentuk bujur sangkar yang di atasnya terdapat tiga pelataran melingkar, pada dindingnya dihiasi dengan 2.672 panel relief dan aslinya terdapat 504 arca Buddha.'),('tJ7M','Candi Prambanan','https://goo.gl/maps/PMXGy7vb8Vnks14W8','1602552377.png','Candi Prambanan ini adalah termasuk Situs Warisan Dunia UNESCO, candi Hindu terbesar di Indonesia, sekaligus salah satu candi terindah di Asia Tenggara. Arsitektur bangunan ini berbentuk tinggi dan ramping sesuai dengan arsitektur Hindu pada umumnya dengan candi Siwa sebagai candi utama memiliki ketinggian mencapai 47 meter menjulang di tengah kompleks gugusan candi-candi yang lebih kecil.[3] Sebagai salah satu candi termegah di Asia Tenggara, candi Prambanan menjadi daya tarik kunjungan wisatawan dari seluruh dunia.'),('ypME','Hutan Pinus Mangunan','https://goo.gl/maps/aZQozH3pqvnQ45Yw9','mangunan2.jpeg','Hutan Pinus Mangunan yang indah'); /*!40000 ALTER TABLE `destinations` 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 2020-10-31 9:37:32
<reponame>luckymeluckyyes/CodeIgniter9 -- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 14, 2019 at 06:56 AM -- Server version: 10.1.34-MariaDB -- PHP Version: 7.2.7 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 */; -- -- Database: `login` -- -- -------------------------------------------------------- -- -- Table structure for table `demo` -- CREATE TABLE `demo` ( `id` int(11) NOT NULL, `category` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `demo` -- INSERT INTO `demo` (`id`, `category`) VALUES (1, 'hdpe'), (2, 'sprinkle'), (3, 'irrigation'), (4, 'spray'); -- -------------------------------------------------------- -- -- Table structure for table `files` -- CREATE TABLE `files` ( `id` int(11) NOT NULL, `file_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `uploaded_on` datetime NOT NULL, `status` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1' COMMENT '1=Active, 0=Inactive' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `files` -- INSERT INTO `files` (`id`, `file_name`, `uploaded_on`, `status`) VALUES (1, '_downloadfiles_wallpapers_1920_1200_think_different_apple_3927.jpg', '2018-12-27 06:07:04', '1'), (2, '00ac5eeb1ecfb504ec080fc9d4d06084.jpg', '2018-12-27 06:07:08', '0'), (3, '0ac6cf98c70afc53c1cd48de361f54d8.jpg', '2018-12-27 06:07:15', '0'), (4, '33.jpg', '2018-12-27 06:07:30', '0'), (5, '331.jpg', '2018-12-27 06:07:54', '0'), (6, '332.jpg', '2018-12-27 06:08:01', '0'), (7, '333.jpg', '2018-12-27 06:12:35', '0'), (8, '334.jpg', '2018-12-27 06:13:16', '1'), (9, '335.jpg', '2018-12-27 06:15:27', '1'), (10, '336.jpg', '2018-12-27 06:16:18', '1'), (11, '337.jpg', '2018-12-27 06:40:24', '1'), (12, '338.jpg', '2018-12-27 10:52:03', '1'), (13, '1_1e8i4KFLv8IOBTkKtCD08A.jpeg', '2019-01-25 11:23:31', '1'), (14, '1_1e8i4KFLv8IOBTkKtCD08A1.jpeg', '2019-01-25 11:23:58', '1'); -- -------------------------------------------------------- -- -- Table structure for table `multiple_upload` -- CREATE TABLE `multiple_upload` ( `multiple_upload_ID` int(11) NOT NULL, `file_name` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `multiple_upload` -- INSERT INTO `multiple_upload` (`multiple_upload_ID`, `file_name`) VALUES (1, '4f625db5714d87af59a5e1d857d222db.jpg'), (2, 'c0109336966e4fbaa60ee1f59e9d53ad.jpg'), (3, '31769a8b8ee3012644893a23fe4de85b.jpg'), (4, 'd8157b7d573c92173afd9255884dde31.jpg'), (5, '82837c1216c5cd7d1889f2f7d02e1956.jpg'), (6, '0976a5556bed17612937305b58bec620.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `single_upload` -- CREATE TABLE `single_upload` ( `single_upload_ID` int(11) NOT NULL, `file_name` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `single_upload` -- INSERT INTO `single_upload` (`single_upload_ID`, `file_name`) VALUES (1, '6850e9c84c3e80c9ae0b3f7f2dd5dc1b.jpg'), (2, '4b10cc04f082d5f68bcc2c308ec42bc9.jpg'), (3, '55412<PASSWORD>1.jpeg'), (4, '01e36b5cd85a2cf3e2814454bd6ffc64.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `test` -- CREATE TABLE `test` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `cat` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `test` -- INSERT INTO `test` (`id`, `name`, `cat`) VALUES (1, 'test', 'hdpe'), (2, 'Test2', 'hdpe'), (3, 'test', 'sprinkle'), (4, 'Test2', 'sprinkle'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `name` varchar(100) NOT NULL, `phone` varchar(15) NOT NULL, `userfile` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `email`, `password`, `name`, `phone`, `userfile`) VALUES (138, '<EMAIL>', 'qq<PASSWORD>', 'eeee<PASSWORD>', '8888888888888', '_downloadfiles_wallpapers_1920_1200_think_different_apple_3927.jpg'), (139, '', '', '', '', '041c3082d44c6bd5beffb4e5e3309962.jpg'), (140, '<EMAIL>', '<PASSWORD>', '<PASSWORD>', '888888888888855', ''), (141, '<EMAIL>', 'aaaaaaaaaaa', 'fdfd', '8888888888888', '336.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `user_login` -- CREATE TABLE `user_login` ( `id` int(11) NOT NULL, `user_name` varchar(255) NOT NULL, `user_email` varchar(255) NOT NULL, `user_password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `demo` -- ALTER TABLE `demo` ADD PRIMARY KEY (`id`); -- -- Indexes for table `files` -- ALTER TABLE `files` ADD PRIMARY KEY (`id`); -- -- Indexes for table `multiple_upload` -- ALTER TABLE `multiple_upload` ADD PRIMARY KEY (`multiple_upload_ID`); -- -- Indexes for table `single_upload` -- ALTER TABLE `single_upload` ADD PRIMARY KEY (`single_upload_ID`); -- -- Indexes for table `test` -- ALTER TABLE `test` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user_login` -- ALTER TABLE `user_login` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `demo` -- ALTER TABLE `demo` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `files` -- ALTER TABLE `files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `multiple_upload` -- ALTER TABLE `multiple_upload` MODIFY `multiple_upload_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `single_upload` -- ALTER TABLE `single_upload` MODIFY `single_upload_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `test` -- ALTER TABLE `test` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=142; -- -- AUTO_INCREMENT for table `user_login` -- ALTER TABLE `user_login` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; 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 */;
-- Initialization code for Species Autocomplete. -- For use in SQLite 3. -- Drop old tables. DROP TABLE IF EXISTS names; DROP TABLE IF EXISTS autocomplete; -- Create new table. CREATE TABLE names ( canonicalName TEXT UNIQUE, acceptedName TEXT, scientificName TEXT, nameAccordingTo TEXT, family TEXT, source TEXT ); CREATE INDEX names_name ON names(canonicalName); CREATE TABLE autocomplete ( string TEXT, canonicalName TEXT, score INTEGER -- We use this to score name matches; higher scored matches appear higher up. , CONSTRAINT unique_combination UNIQUE (string, canonicalName) ON CONFLICT IGNORE ); CREATE INDEX autocomplete_string ON autocomplete(canonicalName); -- Add your data into the names table, then -- run regen-index.php to regenerate the index.
INSERT INTO people (name, has_pet, pet_name, pet_age) VALUES ("Ahmed", TRUE, "Rockington", 100); INSERT INTO people (name, has_pet, pet_name, pet_age) VALUES ("Ahmed", TRUE, "Rockington", 100); INSERT INTO people (name, has_pet, pet_name, pet_age) VALUES ("Jacob", TRUE, "Misty", 10); INSERT INTO people (name, has_pet) VALUES ("Peter", false); -- Updates the row where the column name is peter -- UPDATE people SET has_pet = true, pet_name = "Franklin", pet_age = 2 WHERE name = "Peter"; SELECT * FROM people; -- show ALL books with authors -- INNER JOIN will only return all matching values from both tables SELECT title, firstName, lastName FROM books INNER JOIN authors ON books.authorId = authors.id; -- show ALL books, even if we don't know the author -- LEFT JOIN returns all of the values from the left table, and the matching ones from the right table SELECT title, firstName, lastName FROM books LEFT JOIN authors ON books.authorId = authors.id; -- show ALL books, even if we don't know the author -- RIGHT JOIN returns all of the values from the right table, and the matching ones from the left table SELECT title, firstName, lastName FROM books RIGHT JOIN authors ON books.authorId = authors.id; connection.query("SELECT * FROM songs", function(err, res) { connection.query("SELECT * FROM songs WHERE genre=?", ["Dance"], function(err, res) { connection.query( "DELETE FROM products WHERE ?",{flavor: "strawberry" },function(err, res) connection.query("SELECT * FROM products", function(err, res) { connection.query( "INSERT INTO auctions SET ?", { item_name: answer.item, category: answer.category, starting_bid: answer.startingBid || 0, highest_bid: answer.startingBid || 0 }, function(err) { var query = "SELECT position, song, year FROM top5000 WHERE ?"; connection.query(query, { artist: answer.artist }, function(err, res) { var query = "SELECT artist FROM top5000 GROUP BY artist HAVING count(*) > 1"; connection.query(query, function(err, res) { var query = "SELECT position,song,artist,year FROM top5000 WHERE position BETWEEN ? AND ?"; connection.query(query, [answer.start, answer.end], function(err, res) { connection.query("SELECT * FROM top5000 WHERE ?", { song: answer.song }, function(err, res) { var query = "SELECT position, song, year FROM top5000 WHERE ?"; connection.query(query, { artist: answer.artist }, function(err, res) { var query = "SELECT artist FROM top5000 GROUP BY artist HAVING count(*) > 1"; var query = "SELECT position,song,artist,year FROM top5000 WHERE position BETWEEN ? AND ?"; connection.query(query, [answer.start, answer.end], function(err, res) { connection.query("SELECT * FROM top5000 WHERE ?", { song: answer.song }, function(err, res) { var query = "SELECT top_albums.year, top_albums.album, top_albums.position, top5000.song, top5000.artist "; query += "FROM top_albums INNER JOIN top5000 ON (top_albums.artist = top5000.artist AND top_albums.year "; query += "= top5000.year) WHERE (top_albums.artist = ? AND top5000.artist = ?) ORDER BY top_albums.year, top_albums.position"; var query = "INSERT INTO" + tablename + "SET ?"; connection.query(query,tabledata,function(err, res) {} //------------ tabledata = {first_name: answer.first_name, second_name: answer.second_name, role_id:answer.roleid, manager_id: answer.manamgerid ||null} tabledata = {title: answer.title, salary: answer.salary, department_id:answer.departmentid} tabledata = { name: answer.departmentname } //--------- var query = "SELECT * FROM" + tablename; connection.query(query, function(err, res) { //--------- var query = "UPDATE employee SET role_id=? WHERE (first_name = ? AND second_name = ?)" connection.query(query, employeerole ,function(err, res) {}
-- 2018-05-31T18:28:22.045 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Val_Rule SET Code='M_HU_LUTU_Configuration.M_Product_ID=@M_Product_ID/-1@ AND M_HU_LUTU_Configuration.QtyCU = @QtyEntered/0@ ',Updated=TO_TIMESTAMP('2018-05-31 18:28:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=540396 ; -- 2018-05-31T18:28:28.790 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Val_Rule SET Code='M_HU_LUTU_Configuration.M_Product_ID=@M_Product_ID/-1@ AND M_HU_LUTU_Configuration.QtyCU = @QtyEntered@ ',Updated=TO_TIMESTAMP('2018-05-31 18:28:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=540396 ; -- 2018-05-31T18:32:46.682 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Val_Rule SET Code='M_HU_LUTU_Configuration.M_Product_ID=@M_Product_ID/-1@ AND M_HU_LUTU_Configuration.QtyCU = @QtyEntered/0@ ',Updated=TO_TIMESTAMP('2018-05-31 18:32:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=540396 ; -- 2018-05-31T18:56:06.698 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Val_Rule SET Code='M_HU_LUTU_Configuration.M_Product_ID=@M_Product_ID/-1@ AND COALESCE (M_HU_LUTU_Configuration.QtyCU, 1) * COALESCE (M_HU_LUTU_Configuration.QtyTU, 1) * COALESCE(M_HU_LUTU_Configuration.QtyLU, 1) = @QtyEntered/0@ ',Updated=TO_TIMESTAMP('2018-05-31 18:56:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=540396 ; -- 2018-05-31T18:56:16.830 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Val_Rule SET Code='M_HU_LUTU_Configuration.M_Product_ID=@M_Product_ID/-1@ AND COALESCE (M_HU_LUTU_Configuration.QtyCU, 1) * COALESCE (M_HU_LUTU_Configuration.QtyTU, 1) * COALESCE(M_HU_LUTU_Configuration.QtyLU, 1) = @QtyEntered/0@ ',Updated=TO_TIMESTAMP('2018-05-31 18:56:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=540396 ;
-- Get all employee and their super visors select e1.first_name as Employee, e2.first_name as Supervisor from employee as e1 inner join employee e2 on e1.supervisor_id=e2.id; insert into users (first_name) values ('Maran'), ('Karan'), ('Kalees'), ('Mahesh'); insert into users_friend (user_id, friend_id) values (1, 1);
<filename>Postgres/DDL/022-Table-Backbone-Address2GeoLocation.sql DROP TABLE IF EXISTS Backbone.Address2GeoLocation; // CREATE TABLE Backbone.Address2GeoLocation ( Id SERIAL NOT NULL PRIMARY KEY, StateCode VARCHAR(5) NOT NULL, StateName VARCHAR(50) NOT NULL, County VARCHAR(100) NOT NULL, City VARCHAR(100) NOT NULL, ZipCode VARCHAR(10) NOT NULL, AddressNumber (Aggregate of Prefix, Number and Suffix) StreetName (Aggregate of several fields) BuildingName VARCHAR(10) NOT NULL, Floor Unit VARCHAR(10) NOT NULL, Landmark VARCHAR(250) NOT NULL, Latitude DECIMAL(10,6), Longitutde DECIMAL(10,6), Location GEOGRAPHY(POINT), AddressType VARCHAR(150) NOT NULL, DataSource VARCHAR(250) NOT NULL, InsertedTS TIMESTAMP NOT NULL DEFAULT NOW(), UpdatedTS TIMESTAMP NOT NULL ); CREATE TRIGGER update_updated_timestamp BEFORE INSERT OR UPDATE ON Backbone.UserPreferences FOR EACH ROW EXECUTE PROCEDURE public.update_updated_timestamp();
<filename>EpiInfo.Database.EIWeb/dbo/Tables/Canvas.sql CREATE TABLE [dbo].[Canvas]( [CanvasID] [int] IDENTITY(1,1) NOT NULL, [CanvasGUID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_Canvas_CanvasGUID] DEFAULT (newid()), [CanvasName] [varchar](50) NOT NULL, [UserID] [int] NOT NULL, [CanvasDescription] [varchar](max) NULL, [CreatedDate] [datetime] NOT NULL, [ModifiedDate] [datetime] NOT NULL, [DatasourceID] [int] NOT NULL, [CanvasContent] [NVARCHAR](MAX) NOT NULL, CONSTRAINT [PK_Canvas] PRIMARY KEY CLUSTERED ( [CanvasID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO ALTER TABLE [dbo].[Canvas] WITH CHECK ADD CONSTRAINT [FK_Canvas _Datasource] FOREIGN KEY([DatasourceID]) REFERENCES [dbo].[Datasource] ([DatasourceID]) GO ALTER TABLE [dbo].[Canvas] CHECK CONSTRAINT [FK_Canvas _Datasource] GO ALTER TABLE [dbo].[Canvas] WITH CHECK ADD CONSTRAINT [FK_Canvas_CreatorUser] FOREIGN KEY([UserID]) REFERENCES [dbo].[User] ([UserID]) GO ALTER TABLE [dbo].[Canvas] CHECK CONSTRAINT [FK_Canvas_CreatorUser]
-- coalesce with columns from side that does not produce nulls -- string manipulation functions -- char_length - not a calcite built in function select count(*), substr(lower(UPPER(to_char(t1.c1, 'MMM-DD-YY'))), 5, 2), char_length(substr(lower(UPPER(to_char(t1.c1, 'MMM-DD-YY'))), 5, 2)) from t1 left outer join t2 on t1.a1 = t2.a2 left outer join t3 on t1.c1 = t3.c3 group by substr(lower(UPPER(to_char(t1.c1, 'MMM-DD-YY'))), 5, 2), char_length(substr(lower(UPPER(to_char(t1.c1, 'MMM-DD-YY'))), 5, 2)) order by substr(lower(UPPER(to_char(t1.c1, 'MMM-DD-YY'))), 5, 2), char_length(substr(lower(UPPER(to_char(t1.c1, 'MMM-DD-YY'))), 5, 2)) ;
<reponame>CBIIT/HPC_DME_APIs UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "Project", "PI_Lab", "Sample" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_id", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_title", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Title of the project" }, { "attribute":"project_description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Similar to an abstract; include details such as type of patients, trial phase, target genes under study, drugs being tested" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"lab_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"start_date", "mandatory":true, "defaultValue":"System-Date", "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"collaborator", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"collaborator_affiliation", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"publications", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"comments", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"sample_id", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"sample_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the sample" }, { "attribute":"sequencing_application_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Same as Assay Type in dbGap e.g RNA-Seq, DNA-Seq" }, { "attribute":"sample_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Same as Analyte Type in dbGap e.g. RNA, DNA" }, { "attribute":"reference_genome", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_lot", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_organism", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source organism e.g. Homon Sapiens (Human)" }, { "attribute":"source_provider", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_annotation", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"software_tool", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PII Present", "PII Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Encrypted", "Not Encrypted", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/CCBR_EXT_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "PI_Lab", "Project", "Summary", "Report", "Raw_Data", "Analysis", "Sample", "Supplement", "QC", "Dataset", "Output", "Setup" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_id", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_title", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Title of the project" }, { "attribute":"project_description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Similar to an abstract; include details such as type of patients, trial phase, target genes under study, drugs being tested" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"lab_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"start_date", "mandatory":true, "defaultValue":"System-Date", "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"collaborator", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"collaborator_affiliation", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"publications", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"comments", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"software", "mandatory":true, "collectionTypes":[ "Analysis", "QC" ], "ruleEnabled":true, "description":"Software used" }, { "attribute":"assay_type", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"dataset_id", "mandatory":false, "collectionTypes":[ "Dataset" ], "ruleEnabled":true }, { "attribute":"data_type", "mandatory":true, "collectionTypes":[ "Raw_Data" ], "ruleEnabled":true, "description":"Type of data stored" } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PII Present", "PII Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Encrypted", "Not Encrypted", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/SRP_SEER_EXT_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "Project", "PI_Lab", "Sample" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_title", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Title of the project" }, { "attribute":"project_description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Similar to an abstract; include details such as type of patients, trial phase, target genes under study, drugs being tested" }, { "attribute":"origin", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Origin of the project" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"start_date", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"access", "mandatory":true, "collectionTypes":[ "Project" ], "validValues":[ "Closed Access", "Controlled Access", "Open Access" ], "ruleEnabled":true, "description":"<b>Closed access</b>: data catalog entry will not be exposed.<br/> <b>Controlled access</b>: data catalog entry will be exposed; access to full data sets is by permission only.<br/> <b>Open access</b>: data catalog entry will be exposed; access to full data does not require permission." }, { "attribute":"project_affiliation", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_poc", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"publication_status", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"origin_repository", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"origin_accession_id", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"study_id", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"study_design", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"study_disease", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"assembly_name", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"cell_line_name", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"number_of_cases", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"summary_of_samples", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Summarize details about the samples represented in this dataset. For example, are these cell lines or clinical samples? How many samples and of what types per case/individual? What is the tissue type, normal, tumor, metastasis? What fixative methods? etc. " }, { "attribute":"organisms", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"collaborators", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"sample_id", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"sample_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the sample" }, { "attribute":"sequencing_application_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Same as Assay Type in dbGap e.g RNA-Seq, DNA-Seq" }, { "attribute":"sample_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Same as Analyte Type in dbGap e.g. RNA, DNA" }, { "attribute":"source_organism", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source organism e.g. Homon Sapiens (Human)" }, { "attribute":"origin_repository_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"consent", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"experiment", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"insert_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"instrument", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_selection", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Library selection e.g. PolyA" }, { "attribute":"library_source", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"average_spot_length", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"load_date", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"mbases", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"m_bytes", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"release_date", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"run", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"body_site", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"histological_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"is_tumor", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"submitted_subject_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"biospecimen_repository_sample_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sex", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"subject_is_affected", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_annotation", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"software_tool", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PII Present", "PII Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Encrypted", "Not Encrypted", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/CCBR_SRA_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "Project", "PI_Lab", "Flowcell", "Sample" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"project_id_CSAS_NAS", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Project identifier" }, { "attribute":"project_name", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"lab_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"bioinformatics_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_start_date", "mandatory":false, "defaultValue":"System-Date", "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"grant_funding_agent", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"flowcell_id", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Flowcell identification string" }, { "attribute":"run_name", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Name of the run" }, { "attribute":"run_date", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Date of the run" }, { "attribute":"sequencing_platform", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Sequencing platform e.g. Illumina" }, { "attribute":"sequencing_application_type", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Same as Assay Type in dbGap e.g RNA-Seq, DNA-Seq" }, { "attribute":"read_length", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Read length" }, { "attribute":"pooling", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Pooling" }, { "attribute":"sample_id", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"sample_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the sample" }, { "attribute":"initial_sample_concentration_ngul", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"initial_sample_volume_ul", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_sample_concentration_ngul", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_sample_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"RIN", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"28s18s", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_lot", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_library_concentration_nM", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_library_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_organism", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source organism e.g. Homon Sapiens (Human)" }, { "attribute":"source_provider", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_genome", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_annotation", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"software_tool", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PII Present", "PII Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Encrypted", "Not Encrypted", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/TEST_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "Project", "PI_Lab", "Sample" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_id", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_name", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Name of the project" }, { "attribute":"lab_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"bioinformatics_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"start_date", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"grant_funding_agent", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Description of the project" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"collaborator", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"collaborator_affiliation", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Organization to which the collaborator is affiliated" }, { "attribute":"publications", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"comments", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"sample_id", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"sample_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the sample" }, { "attribute":"machine_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Machine type" }, { "attribute":"application", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Application" }, { "attribute":"read_length", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Read length" }, { "attribute":"sample_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Same as Analyte Type in dbGap e.g. RNA, DNA" }, { "attribute":"source_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source name" }, { "attribute":"source_organism", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source organism e.g. Homon Sapiens (Human)" }, { "attribute":"reference_genome", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"control", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sample_replica", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"RIN", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"28s18s", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sample_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"library_lot", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_concentration", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_provider", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_annotation", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"software_tool", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/CCR_SCAF_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute": "collection_type", "mandatory": true, "validValues": [ "PI_Lab", "Project", "Sample" ], "ruleEnabled": true }, { "attribute": "pi_name", "mandatory": true, "collectionTypes": [ "PI_Lab" ], "ruleEnabled": true, "description":"First and Last name of the PI" }, { "attribute": "project_name", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Name of the project" }, { "attribute": "project_title", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Title of the project" }, { "attribute": "start_date", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Start date of the project" }, { "attribute": "affiliation", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Organization to which the project is affiliated" }, { "attribute": "description", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Description of the project" }, { "attribute": "method", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute": "collaboration", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "publications", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "sample_name", "mandatory": true, "collectionTypes": [ "Sample" ], "ruleEnabled": true, "description":"Name of the sample" }, { "attribute": "sequencing_technology", "mandatory": false, "collectionTypes": [ "Sample" ], "ruleEnabled": true }, { "attribute": "sequencing_lane", "mandatory": false, "collectionTypes": [ "Sample" ], "ruleEnabled": true }, { "attribute": "experimental_strategy", "mandatory": false, "collectionTypes": [ "Sample" ], "ruleEnabled": true }, { "attribute": "experimental_sub_strategy", "mandatory": false, "collectionTypes": [ "Sample" ], "ruleEnabled": true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules" : [ { "attribute" : "object_name", "mandatory" : true, "collectionTypes" : [ "Project", "Sample" ], "ruleEnabled" : true, "description":"Name of the stored object" }, { "attribute" : "file_type", "mandatory" : false, "collectionTypes" : [ "Project", "Sample" ], "ruleEnabled" : true } ] }' WHERE "BASE_PATH"='/CCR_LCBG_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "Project", "PI_Lab", "Flowcell", "Sample" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"project_id_CSAS_NAS", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Project identifier" }, { "attribute":"project_name", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"lab_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"bioinformatics_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_start_date", "mandatory":false, "defaultValue":"System-Date", "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"grant_funding_agent", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"flowcell_id", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Flowcell identification string" }, { "attribute":"run_name", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Name of the run" }, { "attribute":"run_date", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Date of the run" }, { "attribute":"sequencing_platform", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Sequencing platform e.g. Illumina" }, { "attribute":"sequencing_application_type", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Same as Assay Type in dbGap e.g RNA-Seq, DNA-Seq" }, { "attribute":"read_length", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Read length" }, { "attribute":"pooling", "mandatory":true, "collectionTypes":[ "Flowcell" ], "ruleEnabled":true, "description":"Pooling" }, { "attribute":"sample_id", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"sample_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the sample" }, { "attribute":"initial_sample_concentration_ngul", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"initial_sample_volume_ul", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_sample_concentration_ngul", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_sample_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"RIN", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"28s18s", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_lot", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_library_concentration_nM", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sfqc_library_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_organism", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source organism e.g. Homon Sapiens (Human)" }, { "attribute":"source_provider", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_genome", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_annotation", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"software_tool", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PII Present", "PII Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Encrypted", "Not Encrypted", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/FNL_SF_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "PI_Lab", "Project", "Tissue", "Experiment", "Run", "Analysis", "Folder" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_title", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Title of the project" }, { "attribute":"description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Description of the project" }, { "attribute":"start_date", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"collaboration_partner", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"project_publications", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"notes", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"tissue_name", "mandatory":true, "collectionTypes":[ "Tissue" ], "ruleEnabled":true, "description":"Tissue name" }, { "attribute":"organism", "mandatory":true, "collectionTypes":[ "Tissue" ], "ruleEnabled":true, "description":"Organism e.g. Homo Sapien (Human)" }, { "attribute":"tissue_type", "mandatory":true, "collectionTypes":[ "Tissue" ], "ruleEnabled":true, "description":"Tissue type" }, { "attribute":"tissue_from", "mandatory":false, "collectionTypes":[ "Tissue" ], "ruleEnabled":true }, { "attribute":"sectioned_by", "mandatory":false, "collectionTypes":[ "Tissue" ], "ruleEnabled":true }, { "attribute":"coverslip_type", "mandatory":false, "collectionTypes":[ "Tissue" ], "ruleEnabled":true }, { "attribute":"h&e_stained_section_with_annotation_available", "mandatory":false, "collectionTypes":[ "Tissue" ], "ruleEnabled":true }, { "attribute":"notes", "mandatory":false, "collectionTypes":[ "Tissue" ], "ruleEnabled":true }, { "attribute":"experiment_name", "mandatory":true, "collectionTypes":[ "Experiment" ], "ruleEnabled":true, "description":"Name of the experiment" }, { "attribute":"experiment_date", "mandatory":true, "collectionTypes":[ "Experiment" ], "ruleEnabled":true, "description":"Date of the experiment" }, { "attribute":"animal_id", "mandatory":false, "collectionTypes":[ "Experiment" ], "ruleEnabled":true }, { "attribute":"tumor_id", "mandatory":false, "collectionTypes":[ "Experiment" ], "ruleEnabled":true }, { "attribute":"slide_id", "mandatory":true, "collectionTypes":[ "Experiment" ], "ruleEnabled":true, "description":"Slide identifier" }, { "attribute":"tissue_thickness", "mandatory":false, "collectionTypes":[ "Experiment" ], "ruleEnabled":true }, { "attribute":"number_of_antibodies", "mandatory":true, "collectionTypes":[ "Experiment" ], "ruleEnabled":true, "description":"Number of antibodies" }, { "attribute":"antibody_name", "mandatory":true, "collectionTypes":[ "Experiment" ], "ruleEnabled":true, "description":"Name of antibody" }, { "attribute":"staiining_protocol", "mandatory":false, "collectionTypes":[ "Experiment" ], "ruleEnabled":true }, { "attribute":"notes", "mandatory":false, "collectionTypes":[ "Experiment" ], "ruleEnabled":true }, { "attribute":"run_name", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true, "description":"Name of the run" }, { "attribute":"run_date", "mandatory":true, "collectionTypes":[ "Run" ], "ruleEnabled":true, "description":"Date of the run" }, { "attribute":"run_by", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"codex_instrument", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"microscope", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"objective", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"cycle_number", "mandatory":true, "collectionTypes":[ "Run" ], "ruleEnabled":true, "description":"Cycle number" }, { "attribute":"number_of_regions", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"number_of_tiles", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"number_of_z-stacks", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"pitch_number", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"notes", "mandatory":false, "collectionTypes":[ "Run" ], "ruleEnabled":true }, { "attribute":"analysis_date", "mandatory":true, "collectionTypes":[ "Analysis" ], "ruleEnabled":true, "description":"Date of analysis" }, { "attribute":"analysis_done_on_run_date", "mandatory":true, "collectionTypes":[ "Analysis" ], "ruleEnabled":true, "description":"Date of the run" }, { "attribute":"analysis_type", "mandatory":true, "collectionTypes":[ "Analysis" ], "ruleEnabled":true, "description":"Type of analysis" }, { "attribute":"best_focus_reference_cycle", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"cell_size_cutoff_factor", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"deconvolution_used", "mandatory":true, "collectionTypes":[ "Analysis" ], "ruleEnabled":true, "description":"Deconvolution used" }, { "attribute":"drift_compensation_reference_cycle", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"generated_by", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"membrane_stain_channel", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"membrane_stain_cycle", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"name_or_version_of_clustering_software_used", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"name_or_version_of_clustering_software_used", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"name_or_version_of_segmentation_software_used", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"notes", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"nuclear_stain_channel", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"nuclear_stain_cycle", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"relative_cutoff", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"segmentation_max_cutoff", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"segmentation_min_cutoff", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"segmentation_radius", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/CPTR_CODEX_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute": "collection_type", "mandatory": true, "validValues": [ "PI_Lab", "Project", "Data", "Analysis", "Results", "Folder" ], "ruleEnabled": true }, { "attribute": "pi_name", "mandatory": true, "collectionTypes": [ "PI_Lab" ], "ruleEnabled": true, "description":"First and Last name of the PI" }, { "attribute": "pi_lab", "mandatory": true, "collectionTypes": [ "PI_Lab" ], "ruleEnabled": true, "description":"Lab to which the PI belongs to" }, { "attribute": "project_name", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Name of the project" }, { "attribute": "project_title", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Title of the project" }, { "attribute": "start_date", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Start date of the project" }, { "attribute": "description", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Description of the project" }, { "attribute": "collaborator", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "collaborator_affiliation", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Organization to which the collaborator is affiliated" }, { "attribute": "web_links", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "publications", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "method", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute": "comments", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Data", "Analysis", "Results" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Data" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Data" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PII Present", "PII Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Data" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" }, { "attribute":"tools_used", "mandatory":true, "collectionTypes":[ "Analysis" ], "ruleEnabled":true, "description":"Tools used" }, { "attribute":"methods_used", "mandatory":false, "collectionTypes":[ "Analysis" ], "ruleEnabled":true }, { "attribute":"text", "mandatory":true, "collectionTypes":[ "Results" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Report Present", "Report Not Present" ], "ruleEnabled":true, "description":"Report is present or not" }, { "attribute":"graphics", "mandatory":true, "collectionTypes":[ "Results" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Graphics Present", "Graphics Not Present" ], "ruleEnabled":true, "description":"Graphics is present or not" }, { "attribute":"tables", "mandatory":true, "collectionTypes":[ "Results" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Tabular Data", "Tabular Data Not Present" ], "ruleEnabled":true, "description":"Tabular data is present or not" } ] }' WHERE "BASE_PATH"='/FNL_ABCS_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "PI_Lab", "Project", "Variant", "Negative_Stain", "CryoEM", "Raw_Data", "Run" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_number", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Project number" }, { "attribute":"project_name", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Name of the project" }, { "attribute":"description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Description of the project" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"start_date", "mandatory":true, "defaultValue":"System-Date", "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"publications", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"comments", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"variant_name", "mandatory":false, "collectionTypes":[ "Variant" ], "ruleEnabled":true }, { "attribute":"instrument", "mandatory":true, "collectionTypes":[ "Negative_Stain" ], "ruleEnabled":true, "description":"Instrument used e.g. Illumina HiSeq" }, { "attribute":"pipeline_number", "mandatory":true, "collectionTypes":[ "Run" ], "ruleEnabled":true, "description":"Pipeline identifier" }, { "attribute":"software", "mandatory":true, "collectionTypes":[ "Run" ], "ruleEnabled":true, "description":"Software used" }, { "attribute":"run_date", "mandatory":true, "collectionTypes":[ "Run" ], "ruleEnabled":true, "description":"Date of the run" } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "Compressed", "Not Compressed", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/CCR_CMM_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute": "collection_type", "mandatory": true, "validValues": [ "PI_Section", "Researcher", "Project", "Sample" ], "ruleEnabled": true }, { "attribute": "pi_name", "mandatory": true, "collectionTypes": [ "PI_Section" ], "ruleEnabled": true, "description":"First and Last name of the PI" }, { "attribute": "pi_section", "mandatory": true, "collectionTypes": [ "PI_Section" ], "ruleEnabled": true }, { "attribute": "affiliation", "mandatory": true, "collectionTypes": [ "PI_Section" ], "ruleEnabled": true, "description":"Organization to which the PI is affiliated" }, { "attribute": "researcher_name", "mandatory": true, "collectionTypes": [ "Researcher" ], "ruleEnabled": true }, { "attribute": "project_accession", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "project_title", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Title of the project" }, { "attribute": "start_date", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Start date of the project" }, { "attribute": "description", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Description of the project" }, { "attribute": "collaborator", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "collaborator_affiliation", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Organization to which the collaborator is affiliated" }, { "attribute": "publications", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "comments", "mandatory": false, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "platform", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "library_strategy", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "library_source", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "library_selection", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true, "description":"Library selection e.g. PolyA" }, { "attribute": "library_layout", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "design_description", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "instrument_model", "mandatory": true, "collectionTypes": [ "Project" ], "ruleEnabled": true }, { "attribute": "sample_accession", "mandatory": true, "collectionTypes": [ "Sample" ], "ruleEnabled": true }, { "attribute": "flowcell_id", "mandatory": true, "collectionTypes": [ "Sample" ], "ruleEnabled": true, "description":"Flowcell identification string" } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute": "object_name", "mandatory": true, "collectionTypes": [ "Project", "Sample" ], "ruleEnabled": true, "description":"Name of the stored object" }, { "attribute": "file_type", "mandatory": true, "collectionTypes": [ "Project", "Sample" ], "ruleEnabled": true } ] }' WHERE "BASE_PATH"='/LHC_Genomics_Archive'; UPDATE public."HPC_DATA_MANAGEMENT_CONFIGURATION" SET "COLLECTION_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"collection_type", "mandatory":true, "validValues":[ "Project", "PI_Lab", "Sample" ], "ruleEnabled":true }, { "attribute":"pi_name", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"First and Last name of the PI" }, { "attribute":"affiliation", "mandatory":true, "collectionTypes":[ "PI_Lab" ], "ruleEnabled":true, "description":"Organization to which the PI is affiliated" }, { "attribute":"project_id", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Project identifier" }, { "attribute":"project_name", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Name of the project" }, { "attribute":"lab_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"bioinformatics_contact", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"start_date", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Start date of the project" }, { "attribute":"grant_funding_agent", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"description", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Description of the project" }, { "attribute":"method", "mandatory":true, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"method/assay type/data type such as RNA-Seq, Chip-Seq, Exome-Seq, ATAC-Seq, Whole Genome etc" }, { "attribute":"collaborator", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"collaborator_affiliation", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true, "description":"Organization to which the collaborator is affiliated" }, { "attribute":"publications", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"comments", "mandatory":false, "collectionTypes":[ "Project" ], "ruleEnabled":true }, { "attribute":"sample_id", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"sample_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the sample" }, { "attribute":"machine_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Machine type" }, { "attribute":"application", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Application" }, { "attribute":"read_length", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Read length" }, { "attribute":"sample_type", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Same as Analyte Type in dbGap e.g. RNA, DNA" }, { "attribute":"source_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source name" }, { "attribute":"source_organism", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Source organism e.g. Homon Sapiens (Human)" }, { "attribute":"reference_genome", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"control", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sample_replica", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"RIN", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"28s18s", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"sample_id", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Sample identifier, Same as BioSample in dbGap" }, { "attribute":"library_lot", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_name", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_concentration", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"library_size", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"source_provider", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true } ] }', "DATA_OBJECT_METADATA_VALIDATION_RULES"= '{ "metadataValidationRules": [ { "attribute":"object_name", "mandatory":true, "collectionTypes":[ "Sample" ], "ruleEnabled":true, "description":"Name of the stored object" }, { "attribute":"file_type", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"reference_annotation", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"software_tool", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"md5_checksum", "mandatory":false, "collectionTypes":[ "Sample" ], "ruleEnabled":true }, { "attribute":"phi_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PHI information is present or not" }, { "attribute":"pii_content", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"PII information is present or not" }, { "attribute":"data_encryption_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"Status of data encryption" }, { "attribute":"data_compression_status", "mandatory":true, "collectionTypes":[ "Sample" ], "defaultValue":"Unspecified", "validValues":[ "Unspecified", "PHI Present", "PHI Not Present", "Not Specified" ], "ruleEnabled":true, "description":"Status of data compression" } ] }' WHERE "BASE_PATH"='/FNL_SF_SCAF_Archive';
<reponame>joaopaulofilho/desafio -- Adminer 4.2.5 MySQL dump SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; DROP DATABASE IF EXISTS `desafio`; CREATE DATABASE `desafio` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `desafio`; CREATE USER 'desafio_user'@'localhost' IDENTIFIED BY PASSWORD <PASSWORD>'; GRANT ALL PRIVILEGES ON `desafio`.* TO 'desafio_user'@'localhost' WITH GRANT OPTION; DROP TABLE IF EXISTS `reservas`; CREATE TABLE `reservas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `salas_id` int(11) unsigned NOT NULL, `usuarios_id` int(11) unsigned NOT NULL, `hora` varchar(5) NOT NULL DEFAULT '08:00', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `salas_id` (`salas_id`), KEY `usuarios_id` (`usuarios_id`), CONSTRAINT `reservas_ibfk_1` FOREIGN KEY (`usuarios_id`) REFERENCES `usuarios` (`id`), CONSTRAINT `reservas_ibfk_2` FOREIGN KEY (`salas_id`) REFERENCES `salas` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; INSERT INTO `reservas` (`id`, `salas_id`, `usuarios_id`, `hora`) VALUES (10, 2, 9, '12:00'), (24, 2, 9, '10:00'), (27, 4, 11, '16:00'), (28, 3, 11, '09:00'), (30, 5, 11, '10:00'), (31, 5, 11, '15:00'), (32, 2, 9, '15:00'), (33, 2, 9, '09:00'), (34, 3, 9, '08:00'), (35, 4, 11, '08:00'), (36, 5, 11, '11:00'), (37, 3, 11, '18:00'), (38, 3, 11, '19:00'); DROP TABLE IF EXISTS `salas`; CREATE TABLE `salas` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `nome` varchar(20) NOT NULL DEFAULT '''''', `capacidade` tinyint(2) NOT NULL DEFAULT '0', `datashow` tinyint(1) NOT NULL DEFAULT '0', `observacoes` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; INSERT INTO `salas` (`id`, `nome`, `capacidade`, `datashow`, `observacoes`) VALUES (2, 'Sala Business', 10, 1, 'Sala para reuniões e demonstrações. Máquina de café, assentos confortáveis e quadro branco.'), (3, 'Sala Small', 5, 0, 'Sala para reunões relâmpago. Editar'), (4, 'Sala de Conferência', 20, 1, 'Datashow, mesa grande, impressoras.'), (5, 'Sala Business2', 10, 0, ''); DROP TABLE IF EXISTS `usuarios`; CREATE TABLE `usuarios` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(20) NOT NULL, `passwd` tinytext NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; INSERT INTO `usuarios` (`id`, `username`, `passwd`) VALUES (9, 'joao', '<PASSWORD>'), (10, 'pedro', '<PASSWORD>'), (11, 'bruno', '<PASSWORD>'), (12, 'amauri', '<PASSWORD>'); -- 2016-12-18 13:27:08
<reponame>humangeo/influent<filename>influent-spi/src/main/dataviews/influent-db-conversion-1.2.sql use [DB SCHEMA NAME]; -- NOTE: If dataview table names are different from defaults then modify the below scripts accordingly -- --- Update schema to version 1.2 dataviews from 1.1 -- create table FinEntity(EntityId varchar(100), InboundDegree int, UniqueInboundDegree int, OutboundDegree int, UniqueOutboundDegree int); create table ClusterSummary (EntityId varchar(100), Property varchar(50), Tag varchar(50), Type varchar(50), Value varchar(200), Stat float); create table ClusterSummaryMembers (SummaryId varchar(100), EntityId varchar(100)); alter table FinFlow add FromEntityType varchar(1), ToEntityType varchar(1); alter table FinFlowDaily add FromEntityType varchar(1), ToEntityType varchar(1); alter table FinFlowWeekly add FromEntityType varchar(1), ToEntityType varchar(1); alter table FinFlowMonthly add FromEntityType varchar(1), ToEntityType varchar(1); alter table FinFlowQuarterly add FromEntityType varchar(1), ToEntityType varchar(1); alter table FinFlowYearly add FromEntityType varchar(1), ToEntityType varchar(1); alter table FinEntityDaily add InboundDegree int, OutboundDegree int; alter table FinEntityWeekly add InboundDegree int, OutboundDegree int; alter table FinEntityMonthly add InboundDegree int, OutboundDegree int; alter table FinEntityQuarterly add InboundDegree int, OutboundDegree int; alter table FinEntityYearly add InboundDegree int, OutboundDegree int; -- --- disable the indices for bulk update -- alter index [ix_ff_from] ON FinFlow disable; alter index [ix_ff_to] ON FinFlow disable; alter index [ix_ffd_from] ON FinFlowDaily disable; alter index [ix_ffd_to] ON FinFlowDaily disable; alter index [ix_ffw_from] ON FinFlowWeekly disable; alter index [ix_ffw_to] ON FinFlowWeekly disable; -- --- update the fin flow tables (skip Monthly, Quarterly and Yearly since they will be refreshed) -- update FinFlow set FromEntityType = 'A', ToEntityType = 'A'; update FinFlowDaily set FromEntityType = 'A', ToEntityType = 'A'; update FinFlowWeekly set FromEntityType = 'A', ToEntityType = 'A'; --update FinFlowMonthly set FromEntityType = 'A', ToEntityType = 'A'; --update FinFlowQuarterly set FromEntityType = 'A', ToEntityType = 'A'; --update FinFlowYearly set FromEntityType = 'A', ToEntityType = 'A'; -- --- rebuild the indices -- alter index [ix_ff_from] ON FinFlow rebuild; alter index [ix_ff_to] ON FinFlow rebuild; alter index [ix_ffd_from] ON FinFlowDaily rebuild; alter index [ix_ffd_to] ON FinFlowDaily rebuild; alter index [ix_ffw_from] ON FinFlowWeekly rebuild; alter index [ix_ffw_to] ON FinFlowWeekly rebuild; -- --- FinFlowMonthly was previously incorrectly calculated (refresh Monthly, Quarterly and Yearly tables) -- truncate table FinFlowMonthly; truncate table FinFlowQuarterly; truncate table FinFlowYearly; alter index [ix_ffm_from] ON FinFlowMonthly disable; alter index [ix_ffm_to] ON FinFlowMonthly disable; alter index [ix_ffq_from] ON FinFlowQuarterly disable; alter index [ix_ffq_to] ON FinFlowQuarterly disable; alter index [ix_ffy_from] ON FinFlowYearly disable; alter index [ix_ffy_to] ON FinFlowYearly disable; insert into FinFlowMonthly (FromEntityId, FromEntityType, ToEntityId, ToEntityType, Amount, PeriodDate) select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101) from FinFlowDaily group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101); insert into FinFlowQuarterly (FromEntityId, FromEntityType, ToEntityId, ToEntityType, Amount, PeriodDate) select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101) from FinFlowMonthly group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101); insert into FinFlowYearly (FromEntityId, FromEntityType, ToEntityId, ToEntityType, Amount, PeriodDate) select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101) from FinFlowMonthly group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101); alter index [ix_ffm_from] ON FinFlowMonthly rebuild; alter index [ix_ffm_to] ON FinFlowMonthly rebuild; alter index [ix_ffq_from] ON FinFlowQuarterly rebuild; alter index [ix_ffq_to] ON FinFlowQuarterly rebuild; alter index [ix_ffy_from] ON FinFlowYearly rebuild; alter index [ix_ffy_to] ON FinFlowYearly rebuild; -- --- refresh the fin entity tables -- truncate table FinEntityDaily; truncate table FinEntityWeekly; truncate table FinEntityMonthly; truncate table FinEntityQuarterly; truncate table FinEntityYearly; alter index [ix_fed] ON FinEntityDaily disable; alter index [ix_few] ON FinEntityWeekly disable; alter index [ix_fem] ON FinEntityMonthly disable; alter index [ix_feq] ON FinEntityQuarterly disable; alter index [ix_fey] ON FinEntityYearly disable; create table temp_ids (Entity varchar(100)); create index tids on temp_ids (Entity); insert into temp_ids select distinct FromEntityId from FinFlowYearly union select distinct ToEntityId from FinFlowYearly; insert into FinEntityDaily (EntityId, PeriodDate, InboundAmount, InboundDegree, OutboundAmount, OutboundDegree, balance) select Entity, PeriodDate, sum(case when ToEntityId = Entity and FromEntityType = 'A' then Amount else 0 end), sum(case when ToEntityId = Entity and FromEntityType = 'A' then 1 else 0 end), -- calculate inbound degree sum(case when FromEntityId = Entity and ToEntityType = 'A' then Amount else 0 end), sum(case when FromEntityId = Entity and ToEntityType = 'A' then 1 else 0 end), -- calculate outbound degree 0 -- TODO calculate balance from temp_ids join FinFlowDaily on FromEntityId = Entity or ToEntityId = Entity group by Entity, PeriodDate; drop table temp_ids; insert into FinEntityWeekly (EntityId, PeriodDate, InboundAmount, InboundDegree, OutboundAmount, OutboundDegree, balance) select EntityId, CONVERT(varchar(50), (DATEADD(dd, @@DATEFIRST - DATEPART(dw, PeriodDate) - 6, PeriodDate)), 101), sum(InboundAmount), sum(InboundDegree), sum(OutboundAmount), sum(OutboundDegree), 0 from FinEntityDaily group by EntityId, CONVERT(varchar(50), (DATEADD(dd, @@DATEFIRST - DATEPART(dw, PeriodDate) - 6, PeriodDate)), 101); insert into FinEntityMonthly (EntityId, PeriodDate, InboundAmount, InboundDegree, OutboundAmount, OutboundDegree, balance) select EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101), sum(InboundAmount), sum(InboundDegree), sum(OutboundAmount), sum(OutboundDegree), 0 from FinEntityDaily group by EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101); insert into FinEntityQuarterly (EntityId, PeriodDate, InboundAmount, InboundDegree, OutboundAmount, OutboundDegree, balance) select EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101), sum(InboundAmount), sum(InboundDegree), sum(OutboundAmount), sum(OutboundDegree), 0 from FinEntityMonthly group by EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101); insert into FinEntityYearly (EntityId, PeriodDate, InboundAmount, InboundDegree, OutboundAmount, OutboundDegree, balance) select EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101), sum(InboundAmount), sum(InboundDegree), sum(OutboundAmount), sum(OutboundDegree), 0 from FinEntityQuarterly group by EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101); alter index [ix_fed] ON FinEntityDaily rebuild; alter index [ix_few] ON FinEntityWeekly rebuild; alter index [ix_fem] ON FinEntityMonthly rebuild; alter index [ix_feq] ON FinEntityQuarterly rebuild; alter index [ix_fey] ON FinEntityYearly rebuild; -- --- build FinEntity -- insert into FinEntity select EntityId, sum(inboundDegree), sum(uniqueInboundDegree), sum(outboundDegree), sum(uniqueOutboundDegree) from ( select FromEntityId as EntityId, 0 as inboundDegree, 0 as uniqueInboundDegree, count(ToEntityId) as outboundDegree, count( distinct ToEntityId ) as uniqueOutboundDegree from FinFlowDaily where ToEntityType = 'A' group by FromEntityId union select ToEntityId as EntityId, count(FromEntityId) as inboundDegree, count( distinct FromEntityId ) as uniqueInboundDegree, 0 as outboundDegree, 0 as uniqueOutboundDegree from FinFlowDaily where FromEntityType = 'A' group by ToEntityId ) q group by EntityId create index ix_ff_id on FinEntity (EntityId); create index ix_csum on ClusterSummary (EntityId); create index ix_cmem on ClusterSummaryMembers (SummaryId);
CREATE TABLE `tl_page` ( `ga_analyticsid` varchar(20) NOT NULL default '' `ga_anonymizeip` char(1) NOT NULL default '', `ga_measurespeed` char(1) NOT NULL default '', `ga_eventtracking` char(1) NOT NULL default '', `ga_externaltracking` char(1) NOT NULL default '', `ga_addlinktracking` char(1) NOT NULL default '', `ga_setdomainname` char(150) NOT NULL default '', `ga_titlelinktracking` char(150) NOT NULL default '', `ga_bounceseconds` int(10) unsigned NOT NULL default '0', ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP DATABASE marzagat; CREATE DATABASE marzagat; \c marzagat; CREATE TABLE restaurants ( restaurant_id INTEGER, name VARCHAR(50) NOT NULL, neighborhood VARCHAR(50) NOT NULL, google_rating NUMERIC(2,1) NOT NULL, zagat_rating NUMERIC(2,1) NOT NULL, review_count SMALLINT NOT NULL, description TEXT NOT NULL, latitude NUMERIC(7,4) NOT NULL, longitude NUMERIC(7,4) NOT NULL, address VARCHAR(100) NOT NULL, website VARCHAR(50), price_level SMALLINT NOT NULL, type VARCHAR(25) NOT NULL ); CREATE TABLE restaurant_photos ( photo_id INTEGER, restaurant_id INTEGER NOT NULL, photo_url VARCHAR(100) ); CREATE TABLE nearby_restaurants ( restaurant_id INTEGER NOT NULL, nearby_id INTEGER NOT NULL, nearby_rank SMALLINT NOT NULL );
<reponame>aidsoul/vktote CREATE TABLE IF NOT EXISTS vkgroup ( id_group int NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL, PRIMARY KEY (id_group) ); CREATE TABLE IF NOT EXISTS post ( id_post int NOT NULL, group_id int NOT NULL, CONSTRAINT past_ibfk FOREIGN KEY (group_id) REFERENCES vkgroup (id_group) ON DELETE CASCADE ON UPDATE CASCADE );
<filename>application/migrations/20180516142322_weight_and_dimensions.sql -- weight_and_dimensions -- ALTER TABLE `phppos_items` ADD COLUMN weight DECIMAL (23,10) NULL DEFAULT NULL,ADD COLUMN length DECIMAL (23,10) NULL DEFAULT NULL,ADD COLUMN width DECIMAL (23,10) NULL DEFAULT NULL,ADD COLUMN height DECIMAL (23,10) NULL DEFAULT NULL;
-- -- PostgreSQL database dump -- -- Dumped from database version 13.1 -- Dumped by pg_dump version 13.1 -- Started on 2021-01-09 18:05:24 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; -- -- TOC entry 261 (class 1255 OID 16905) -- Name: checkdispatcher(integer, integer, integer, boolean); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.checkdispatcher(pk_dispatcher integer, pk_booker integer, pk_consignment integer, choice boolean) RETURNS boolean LANGUAGE plpgsql AS $$ declare ShipCapacity real; TotalReserved integer; CurrReserved real; PK_Trip integer; PK_Request integer; begin select "PK_Request" into PK_Request from "Consignment" where "PK_Consignment" = PK_Consignment; if Choice = true then /*check capacity*/ select "CarryingCapacity" into ShipCapacity from "ShipType" st left join "Ship" s on st."PK_ShipType" = s."PK_ShipType" left join "Trip" t on s."PK_Ship" = t."PK_Ship" left join "Request" r on t."PK_Trip" = r."PK_Trip" left join "Consignment" con on con."PK_Request" = r."PK_Request" where con."PK_Consignment" = PK_Consignment; /*check accepted requests*/ select "PK_Trip" into PK_Trip from "Request" where "PK_Request" = PK_Request; select sum("CargoAmount") into TotalReserved from "RequestLine" rl left join "Request" r on rl."PK_Request" = r."PK_Request" left join "Consignment" con on r."PK_Request" = con."PK_Request" where r."PK_Trip" = PK_Trip and r."RequestStatus" = 'Accepted'; select sum("CargoAmount") into CurrReserved from "RequestLine" rl where rl."PK_Request" = PK_Request; if CurrReserved + TotalReserved > ShipCapacity then update "Request" set "RequestStatus" = 'Refused' where "PK_Request" = PK_Request; delete from "Consignment" where "PK_Consignment" = PK_Consignment; return false; end if; update "Consignment" set "PK_Booker" = PK_Booker, "PK_Dispatcher" = PK_Dispatcher where "PK_Consignment" = PK_Consignment; update "Request" set "RequestStatus" = 'Accepted' where "PK_Request" = PK_Request; return true; else update "Request" set "RequestStatus" = 'Refused' where "PK_Request" = PK_Request; delete from "Consignment" where "PK_Consignment" = PK_Consignment; return false; end if; end; $$; ALTER FUNCTION public.checkdispatcher(pk_dispatcher integer, pk_booker integer, pk_consignment integer, choice boolean) OWNER TO staze; -- -- TOC entry 260 (class 1255 OID 16902) -- Name: createconsignment(integer); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.createconsignment(pk_request integer) RETURNS void LANGUAGE plpgsql AS $$ declare TotalPrice money; begin select sum("CargoAmount") * (select "UnitPrice" from "Trip" t left join "Request" r on r."PK_Trip" = t."PK_Trip" where r."PK_Request" = PK_Request ) into TotalPrice from "RequestLine" where "PK_Request" = PK_Request; insert into "Consignment" ("BookingDate", "TotalPrice", "PK_Request") values(now(), TotalPrice, PK_Request); end; $$; ALTER FUNCTION public.createconsignment(pk_request integer) OWNER TO staze; -- -- TOC entry 247 (class 1255 OID 16893) -- Name: createcontract(date, date, money, integer, integer, integer, integer); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.createcontract(dateconclusion date, dateexpiration date, salary money, pk_ship integer, pk_hremployee integer, pk_crewmember integer, pk_crewposition integer) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Contract" ("PK_Contract", "DateConclusion", "DateExpiration", "Salary", "PK_Ship", "PK_HREmployee", "PK_CrewMember", "PK_CrewPosition") values (DEFAULT, DateConclusion, DateExpiration, Salary, PK_Ship, PK_HREmployee, PK_CrewMember, PK_CrewPosition); end; $$; ALTER FUNCTION public.createcontract(dateconclusion date, dateexpiration date, salary money, pk_ship integer, pk_hremployee integer, pk_crewmember integer, pk_crewposition integer) OWNER TO staze; -- -- TOC entry 246 (class 1255 OID 16898) -- Name: createrequest(character varying, integer, integer, integer, integer, integer); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.createrequest(requestnum character varying, pk_sender integer, pk_receiver integer, pk_trip integer, pk_portreceive integer, pk_portsend integer) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Request" ("RequestNum", "PK_Sender", "PK_Receiver", "PK_Trip", "PK_PortReceive", "PK_PortSend") values (RequestNum, PK_Sender, PK_Receiver, PK_Trip, PK_PortReceive, PK_PortSend); end; $$; ALTER FUNCTION public.createrequest(requestnum character varying, pk_sender integer, pk_receiver integer, pk_trip integer, pk_portreceive integer, pk_portsend integer) OWNER TO staze; -- -- TOC entry 248 (class 1255 OID 16896) -- Name: createrequestline(character varying, integer, integer); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.createrequestline(cargoname character varying, cargoamount integer, pk_request integer) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "RequestLine" ("CargoName", "CargoAmount", "PK_Request") values (CargoName, CargoAmount, PK_Request); end; $$; ALTER FUNCTION public.createrequestline(cargoname character varying, cargoamount integer, pk_request integer) OWNER TO staze; -- -- TOC entry 263 (class 1255 OID 16897) -- Name: createtrip(money, money, timestamp without time zone, integer, integer[], character varying[], integer); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.createtrip(costs money, unitprice money, datedeparture timestamp without time zone, pk_ship integer, ports integer[], intervals character varying[], amount integer) RETURNS void LANGUAGE plpgsql AS $$ declare PK_Trip integer; summa timestamp; currInterval interval day to hour; begin summa := DateDeparture; insert into "Trip" ("Cost", "UnitPrice", "DateDeparture", "PK_Ship") values(Costs, UnitPrice, DateDeparture, PK_Ship) returning "PK_Trip" into PK_Trip; for i in 1..amount loop currInterval = cast(intervals[i] as interval day to hour); summa := summa + currInterval; if i != 1 and i != amount then insert into "Route" ("TimeDuration", "IsFirst", "IsLast", "State", "PK_Trip", "PK_PortSend", "PK_PortReceive") values (currInterval, false, false, false, PK_Trip, ports[i], ports[i + 1]); elsif i = 1 then insert into "Route" ("TimeDuration", "IsFirst", "IsLast", "State", "PK_Trip", "PK_PortSend", "PK_PortReceive") values (currInterval, true, false, false, PK_Trip, ports[i], ports[i + 1]); else insert into "Route" ("TimeDuration", "IsFirst", "IsLast", "State", "PK_Trip", "PK_PortSend", "PK_PortReceive") values (currInterval, false, true, false, PK_Trip, ports[i], ports[i + 1]); end if; end loop; update "Trip" set "DateArrival" = summa where "PK_Trip" = PK_Trip; end; $$; ALTER FUNCTION public.createtrip(costs money, unitprice money, datedeparture timestamp without time zone, pk_ship integer, ports integer[], intervals character varying[], amount integer) OWNER TO staze; -- -- TOC entry 238 (class 1255 OID 16885) -- Name: insertbooker(character varying, character varying, money); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.insertbooker(fullname character varying, personnelnum character varying, salary money) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Booker"("FullName", "PersonnelNum", "Salary") values (fullname, personnelNum, salary); end; $$; ALTER FUNCTION public.insertbooker(fullname character varying, personnelnum character varying, salary money) OWNER TO postgres; -- -- TOC entry 237 (class 1255 OID 16884) -- Name: insertclient(character varying); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.insertclient(fullname character varying) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Client"("FullName") values (fullname); end; $$; ALTER FUNCTION public.insertclient(fullname character varying) OWNER TO postgres; -- -- TOC entry 242 (class 1255 OID 16889) -- Name: insertcrewmember(character varying); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.insertcrewmember(fullname character varying) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "CrewMember" ("PK_CrewMember", "FullName") values (DEFAULT, FullName); end; $$; ALTER FUNCTION public.insertcrewmember(fullname character varying) OWNER TO staze; -- -- TOC entry 243 (class 1255 OID 16890) -- Name: insertcrewposition(character varying); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.insertcrewposition(crewpositionname character varying) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "CrewPosition" ("PK_CrewPosition", "CrewPositionName") values (DEFAULT, CrewPositionName); end; $$; ALTER FUNCTION public.insertcrewposition(crewpositionname character varying) OWNER TO staze; -- -- TOC entry 239 (class 1255 OID 16886) -- Name: insertdispatcher(character varying, character varying, money); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.insertdispatcher(fullname character varying, personnelnum character varying, salary money) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Dispatcher"("FullName", "PersonnelNum", "Salary") values (fullname, personnelNum, salary); end; $$; ALTER FUNCTION public.insertdispatcher(fullname character varying, personnelnum character varying, salary money) OWNER TO postgres; -- -- TOC entry 244 (class 1255 OID 16891) -- Name: inserthremployee(character varying, character varying, money); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.inserthremployee(fullname character varying, personnelnum character varying, salary money) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "HREmployee" ("PK_HREmployee", "FullName", "PersonnelNum", "Salary") values (DEFAULT, FullName, PersonnelNum, Salary); end; $$; ALTER FUNCTION public.inserthremployee(fullname character varying, personnelnum character varying, salary money) OWNER TO staze; -- -- TOC entry 240 (class 1255 OID 16887) -- Name: insertport(character varying); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.insertport(portname character varying) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Port"("PortName") values (portName); end; $$; ALTER FUNCTION public.insertport(portname character varying) OWNER TO postgres; -- -- TOC entry 241 (class 1255 OID 16888) -- Name: insertship(character varying, character varying, integer); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.insertship(shipnumber character varying, shipname character varying, shiptype integer) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "Ship"("ShipNumber", "ShipName", "PK_ShipType") values (shipNumber, shipName, shipType); end; $$; ALTER FUNCTION public.insertship(shipnumber character varying, shipname character varying, shiptype integer) OWNER TO postgres; -- -- TOC entry 245 (class 1255 OID 16892) -- Name: insertshiptype(character varying, real, integer, integer, integer, integer, integer, integer, integer); Type: FUNCTION; Schema: public; Owner: staze -- CREATE FUNCTION public.insertshiptype(shiptypename character varying, carryingcapacity real, amountcaptains integer, amountcaptainhelpers integer, amountcooks integer, amountmechanics integer, amountelectricians integer, amountsailors integer, amountradiooperators integer) RETURNS void LANGUAGE plpgsql AS $$ begin insert into "ShipType" ("PK_ShipType", "ShipTypeName", "CarryingCapacity", "AmountCaptains", "AmountCaptainHelpers", "AmountCooks", "AmountMechanics", "AmountElectricians", "AmountSailors", "AmountRadioOperators") values (DEFAULT, ShipTypeName, CarryingCapacity, AmountCaptains, AmountCaptainHelpers, AmountCooks, AmountMechanics, AmountElectricians, AmountSailors, AmountRadioOperators); end; $$; ALTER FUNCTION public.insertshiptype(shiptypename character varying, carryingcapacity real, amountcaptains integer, amountcaptainhelpers integer, amountcooks integer, amountmechanics integer, amountelectricians integer, amountsailors integer, amountradiooperators integer) OWNER TO staze; -- -- TOC entry 262 (class 1255 OID 16906) -- Name: refuseexpiredrequests(); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.refuseexpiredrequests() RETURNS void LANGUAGE plpgsql AS $$ begin delete from "Consignment" where "PK_Request" = (select r."PK_Request" from "Request" r left join "Trip" t on r."PK_Trip" = t."PK_Trip" where r."RequestStatus" = 'verifying' and t."DateDeparture" - now() < cast('14 days' as interval)); update "Request" set "RequestStatus" = 'Refused' where "PK_Request" = (select r."PK_Request" from "Request" r left join "Trip" t on r."PK_Trip" = t."PK_Trip" where r."RequestStatus" = 'verifying' and t."DateDeparture" - now() < cast('14 days' as interval)); end; $$; ALTER FUNCTION public.refuseexpiredrequests() OWNER TO postgres; SET default_tablespace = ''; SET default_table_access_method = heap; -- -- TOC entry 223 (class 1259 OID 16756) -- Name: Booker; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Booker" ( "PK_Booker" integer NOT NULL, "FullName" character varying(100), "PersonnelNum" character varying(20), "Salary" money ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Booker" OWNER TO postgres; -- -- TOC entry 222 (class 1259 OID 16754) -- Name: Booker_PK_Booker_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Booker_PK_Booker_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Booker_PK_Booker_seq" OWNER TO postgres; -- -- TOC entry 3241 (class 0 OID 0) -- Dependencies: 222 -- Name: Booker_PK_Booker_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Booker_PK_Booker_seq" OWNED BY public."Booker"."PK_Booker"; -- -- TOC entry 201 (class 1259 OID 16660) -- Name: Client; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Client" ( "PK_Client" integer NOT NULL, "FullName" character varying(100) ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Client" OWNER TO postgres; -- -- TOC entry 200 (class 1259 OID 16658) -- Name: Client_PK_Client_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Client_PK_Client_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Client_PK_Client_seq" OWNER TO postgres; -- -- TOC entry 3242 (class 0 OID 0) -- Dependencies: 200 -- Name: Client_PK_Client_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Client_PK_Client_seq" OWNED BY public."Client"."PK_Client"; -- -- TOC entry 229 (class 1259 OID 16785) -- Name: Consignment; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Consignment" ( "PK_Consignment" integer NOT NULL, "BookingDate" timestamp without time zone, "TotalPrice" money, "PK_Request" integer NOT NULL, "PK_Booker" integer, "PK_Dispatcher" integer ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Consignment" OWNER TO postgres; -- -- TOC entry 228 (class 1259 OID 16783) -- Name: Consignment_PK_Consignment_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Consignment_PK_Consignment_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Consignment_PK_Consignment_seq" OWNER TO postgres; -- -- TOC entry 3243 (class 0 OID 0) -- Dependencies: 228 -- Name: Consignment_PK_Consignment_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Consignment_PK_Consignment_seq" OWNED BY public."Consignment"."PK_Consignment"; -- -- TOC entry 215 (class 1259 OID 16717) -- Name: Contract; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Contract" ( "PK_Contract" integer NOT NULL, "DateConclusion" date, "DateExpiration" date, "Salary" money, "PK_Ship" integer NOT NULL, "PK_HREmployee" integer NOT NULL, "PK_CrewMember" integer NOT NULL, "PK_CrewPosition" integer NOT NULL ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Contract" OWNER TO postgres; -- -- TOC entry 214 (class 1259 OID 16715) -- Name: Contract_PK_Contract_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Contract_PK_Contract_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Contract_PK_Contract_seq" OWNER TO postgres; -- -- TOC entry 3244 (class 0 OID 0) -- Dependencies: 214 -- Name: Contract_PK_Contract_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Contract_PK_Contract_seq" OWNED BY public."Contract"."PK_Contract"; -- -- TOC entry 213 (class 1259 OID 16709) -- Name: CrewMember; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."CrewMember" ( "PK_CrewMember" integer NOT NULL, "FullName" character varying(100) ) WITH (autovacuum_enabled='true'); ALTER TABLE public."CrewMember" OWNER TO postgres; -- -- TOC entry 212 (class 1259 OID 16707) -- Name: CrewMember_PK_CrewMember_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."CrewMember_PK_CrewMember_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."CrewMember_PK_CrewMember_seq" OWNER TO postgres; -- -- TOC entry 3245 (class 0 OID 0) -- Dependencies: 212 -- Name: CrewMember_PK_CrewMember_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."CrewMember_PK_CrewMember_seq" OWNED BY public."CrewMember"."PK_CrewMember"; -- -- TOC entry 211 (class 1259 OID 16701) -- Name: CrewPosition; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."CrewPosition" ( "PK_CrewPosition" integer NOT NULL, "CrewPositionName" character varying(100) ) WITH (autovacuum_enabled='true'); ALTER TABLE public."CrewPosition" OWNER TO postgres; -- -- TOC entry 210 (class 1259 OID 16699) -- Name: CrewPosition_PK_CrewPosition_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."CrewPosition_PK_CrewPosition_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."CrewPosition_PK_CrewPosition_seq" OWNER TO postgres; -- -- TOC entry 3246 (class 0 OID 0) -- Dependencies: 210 -- Name: CrewPosition_PK_CrewPosition_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."CrewPosition_PK_CrewPosition_seq" OWNED BY public."CrewPosition"."PK_CrewPosition"; -- -- TOC entry 221 (class 1259 OID 16748) -- Name: Dispatcher; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Dispatcher" ( "PK_Dispatcher" integer NOT NULL, "FullName" character varying(100), "PersonnelNum" character varying(20), "Salary" money ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Dispatcher" OWNER TO postgres; -- -- TOC entry 220 (class 1259 OID 16746) -- Name: Dispatcher_PK_Dispatcher_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Dispatcher_PK_Dispatcher_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Dispatcher_PK_Dispatcher_seq" OWNER TO postgres; -- -- TOC entry 3247 (class 0 OID 0) -- Dependencies: 220 -- Name: Dispatcher_PK_Dispatcher_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Dispatcher_PK_Dispatcher_seq" OWNED BY public."Dispatcher"."PK_Dispatcher"; -- -- TOC entry 205 (class 1259 OID 16676) -- Name: HREmployee; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."HREmployee" ( "PK_HREmployee" integer NOT NULL, "FullName" character varying(100), "PersonnelNum" character varying(20), "Salary" money ) WITH (autovacuum_enabled='true'); ALTER TABLE public."HREmployee" OWNER TO postgres; -- -- TOC entry 204 (class 1259 OID 16674) -- Name: HREmployee_PK_HREmployee_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."HREmployee_PK_HREmployee_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."HREmployee_PK_HREmployee_seq" OWNER TO postgres; -- -- TOC entry 3248 (class 0 OID 0) -- Dependencies: 204 -- Name: HREmployee_PK_HREmployee_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."HREmployee_PK_HREmployee_seq" OWNED BY public."HREmployee"."PK_HREmployee"; -- -- TOC entry 203 (class 1259 OID 16668) -- Name: Port; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Port" ( "PK_Port" integer NOT NULL, "PortName" character varying(100) ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Port" OWNER TO postgres; -- -- TOC entry 202 (class 1259 OID 16666) -- Name: Port_PK_Port_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Port_PK_Port_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Port_PK_Port_seq" OWNER TO postgres; -- -- TOC entry 3249 (class 0 OID 0) -- Dependencies: 202 -- Name: Port_PK_Port_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Port_PK_Port_seq" OWNED BY public."Port"."PK_Port"; -- -- TOC entry 225 (class 1259 OID 16764) -- Name: Request; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Request" ( "PK_Request" integer NOT NULL, "RequestNum" character varying(50), "PK_Sender" integer NOT NULL, "PK_Receiver" integer NOT NULL, "PK_Trip" integer NOT NULL, "PK_PortReceive" integer NOT NULL, "PK_PortSend" integer NOT NULL, "RequestStatus" character varying(50) DEFAULT 'verifying'::character varying ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Request" OWNER TO postgres; -- -- TOC entry 227 (class 1259 OID 16777) -- Name: RequestLine; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."RequestLine" ( "PK_RequestLine" integer NOT NULL, "CargoName" character varying(100), "CargoAmount" integer, "PK_Request" integer NOT NULL ) WITH (autovacuum_enabled='true'); ALTER TABLE public."RequestLine" OWNER TO postgres; -- -- TOC entry 226 (class 1259 OID 16775) -- Name: RequestLine_PK_RequestLine_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."RequestLine_PK_RequestLine_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."RequestLine_PK_RequestLine_seq" OWNER TO postgres; -- -- TOC entry 3250 (class 0 OID 0) -- Dependencies: 226 -- Name: RequestLine_PK_RequestLine_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."RequestLine_PK_RequestLine_seq" OWNED BY public."RequestLine"."PK_RequestLine"; -- -- TOC entry 224 (class 1259 OID 16762) -- Name: Request_PK_Request_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Request_PK_Request_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Request_PK_Request_seq" OWNER TO postgres; -- -- TOC entry 3251 (class 0 OID 0) -- Dependencies: 224 -- Name: Request_PK_Request_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Request_PK_Request_seq" OWNED BY public."Request"."PK_Request"; -- -- TOC entry 219 (class 1259 OID 16738) -- Name: Route; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Route" ( "PK_Route" integer NOT NULL, "TimeDuration" interval day to hour, "IsFirst" boolean, "IsLast" boolean, "State" boolean, "PK_Trip" integer NOT NULL, "PK_PortReceive" integer NOT NULL, "PK_PortSend" integer NOT NULL ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Route" OWNER TO postgres; -- -- TOC entry 218 (class 1259 OID 16736) -- Name: Route_PK_Route_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Route_PK_Route_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Route_PK_Route_seq" OWNER TO postgres; -- -- TOC entry 3252 (class 0 OID 0) -- Dependencies: 218 -- Name: Route_PK_Route_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Route_PK_Route_seq" OWNED BY public."Route"."PK_Route"; -- -- TOC entry 209 (class 1259 OID 16692) -- Name: Ship; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Ship" ( "PK_Ship" integer NOT NULL, "ShipNumber" character varying(30), "ShipName" character varying(100), "PK_ShipType" integer NOT NULL ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Ship" OWNER TO postgres; -- -- TOC entry 207 (class 1259 OID 16684) -- Name: ShipType; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."ShipType" ( "PK_ShipType" integer NOT NULL, "ShipTypeName" character varying(100), "CarryingCapacity" real, "AmountCaptains" integer, "AmountCaptainHelpers" integer, "AmountCooks" integer, "AmountMechanics" integer, "AmountElectricians" integer, "AmountSailors" integer, "AmountRadioOperators" integer ) WITH (autovacuum_enabled='true'); ALTER TABLE public."ShipType" OWNER TO postgres; -- -- TOC entry 206 (class 1259 OID 16682) -- Name: ShipType_PK_ShipType_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."ShipType_PK_ShipType_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."ShipType_PK_ShipType_seq" OWNER TO postgres; -- -- TOC entry 3253 (class 0 OID 0) -- Dependencies: 206 -- Name: ShipType_PK_ShipType_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."ShipType_PK_ShipType_seq" OWNED BY public."ShipType"."PK_ShipType"; -- -- TOC entry 208 (class 1259 OID 16690) -- Name: Ship_PK_Ship_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Ship_PK_Ship_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Ship_PK_Ship_seq" OWNER TO postgres; -- -- TOC entry 3254 (class 0 OID 0) -- Dependencies: 208 -- Name: Ship_PK_Ship_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Ship_PK_Ship_seq" OWNED BY public."Ship"."PK_Ship"; -- -- TOC entry 217 (class 1259 OID 16729) -- Name: Trip; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public."Trip" ( "PK_Trip" integer NOT NULL, "Cost" money, "UnitPrice" money, "DateDeparture" timestamp without time zone, "DateArrival" timestamp without time zone, "PK_Ship" integer NOT NULL ) WITH (autovacuum_enabled='true'); ALTER TABLE public."Trip" OWNER TO postgres; -- -- TOC entry 216 (class 1259 OID 16727) -- Name: Trip_PK_Trip_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public."Trip_PK_Trip_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public."Trip_PK_Trip_seq" OWNER TO postgres; -- -- TOC entry 3255 (class 0 OID 0) -- Dependencies: 216 -- Name: Trip_PK_Trip_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public."Trip_PK_Trip_seq" OWNED BY public."Trip"."PK_Trip"; -- -- TOC entry 236 (class 1259 OID 16937) -- Name: failed_jobs; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.failed_jobs ( id bigint NOT NULL, uuid character varying(255) NOT NULL, connection text NOT NULL, queue text NOT NULL, payload text NOT NULL, exception text NOT NULL, failed_at timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL ); ALTER TABLE public.failed_jobs OWNER TO postgres; -- -- TOC entry 235 (class 1259 OID 16935) -- Name: failed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.failed_jobs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.failed_jobs_id_seq OWNER TO postgres; -- -- TOC entry 3256 (class 0 OID 0) -- Dependencies: 235 -- Name: failed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.failed_jobs_id_seq OWNED BY public.failed_jobs.id; -- -- TOC entry 231 (class 1259 OID 16909) -- Name: migrations; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.migrations ( id integer NOT NULL, migration character varying(255) NOT NULL, batch integer NOT NULL ); ALTER TABLE public.migrations OWNER TO postgres; -- -- TOC entry 230 (class 1259 OID 16907) -- Name: migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.migrations_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.migrations_id_seq OWNER TO postgres; -- -- TOC entry 3257 (class 0 OID 0) -- Dependencies: 230 -- Name: migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id; -- -- TOC entry 234 (class 1259 OID 16928) -- Name: password_resets; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.password_resets ( email character varying(255) NOT NULL, token character varying(255) NOT NULL, created_at timestamp(0) without time zone ); ALTER TABLE public.password_resets OWNER TO postgres; -- -- TOC entry 233 (class 1259 OID 16917) -- Name: users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.users ( id bigint NOT NULL, name character varying(255) NOT NULL, email character varying(255) NOT NULL, email_verified_at timestamp(0) without time zone, password character varying(255) NOT NULL, remember_token character varying(100), created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone ); ALTER TABLE public.users OWNER TO postgres; -- -- TOC entry 232 (class 1259 OID 16915) -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.users_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.users_id_seq OWNER TO postgres; -- -- TOC entry 3258 (class 0 OID 0) -- Dependencies: 232 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -- -- TOC entry 2986 (class 2604 OID 16759) -- Name: Booker PK_Booker; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Booker" ALTER COLUMN "PK_Booker" SET DEFAULT nextval('public."Booker_PK_Booker_seq"'::regclass); -- -- TOC entry 2975 (class 2604 OID 16663) -- Name: Client PK_Client; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Client" ALTER COLUMN "PK_Client" SET DEFAULT nextval('public."Client_PK_Client_seq"'::regclass); -- -- TOC entry 2990 (class 2604 OID 16788) -- Name: Consignment PK_Consignment; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Consignment" ALTER COLUMN "PK_Consignment" SET DEFAULT nextval('public."Consignment_PK_Consignment_seq"'::regclass); -- -- TOC entry 2982 (class 2604 OID 16720) -- Name: Contract PK_Contract; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Contract" ALTER COLUMN "PK_Contract" SET DEFAULT nextval('public."Contract_PK_Contract_seq"'::regclass); -- -- TOC entry 2981 (class 2604 OID 16712) -- Name: CrewMember PK_CrewMember; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."CrewMember" ALTER COLUMN "PK_CrewMember" SET DEFAULT nextval('public."CrewMember_PK_CrewMember_seq"'::regclass); -- -- TOC entry 2980 (class 2604 OID 16704) -- Name: CrewPosition PK_CrewPosition; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."CrewPosition" ALTER COLUMN "PK_CrewPosition" SET DEFAULT nextval('public."CrewPosition_PK_CrewPosition_seq"'::regclass); -- -- TOC entry 2985 (class 2604 OID 16751) -- Name: Dispatcher PK_Dispatcher; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Dispatcher" ALTER COLUMN "PK_Dispatcher" SET DEFAULT nextval('public."Dispatcher_PK_Dispatcher_seq"'::regclass); -- -- TOC entry 2977 (class 2604 OID 16679) -- Name: HREmployee PK_HREmployee; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."HREmployee" ALTER COLUMN "PK_HREmployee" SET DEFAULT nextval('public."HREmployee_PK_HREmployee_seq"'::regclass); -- -- TOC entry 2976 (class 2604 OID 16671) -- Name: Port PK_Port; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Port" ALTER COLUMN "PK_Port" SET DEFAULT nextval('public."Port_PK_Port_seq"'::regclass); -- -- TOC entry 2987 (class 2604 OID 16767) -- Name: Request PK_Request; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ALTER COLUMN "PK_Request" SET DEFAULT nextval('public."Request_PK_Request_seq"'::regclass); -- -- TOC entry 2989 (class 2604 OID 16780) -- Name: RequestLine PK_RequestLine; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."RequestLine" ALTER COLUMN "PK_RequestLine" SET DEFAULT nextval('public."RequestLine_PK_RequestLine_seq"'::regclass); -- -- TOC entry 2984 (class 2604 OID 16741) -- Name: Route PK_Route; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Route" ALTER COLUMN "PK_Route" SET DEFAULT nextval('public."Route_PK_Route_seq"'::regclass); -- -- TOC entry 2979 (class 2604 OID 16695) -- Name: Ship PK_Ship; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Ship" ALTER COLUMN "PK_Ship" SET DEFAULT nextval('public."Ship_PK_Ship_seq"'::regclass); -- -- TOC entry 2978 (class 2604 OID 16687) -- Name: ShipType PK_ShipType; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."ShipType" ALTER COLUMN "PK_ShipType" SET DEFAULT nextval('public."ShipType_PK_ShipType_seq"'::regclass); -- -- TOC entry 2983 (class 2604 OID 16732) -- Name: Trip PK_Trip; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Trip" ALTER COLUMN "PK_Trip" SET DEFAULT nextval('public."Trip_PK_Trip_seq"'::regclass); -- -- TOC entry 2993 (class 2604 OID 16940) -- Name: failed_jobs id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.failed_jobs ALTER COLUMN id SET DEFAULT nextval('public.failed_jobs_id_seq'::regclass); -- -- TOC entry 2991 (class 2604 OID 16912) -- Name: migrations id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.migrations ALTER COLUMN id SET DEFAULT nextval('public.migrations_id_seq'::regclass); -- -- TOC entry 2992 (class 2604 OID 16920) -- Name: users id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -- -- TOC entry 3222 (class 0 OID 16756) -- Dependencies: 223 -- Data for Name: Booker; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Booker" ("PK_Booker", "FullName", "PersonnelNum", "Salary") FROM stdin; 2 Стариков Е.К. A-007 120 000,00 ? \. -- -- TOC entry 3200 (class 0 OID 16660) -- Dependencies: 201 -- Data for Name: Client; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Client" ("PK_Client", "FullName") FROM stdin; 1 Zhenya 2 Kutya 3 Max 4 <NAME> 5 ЗАО Закрытое Акционерное Общество \. -- -- TOC entry 3228 (class 0 OID 16785) -- Dependencies: 229 -- Data for Name: Consignment; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Consignment" ("PK_Consignment", "BookingDate", "TotalPrice", "PK_Request", "PK_Booker", "PK_Dispatcher") FROM stdin; 8 2020-12-29 16:52:30.034919 22 000 000,00 ? 5 2 2 12 2021-01-03 20:21:03.034903 4 015 000,00 ? 7 2 2 \. -- -- TOC entry 3214 (class 0 OID 16717) -- Dependencies: 215 -- Data for Name: Contract; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Contract" ("PK_Contract", "DateConclusion", "DateExpiration", "Salary", "PK_Ship", "PK_HREmployee", "PK_CrewMember", "PK_CrewPosition") FROM stdin; 1 2020-08-13 2021-08-13 500 000,00 ? 1 1 1 1 2 2020-08-13 2021-08-13 300 000,00 ? 1 1 2 6 3 2020-08-13 2021-08-13 400 000,00 ? 1 1 3 6 4 2020-08-13 2021-08-13 200 000,00 ? 1 1 4 7 5 2020-08-13 2022-08-13 1 000 000,00 ? 2 1 5 1 6 2020-08-13 2021-08-13 600 000,00 ? 2 1 6 6 7 2020-08-13 2021-08-13 500 000,00 ? 2 1 7 6 8 2020-08-13 2021-08-13 600 000,00 ? 2 1 8 3 \. -- -- TOC entry 3212 (class 0 OID 16709) -- Dependencies: 213 -- Data for Name: CrewMember; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."CrewMember" ("PK_CrewMember", "FullName") FROM stdin; 1 <NAME>. 2 <NAME>. 3 <NAME> Е.П. 4 Андреев А.Д. 5 Степнов Е.В. 6 Несваренов Д.Д. 7 Куборкин А.С. 8 Попов П.Д. 9 Соболев А.А. 10 Евгеньев Е.Е. 11 Петров П.П. \. -- -- TOC entry 3210 (class 0 OID 16701) -- Dependencies: 211 -- Data for Name: CrewPosition; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."CrewPosition" ("PK_CrewPosition", "CrewPositionName") FROM stdin; 1 Капитан 2 Помощник капитана 3 Повар 4 Механик 5 Электрик 6 Матрос 7 Радиооператор \. -- -- TOC entry 3220 (class 0 OID 16748) -- Dependencies: 221 -- Data for Name: Dispatcher; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Dispatcher" ("PK_Dispatcher", "FullName", "PersonnelNum", "Salary") FROM stdin; 2 <NAME>. 56-V 100 000,00 ? \. -- -- TOC entry 3204 (class 0 OID 16676) -- Dependencies: 205 -- Data for Name: HREmployee; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."HREmployee" ("PK_HREmployee", "FullName", "PersonnelNum", "Salary") FROM stdin; 1 <NAME> 12-A 80 000,00 ? \. -- -- TOC entry 3202 (class 0 OID 16668) -- Dependencies: 203 -- Data for Name: Port; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Port" ("PK_Port", "PortName") FROM stdin; 1 Барнаул 2 Москва 3 Заринск 4 Нью-Йорк 5 Владивосток 6 Новоссибирск 7 Токио \. -- -- TOC entry 3224 (class 0 OID 16764) -- Dependencies: 225 -- Data for Name: Request; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Request" ("PK_Request", "RequestNum", "PK_Sender", "PK_Receiver", "PK_Trip", "PK_PortReceive", "PK_PortSend", "RequestStatus") FROM stdin; 5 24 1 2 2 1 4 Accepted 4 25 1 4 2 1 3 verifying 6 23 2 4 3 1 2 Refused 7 78 4 5 7 4 1 Accepted \. -- -- TOC entry 3226 (class 0 OID 16777) -- Dependencies: 227 -- Data for Name: RequestLine; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."RequestLine" ("PK_RequestLine", "CargoName", "CargoAmount", "PK_Request") FROM stdin; 9 Шампунь 2000 5 10 Мыло 1000 5 5 Яблоки 1000 4 6 Груши 4000 4 7 Семечки 6000 4 8 Бумага 4000 5 11 Бочка 255 7 12 Кочка 110 7 13 Игуана 350 6 \. -- -- TOC entry 3218 (class 0 OID 16738) -- Dependencies: 219 -- Data for Name: Route; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Route" ("PK_Route", "TimeDuration", "IsFirst", "IsLast", "State", "PK_Trip", "PK_PortReceive", "PK_PortSend") FROM stdin; 2 2 days 01:00:00 t f f 2 1 4 3 1 day 01:00:00 f f f 2 2 1 4 3 days 13:00:00 f f f 2 3 2 5 4 days 04:00:00 f f f 2 6 3 16 3 days 05:00:00 t f f 7 4 1 6 1 day f t f 2 5 6 17 1 day 02:00:00 f t f 7 6 4 \. -- -- TOC entry 3208 (class 0 OID 16692) -- Dependencies: 209 -- Data for Name: Ship; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Ship" ("PK_Ship", "ShipNumber", "ShipName", "PK_ShipType") FROM stdin; 1 ShipNumber ShipName 1 2 007 Карамзин 2 3 0123 testShip 1 \. -- -- TOC entry 3206 (class 0 OID 16684) -- Dependencies: 207 -- Data for Name: ShipType; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."ShipType" ("PK_ShipType", "ShipTypeName", "CarryingCapacity", "AmountCaptains", "AmountCaptainHelpers", "AmountCooks", "AmountMechanics", "AmountElectricians", "AmountSailors", "AmountRadioOperators") FROM stdin; 1 Баржа 5550 1 1 1 1 5 2 1 2 Авианосец 12000 20 1 1 1 1 1 1 3 Катер 500 1 0 1 1 1 1 1 \. -- -- TOC entry 3216 (class 0 OID 16729) -- Dependencies: 217 -- Data for Name: Trip; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public."Trip" ("PK_Trip", "Cost", "UnitPrice", "DateDeparture", "DateArrival", "PK_Ship") FROM stdin; 2 500 000,00 ? 100 000,00 ? 2021-10-12 00:00:00 2021-10-23 19:00:00 2 3 10 000,00 ? 10 000,00 ? 2020-12-12 00:00:00 2020-12-30 00:00:00 1 7 1 500 000,00 ? 11 000,00 ? 2021-04-01 00:00:00 2021-04-05 07:00:00 2 \. -- -- TOC entry 3235 (class 0 OID 16937) -- Dependencies: 236 -- Data for Name: failed_jobs; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.failed_jobs (id, uuid, connection, queue, payload, exception, failed_at) FROM stdin; \. -- -- TOC entry 3230 (class 0 OID 16909) -- Dependencies: 231 -- Data for Name: migrations; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.migrations (id, migration, batch) FROM stdin; 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 \. -- -- TOC entry 3233 (class 0 OID 16928) -- Dependencies: 234 -- Data for Name: password_resets; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.password_resets (email, token, created_at) FROM stdin; \. -- -- TOC entry 3232 (class 0 OID 16917) -- Dependencies: 233 -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.users (id, name, email, email_verified_at, password, remember_token, created_at, updated_at) FROM stdin; 1 a1pha1337 <EMAIL> \N $2y$10$ObkQwCRfIzt1d5fG8.ymEuxVbnrwFQekdA7IVV9YsT23KetLGpY1W \N 2021-01-09 10:27:39 2021-01-09 10:27:39 2 Maximka <EMAIL> \N $2y$10$DfPOtLbv5zdBYbAH7uDKcerbhDmEyc18ECrWBGiQr1W.zjpgH3CI2 \N 2021-01-09 10:53:22 2021-01-09 10:53:22 \. -- -- TOC entry 3259 (class 0 OID 0) -- Dependencies: 222 -- Name: Booker_PK_Booker_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Booker_PK_Booker_seq"', 2, true); -- -- TOC entry 3260 (class 0 OID 0) -- Dependencies: 200 -- Name: Client_PK_Client_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Client_PK_Client_seq"', 5, true); -- -- TOC entry 3261 (class 0 OID 0) -- Dependencies: 228 -- Name: Consignment_PK_Consignment_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Consignment_PK_Consignment_seq"', 14, true); -- -- TOC entry 3262 (class 0 OID 0) -- Dependencies: 214 -- Name: Contract_PK_Contract_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Contract_PK_Contract_seq"', 8, true); -- -- TOC entry 3263 (class 0 OID 0) -- Dependencies: 212 -- Name: CrewMember_PK_CrewMember_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."CrewMember_PK_CrewMember_seq"', 11, true); -- -- TOC entry 3264 (class 0 OID 0) -- Dependencies: 210 -- Name: CrewPosition_PK_CrewPosition_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."CrewPosition_PK_CrewPosition_seq"', 7, true); -- -- TOC entry 3265 (class 0 OID 0) -- Dependencies: 220 -- Name: Dispatcher_PK_Dispatcher_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Dispatcher_PK_Dispatcher_seq"', 2, true); -- -- TOC entry 3266 (class 0 OID 0) -- Dependencies: 204 -- Name: HREmployee_PK_HREmployee_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."HREmployee_PK_HREmployee_seq"', 1, true); -- -- TOC entry 3267 (class 0 OID 0) -- Dependencies: 202 -- Name: Port_PK_Port_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Port_PK_Port_seq"', 7, true); -- -- TOC entry 3268 (class 0 OID 0) -- Dependencies: 226 -- Name: RequestLine_PK_RequestLine_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."RequestLine_PK_RequestLine_seq"', 13, true); -- -- TOC entry 3269 (class 0 OID 0) -- Dependencies: 224 -- Name: Request_PK_Request_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Request_PK_Request_seq"', 7, true); -- -- TOC entry 3270 (class 0 OID 0) -- Dependencies: 218 -- Name: Route_PK_Route_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Route_PK_Route_seq"', 17, true); -- -- TOC entry 3271 (class 0 OID 0) -- Dependencies: 206 -- Name: ShipType_PK_ShipType_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."ShipType_PK_ShipType_seq"', 3, true); -- -- TOC entry 3272 (class 0 OID 0) -- Dependencies: 208 -- Name: Ship_PK_Ship_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Ship_PK_Ship_seq"', 3, true); -- -- TOC entry 3273 (class 0 OID 0) -- Dependencies: 216 -- Name: Trip_PK_Trip_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public."Trip_PK_Trip_seq"', 7, true); -- -- TOC entry 3274 (class 0 OID 0) -- Dependencies: 235 -- Name: failed_jobs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.failed_jobs_id_seq', 1, false); -- -- TOC entry 3275 (class 0 OID 0) -- Dependencies: 230 -- Name: migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.migrations_id_seq', 3, true); -- -- TOC entry 3276 (class 0 OID 0) -- Dependencies: 232 -- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.users_id_seq', 2, true); -- -- TOC entry 3026 (class 2606 OID 16761) -- Name: Booker PK_Booker; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Booker" ADD CONSTRAINT "PK_Booker" PRIMARY KEY ("PK_Booker"); -- -- TOC entry 2996 (class 2606 OID 16665) -- Name: Client PK_Client; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Client" ADD CONSTRAINT "PK_Client" PRIMARY KEY ("PK_Client"); -- -- TOC entry 3039 (class 2606 OID 16792) -- Name: Consignment PK_Consignment; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Consignment" ADD CONSTRAINT "PK_Consignment" PRIMARY KEY ("PK_Consignment", "PK_Request"); -- -- TOC entry 3015 (class 2606 OID 16726) -- Name: Contract PK_Contract; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Contract" ADD CONSTRAINT "PK_Contract" PRIMARY KEY ("PK_Contract"); -- -- TOC entry 3009 (class 2606 OID 16714) -- Name: CrewMember PK_CrewMember; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."CrewMember" ADD CONSTRAINT "PK_CrewMember" PRIMARY KEY ("PK_CrewMember"); -- -- TOC entry 3007 (class 2606 OID 16706) -- Name: CrewPosition PK_CrewPosition; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."CrewPosition" ADD CONSTRAINT "PK_CrewPosition" PRIMARY KEY ("PK_CrewPosition"); -- -- TOC entry 3024 (class 2606 OID 16753) -- Name: Dispatcher PK_Dispatcher; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Dispatcher" ADD CONSTRAINT "PK_Dispatcher" PRIMARY KEY ("PK_Dispatcher"); -- -- TOC entry 3000 (class 2606 OID 16681) -- Name: HREmployee PK_HREmployee; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."HREmployee" ADD CONSTRAINT "PK_HREmployee" PRIMARY KEY ("PK_HREmployee"); -- -- TOC entry 2998 (class 2606 OID 16673) -- Name: Port PK_Port; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Port" ADD CONSTRAINT "PK_Port" PRIMARY KEY ("PK_Port"); -- -- TOC entry 3033 (class 2606 OID 16774) -- Name: Request PK_Request; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ADD CONSTRAINT "PK_Request" PRIMARY KEY ("PK_Request"); -- -- TOC entry 3035 (class 2606 OID 16782) -- Name: RequestLine PK_RequestLine; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."RequestLine" ADD CONSTRAINT "PK_RequestLine" PRIMARY KEY ("PK_RequestLine", "PK_Request"); -- -- TOC entry 3022 (class 2606 OID 16745) -- Name: Route PK_Route; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Route" ADD CONSTRAINT "PK_Route" PRIMARY KEY ("PK_Route", "PK_Trip"); -- -- TOC entry 3005 (class 2606 OID 16698) -- Name: Ship PK_Ship; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Ship" ADD CONSTRAINT "PK_Ship" PRIMARY KEY ("PK_Ship"); -- -- TOC entry 3002 (class 2606 OID 16689) -- Name: ShipType PK_ShipType; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."ShipType" ADD CONSTRAINT "PK_ShipType" PRIMARY KEY ("PK_ShipType"); -- -- TOC entry 3018 (class 2606 OID 16735) -- Name: Trip PK_Trip; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Trip" ADD CONSTRAINT "PK_Trip" PRIMARY KEY ("PK_Trip"); -- -- TOC entry 3048 (class 2606 OID 16946) -- Name: failed_jobs failed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.failed_jobs ADD CONSTRAINT failed_jobs_pkey PRIMARY KEY (id); -- -- TOC entry 3050 (class 2606 OID 16948) -- Name: failed_jobs failed_jobs_uuid_unique; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.failed_jobs ADD CONSTRAINT failed_jobs_uuid_unique UNIQUE (uuid); -- -- TOC entry 3041 (class 2606 OID 16914) -- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.migrations ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); -- -- TOC entry 3043 (class 2606 OID 16927) -- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.users ADD CONSTRAINT users_email_unique UNIQUE (email); -- -- TOC entry 3045 (class 2606 OID 16925) -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.users ADD CONSTRAINT users_pkey PRIMARY KEY (id); -- -- TOC entry 3036 (class 1259 OID 16789) -- Name: IX_Relationship11; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship11" ON public."Consignment" USING btree ("PK_Booker"); -- -- TOC entry 3037 (class 1259 OID 16790) -- Name: IX_Relationship12; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship12" ON public."Consignment" USING btree ("PK_Dispatcher"); -- -- TOC entry 3019 (class 1259 OID 16742) -- Name: IX_Relationship14; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship14" ON public."Route" USING btree ("PK_PortReceive"); -- -- TOC entry 3020 (class 1259 OID 16743) -- Name: IX_Relationship15; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship15" ON public."Route" USING btree ("PK_PortSend"); -- -- TOC entry 3016 (class 1259 OID 16733) -- Name: IX_Relationship16; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship16" ON public."Trip" USING btree ("PK_Ship"); -- -- TOC entry 3003 (class 1259 OID 16696) -- Name: IX_Relationship17; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship17" ON public."Ship" USING btree ("PK_ShipType"); -- -- TOC entry 3010 (class 1259 OID 16721) -- Name: IX_Relationship18; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship18" ON public."Contract" USING btree ("PK_Ship"); -- -- TOC entry 3011 (class 1259 OID 16722) -- Name: IX_Relationship19; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship19" ON public."Contract" USING btree ("PK_HREmployee"); -- -- TOC entry 3012 (class 1259 OID 16723) -- Name: IX_Relationship20; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship20" ON public."Contract" USING btree ("PK_CrewMember"); -- -- TOC entry 3013 (class 1259 OID 16724) -- Name: IX_Relationship21; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship21" ON public."Contract" USING btree ("PK_CrewPosition"); -- -- TOC entry 3027 (class 1259 OID 16768) -- Name: IX_Relationship4; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship4" ON public."Request" USING btree ("PK_Sender"); -- -- TOC entry 3028 (class 1259 OID 16769) -- Name: IX_Relationship5; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship5" ON public."Request" USING btree ("PK_Receiver"); -- -- TOC entry 3029 (class 1259 OID 16770) -- Name: IX_Relationship6; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship6" ON public."Request" USING btree ("PK_Trip"); -- -- TOC entry 3030 (class 1259 OID 16771) -- Name: IX_Relationship7; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship7" ON public."Request" USING btree ("PK_PortReceive"); -- -- TOC entry 3031 (class 1259 OID 16772) -- Name: IX_Relationship9; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX "IX_Relationship9" ON public."Request" USING btree ("PK_PortSend"); -- -- TOC entry 3046 (class 1259 OID 16934) -- Name: password_resets_email_index; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX password_resets_email_index ON public.password_resets USING btree (email); -- -- TOC entry 3066 (class 2606 OID 16818) -- Name: Consignment Relationship10; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Consignment" ADD CONSTRAINT "Relationship10" FOREIGN KEY ("PK_Request") REFERENCES public."Request"("PK_Request") ON UPDATE RESTRICT ON DELETE CASCADE; -- -- TOC entry 3067 (class 2606 OID 16823) -- Name: Consignment Relationship11; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Consignment" ADD CONSTRAINT "Relationship11" FOREIGN KEY ("PK_Booker") REFERENCES public."Booker"("PK_Booker") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3068 (class 2606 OID 16828) -- Name: Consignment Relationship12; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Consignment" ADD CONSTRAINT "Relationship12" FOREIGN KEY ("PK_Dispatcher") REFERENCES public."Dispatcher"("PK_Dispatcher") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3057 (class 2606 OID 16833) -- Name: Route Relationship13; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Route" ADD CONSTRAINT "Relationship13" FOREIGN KEY ("PK_Trip") REFERENCES public."Trip"("PK_Trip") ON UPDATE RESTRICT ON DELETE CASCADE; -- -- TOC entry 3058 (class 2606 OID 16838) -- Name: Route Relationship14; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Route" ADD CONSTRAINT "Relationship14" FOREIGN KEY ("PK_PortReceive") REFERENCES public."Port"("PK_Port") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3059 (class 2606 OID 16843) -- Name: Route Relationship15; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Route" ADD CONSTRAINT "Relationship15" FOREIGN KEY ("PK_PortSend") REFERENCES public."Port"("PK_Port") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3056 (class 2606 OID 16848) -- Name: Trip Relationship16; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Trip" ADD CONSTRAINT "Relationship16" FOREIGN KEY ("PK_Ship") REFERENCES public."Ship"("PK_Ship") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3051 (class 2606 OID 16853) -- Name: Ship Relationship17; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Ship" ADD CONSTRAINT "Relationship17" FOREIGN KEY ("PK_ShipType") REFERENCES public."ShipType"("PK_ShipType") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3052 (class 2606 OID 16858) -- Name: Contract Relationship18; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Contract" ADD CONSTRAINT "Relationship18" FOREIGN KEY ("PK_Ship") REFERENCES public."Ship"("PK_Ship") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3053 (class 2606 OID 16863) -- Name: Contract Relationship19; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Contract" ADD CONSTRAINT "Relationship19" FOREIGN KEY ("PK_HREmployee") REFERENCES public."HREmployee"("PK_HREmployee") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3054 (class 2606 OID 16868) -- Name: Contract Relationship20; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Contract" ADD CONSTRAINT "Relationship20" FOREIGN KEY ("PK_CrewMember") REFERENCES public."CrewMember"("PK_CrewMember") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3055 (class 2606 OID 16873) -- Name: Contract Relationship21; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Contract" ADD CONSTRAINT "Relationship21" FOREIGN KEY ("PK_CrewPosition") REFERENCES public."CrewPosition"("PK_CrewPosition") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3065 (class 2606 OID 16878) -- Name: RequestLine Relationship22; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."RequestLine" ADD CONSTRAINT "Relationship22" FOREIGN KEY ("PK_Request") REFERENCES public."Request"("PK_Request") ON UPDATE RESTRICT ON DELETE CASCADE; -- -- TOC entry 3060 (class 2606 OID 16793) -- Name: Request Relationship4; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ADD CONSTRAINT "Relationship4" FOREIGN KEY ("PK_Sender") REFERENCES public."Client"("PK_Client") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3061 (class 2606 OID 16798) -- Name: Request Relationship5; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ADD CONSTRAINT "Relationship5" FOREIGN KEY ("PK_Receiver") REFERENCES public."Client"("PK_Client") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3062 (class 2606 OID 16803) -- Name: Request Relationship6; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ADD CONSTRAINT "Relationship6" FOREIGN KEY ("PK_Trip") REFERENCES public."Trip"("PK_Trip") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3063 (class 2606 OID 16808) -- Name: Request Relationship7; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ADD CONSTRAINT "Relationship7" FOREIGN KEY ("PK_PortReceive") REFERENCES public."Port"("PK_Port") ON UPDATE RESTRICT ON DELETE RESTRICT; -- -- TOC entry 3064 (class 2606 OID 16813) -- Name: Request Relationship9; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public."Request" ADD CONSTRAINT "Relationship9" FOREIGN KEY ("PK_PortSend") REFERENCES public."Port"("PK_Port") ON UPDATE RESTRICT ON DELETE RESTRICT; -- Completed on 2021-01-09 18:05:24 -- -- PostgreSQL database dump complete --
DROP SCHEMA IF EXISTS Visitors; CREATE SCHEMA Visitors; USE Visitors; DROP TABLE IF EXISTS `visitors`; CREATE TABLE `visitors` ( `id` int NOT NULL PRIMARY KEY AUTO_INCREMENT, `visit_date` date, `people` int ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `visitors` (`visit_date`, `people`) VALUES ('2017-01-01', 10), ('2017-01-02', 109), ('2017-01-03', 150), ('2017-01-04', 99), ('2017-01-05', 145), ('2017-01-06', 1455), ('2017-01-07', 199), ('2017-01-08', 188);
<filename>Homework MySQL and PHP Advanced/carshop/problem8/create_triger.sql CREATE TABLE `total_sales` ( `id` INT NOT NULL AUTO_INCREMENT, `sale_amount` INT NOT NULL, PRIMARY KEY (`id`) ) CREATE DEFINER=`root`@`localhost` TRIGGER `total_sales` BEFORE INSERT ON `sales` FOR EACH ROW BEGIN SET @sum := @sum + NEW.`amount`; INSERT INTO `total_sales` (`sale_amount`) VALUES (@sum); END
<filename>sql/dump_stat.sql CREATE OR REPLACE FUNCTION stat_to_json(relname name) RETURNS SETOF JSON AS ' SELECT row_to_json(p.*) FROM ( WITH stareloid(rn) AS ( SELECT oid FROM pg_class c WHERE c.relname=$1 ) SELECT starelid::regclass AS starelname, a.attname AS staattname, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1::regoperator, staop2::regoperator, staop3::regoperator, staop4::regoperator, staop5::regoperator, stacoll1::regcollation, stacoll2::regcollation, stacoll3::regcollation, stacoll4::regcollation, stacoll5::regcollation, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5 FROM pg_statistic s, pg_attribute a, stareloid WHERE starelid = stareloid.rn AND s.starelid = a.attrelid AND s.staattnum = a.attnum AND s.staattnum = 1 ) AS p; ' LANGUAGE SQL; DROP TABLE IF EXISTS b,b_copy CASCADE; CREATE TABLE b AS SELECT a, ('abc' || a)::text AS payload FROM generate_series(1,342) AS a; ANALYZE b; CREATE TABLE b_copy AS SELECT * FROM b; WITH js1 AS ( SELECT js FROM stat_to_json('b') AS js ) SELECT json_to_record(js1.js) AS t(a text) FROM js1;
update eg_module set enabled = false where name = 'BPA Occupancy Certificate' and contextroot = 'bpa';
-- -- The MIT License -- Copyright (c) 2011 Kuali Mobility Team -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -- THE SOFTWARE. -- insert into KME_GROUP_T (ID,GROUP_NM,GROUP_X) values (1,'KME-ADMINISTRATORS','Default Kuali Mobility Administrator Group'); insert into KME_GROUP_T (ID,GROUP_NM,GROUP_X) values (2,'KME-BACKDOOR','Default Kuali Mobility Backdoor Access Group'); insert into KME_GROUP_T (ID,GROUP_NM,GROUP_X) values (3,'PUBLIC-USERS','A group for all users.'); insert into KME_USER_T (ID,LOGIN_NM,DISPLAY_NM,FIRST_NM,LAST_NM,URL,CAMPUS_ID,EMAIL_ADDR_X) values (1,'mojojojo','Mojo Jojo','mojo','jojo',null,'BL','<EMAIL>'); insert into KME_USER_T (ID,LOGIN_NM,DISPLAY_NM,FIRST_NM,LAST_NM,URL,CAMPUS_ID,EMAIL_ADDR_X) values (2,'fuzzy','F<NAME>','fuzzy','lumpkins',null,'AA','<EMAIL>'); insert into KME_GROUP_MEMBERSHIP_T (USER_ID,GROUP_ID) values (1,3); insert into KME_GROUP_MEMBERSHIP_T (USER_ID,GROUP_ID) values (1,1); insert into KME_GROUP_MEMBERSHIP_T (USER_ID,GROUP_ID) values (2,1); insert into KME_USER_ATTRIBUTE_T (ID,ATTRIBUTE_NM,ATTRIBUTE_X,USER_ID) values (1,'ATTRIBUTE_A','valueA',1); insert into KME_USER_ATTRIBUTE_T (ID,ATTRIBUTE_NM,ATTRIBUTE_X,USER_ID) values (2,'ATTRIBUTE_B','valueB',1); insert into KME_USER_ATTRIBUTE_T (ID,ATTRIBUTE_NM,ATTRIBUTE_X,USER_ID) values (3,'ATTRIBUTE_B','valueD',1); insert into KME_USER_ATTRIBUTE_T (ID,ATTRIBUTE_NM,ATTRIBUTE_X,USER_ID) values (4,'ATTRIBUTE_C','valueC',1); insert into KME_USER_ATTRIBUTE_T (ID,ATTRIBUTE_NM,ATTRIBUTE_X,USER_ID) values (5,'ATTRIBUTE_A','valueB',2); insert into KME_USER_ATTRIBUTE_T (ID,ATTRIBUTE_NM,ATTRIBUTE_X,USER_ID) values (6,'ATTRIBUTE_D','valueE',2); delete from KME_GRADE_ALERTS_T; insert into KME_GRADE_ALERTS_T (ID,USER_ID,RECEIVED_TS,IN_PROCESS_F,PROCESSED_TS) values (1,'bubbles','2013-09-30 18:18:18',false,null); insert into KME_GRADE_ALERTS_T (ID,USER_ID,RECEIVED_TS,IN_PROCESS_F,PROCESSED_TS) values (2,'blossom','2013-09-30 21:21:21',false,null); insert into KME_GRADE_ALERTS_T (ID,USER_ID,RECEIVED_TS,IN_PROCESS_F,PROCESSED_TS) values (3,'bubbles','2013-09-30 19:19:19',true,null); delete from HIBERNATE_SEQUENCES; insert into HIBERNATE_SEQUENCES (SEQUENCE_NAME,SEQUENCE_NEXT_HI_VALUE) values ('KME_USER_T',3); insert into HIBERNATE_SEQUENCES (SEQUENCE_NAME,SEQUENCE_NEXT_HI_VALUE) values ('KME_GROUP_T',4); insert into HIBERNATE_SEQUENCES (SEQUENCE_NAME,SEQUENCE_NEXT_HI_VALUE) values ('KME_USER_ATTRIBUTE_T',7); insert into HIBERNATE_SEQUENCES (SEQUENCE_NAME,SEQUENCE_NEXT_HI_VALUE) values ('KME_GRADE_ALERTS_T',4);
/* This code provides enduring highest NQF (National Qualification Framework) qualification, per person, per year. Subsequent years are filled in with the highest qualification received. eg. if someone obtains a NQF level 3 qualification in 2007 and does no further study, their "highest qualification" will still be recorded as NQF level 3 for 2008 onwards. Likewise, qualifications completed that are lower in level than previous qualifications completed will not count towards the highest qualification. eg. if someone obtains a NQF level 3 qualification in 2007 and obtains an NQF level 1 qualification in 2008, their "highest qualification" will still be recorded as NQF level 3 for 2008 onwards. Qualifications are taken from the primary and secondary school student qualifications dataset (IDI_Clean.moe_clean.student_qualification), the tertiary qualification completions dataset (IDI_Clean.moe_clean.completion), and the industry training education dataset (IDI_Clean.moe_clean.tec_it_learner). The targeted training dataset was not used, as this doesn't contain a qualification completion field. Highest qualification is NQF levels as described follows: 0 = 'NQF level 0' 1 = 'Certificate or NCEA level 1' 2 = 'Certificate or NCEA level 2' 3 = 'Certificate or NCEA level 3' 3.5 = 'Other tertiary qualification' **see issues below 4 = 'Certificate level 4' 5 = 'Certificate or diploma level 5' 6 = 'Certificate or diploma level 6' 7 = 'Bachelors degree, graduate diploma or certificate level 7' 8 = 'Bachelors honours degree or postgraduate diploma or certificate level 8' 9 = 'Masters degree' 10 = 'Doctoral degree' <NAME> 24/11/2017 ==================================== ** ISSUES ** There are approx. 15,000 instances in moe_clean.completion where moe_com_qual_level_code is NULL. These are mainly National diploma/ national certificate levels 5-7, New Zealand diploma, Professional association certificate, or National certificate levels 1-3. I have grouped these into another category - "Other tertiary qualification" for now. This will sit between level 3 and level 4 in rank ie. 3.5. ==================================== */ -- Get highest qualifications per year per snz_uid IF OBJECT_ID('tempdb..#all_quals') IS NOT NULL DROP TABLE #all_quals SELECT quals.snz_uid ,year_nbr ,MAX(qual) AS highest_qual INTO #all_quals FROM ( -- Primary and secondary school qualifications SELECT sq.snz_uid ,moe_sql_attained_year_nbr AS year_nbr ,moe_sql_nqf_level_code AS qual FROM IDI_Clean.moe_clean.student_qualification AS sq UNION ALL --Tertiary qualifications SELECT snz_uid ,moe_com_year_nbr AS year_nbr ,COALESCE(moe_com_qual_level_code, CAST(3.5 AS numeric(3,1))) AS qual -- if null, group into "Other tertiary qualification" which sits between level 3 and level 4 FROM IDI_Clean.moe_clean.completion UNION ALL --Industry training qualifications SELECT snz_uid ,year_nbr ,qual FROM (SELECT snz_uid ,YEAR(moe_itl_end_date) AS year_nbr ,moe_itl_level1_qual_awarded_nbr AS [1] ,moe_itl_level2_qual_awarded_nbr AS [2] ,moe_itl_level3_qual_awarded_nbr AS [3] ,moe_itl_level4_qual_awarded_nbr AS [4] ,moe_itl_level5_qual_awarded_nbr AS [5] ,moe_itl_level6_qual_awarded_nbr AS [6] ,moe_itl_level7_qual_awarded_nbr AS [7] ,moe_itl_level8_qual_awarded_nbr AS [8] FROM IDI_Clean.moe_clean.tec_it_learner ) AS pvt UNPIVOT (qual FOR quals IN ([1],[2],[3],[4],[5],[6],[7],[8]) ) AS unpvt WHERE year_nbr IS NOT NULL AND qual > 0 ) AS quals --Spine only INNER JOIN IDI_Clean.data.personal_detail AS spine ON quals.snz_uid = spine.snz_uid WHERE snz_spine_ind = 1 GROUP BY quals.snz_uid, year_nbr -- Create table with every year from earliest qualification recorded to current year per snz_uid IF OBJECT_ID('tempdb..#qual_years') IS NOT NULL DROP TABLE #qual_years SELECT q.snz_uid ,d.year_nbr INTO #qual_years FROM IDI_Sandpit.pop_exp_dev.dim_date AS d INNER JOIN (SELECT snz_uid, MIN(year_nbr) AS year_nbr FROM #all_quals GROUP BY snz_uid) AS q ON d.year_nbr >= q.year_nbr AND d.year_nbr <= YEAR(GETDATE()) GROUP BY q.snz_uid, d.year_nbr ORDER BY snz_uid, year_nbr -- join the tables into one, with enduring highest qualification IF OBJECT_ID('IDI_Sandpit.intermediate.highest_qualification') IS NOT NULL DROP TABLE IDI_Sandpit.intermediate.highest_qualification GO SELECT y.snz_uid, y.year_nbr, MAX(q.highest_qual) AS highest_qual INTO IDI_Sandpit.intermediate.highest_qualification FROM #qual_years AS y INNER JOIN #all_quals AS q ON y.snz_uid = q.snz_uid AND y.year_nbr >= q.year_nbr GROUP BY y.snz_uid, y.year_nbr
<reponame>scheltwort-it-services/common_schema -- -- Replaces characters in a given text with a given replace-text. -- txt: input text -- from_characters: a text consisting of characters to replace. -- to_str: a string to plant in place of each occurance of a character from from_characters. -- Can be of any length. -- -- example: -- -- SELECT replace_all('red, green, blue;', '; ,', '-') -- Returns: 'red--green--blue-' -- DELIMITER $$ DROP FUNCTION IF EXISTS replace_all $$ CREATE FUNCTION replace_all(txt TEXT CHARSET utf8, from_characters VARCHAR(1024) CHARSET utf8, to_str TEXT CHARSET utf8) RETURNS TEXT CHARSET utf8 DETERMINISTIC NO SQL SQL SECURITY INVOKER COMMENT 'Replace any char in from_characters with to_str ' begin declare counter SMALLINT UNSIGNED DEFAULT 1; while counter <= CHAR_LENGTH(from_characters) do set txt := REPLACE(txt, SUBSTRING(from_characters, counter, 1), to_str); set counter := counter + 1; end while; return txt; end $$ DELIMITER ;
<gh_stars>1000+ UPDATE AD_Message SET Value = 'de.metas.material.dispo.MD_Candidate_Request_MaterialDocument_No_Matching_Records_Selected' WHERE AD_Message_ID=544534; UPDATE AD_Message SET MsgText = 'Es müssen Produktions- oder Verteilungsdatensätze mit Status "geplant" ausgewählt werden.' WHERE AD_Message_ID=544534;
-- Add create institutional proposal, submit institutional proposal permissions to Proposal Submission role insert into KRIM_ROLE_PERM_T (ROLE_PERM_ID, OBJ_ID, VER_NBR, ROLE_ID, PERM_ID, ACTV_IND) values (KRIM_ROLE_PERM_ID_S.NEXTVAL, 'EFEA9886C913436BA189CA7034CB26B4', 1, (select ROLE_ID from KRIM_ROLE_T where ROLE_NM='Proposal Submission'), (select PERM_ID from KRIM_PERM_T where NM='Create Institutional Proposal'), 'Y'); insert into KRIM_ROLE_PERM_T (ROLE_PERM_ID, OBJ_ID, VER_NBR, ROLE_ID, PERM_ID, ACTV_IND) values (KRIM_ROLE_PERM_ID_S.NEXTVAL, 'EA793FFDE412441EB270C4C0D4D8BEA2', 1, (select ROLE_ID from KRIM_ROLE_T where ROLE_NM='Proposal Submission'), (select PERM_ID from KRIM_PERM_T where NM='Submit Institutional Proposal'), 'Y'); -- Add create institutional proposal, submit institutional proposal permissions to Award Modifier role insert into KRIM_ROLE_PERM_T (ROLE_PERM_ID, OBJ_ID, VER_NBR, ROLE_ID, PERM_ID, ACTV_IND) values (KRIM_ROLE_PERM_ID_S.NEXTVAL, '3D4CCEEC-D351-17C6-6DA5-33303E128093', 1, (select ROLE_ID from KRIM_ROLE_T where ROLE_NM='Award Modifier'), (select PERM_ID from KRIM_PERM_T where NM='Create Institutional Proposal'), 'Y'); insert into KRIM_ROLE_PERM_T (ROLE_PERM_ID, OBJ_ID, VER_NBR, ROLE_ID, PERM_ID, ACTV_IND) values (KRIM_ROLE_PERM_ID_S.NEXTVAL, '5890F4B3-CAE4-51F2-10CC-186B0C98CF99', 1, (select ROLE_ID from KRIM_ROLE_T where ROLE_NM='Award Modifier'), (select PERM_ID from KRIM_PERM_T where NM='Submit Institutional Proposal'), 'Y');
<reponame>gbif/openmaptiles -- 3575 views, cut off at Equator CREATE MATERIALIZED VIEW osm_poi_point_3575 AS SELECT (ST_Dump(ST_MakeValid(ST_Transform(t.geometry,3575)))).geom AS geometry, id, osm_id, name, name_en, name_de, tags, subclass, mapping_key, station FROM (SELECT ST_Intersection(ST_GeomFromEWKT('SRID=4326;POLYGON((-180 45,-180 90,180 90,180 45,178 45,176 45,174 45,172 45,170 45,168 45,166 45,164 45,162 45,160 45,158 45,156 45,154 45,152 45,150 45,148 45,146 45,144 45,142 45,140 45,138 45,136 45,134 45,132 45,130 45,128 45,126 45,124 45,122 45,120 45,118 45,116 45,114 45,112 45,110 45,108 45,106 45,104 45,102 45,100 45,98 45,96 45,94 45,92 45,90 45,88 45,86 45,84 45,82 45,80 45,78 45,76 45,74 45,72 45,70 45,68 45,66 45,64 45,62 45,60 45,58 45,56 45,54 45,52 45,50 45,48 45,46 45,44 45,42 45,40 45,38 45,36 45,34 45,32 45,30 45,28 45,26 45,24 45,22 45,20 45,18 45,16 45,14 45,12 45,10 45,8 45,6 45,4 45,2 45,0 45,-2 45,-4 45,-6 45,-8 45,-10 45,-12 45,-14 45,-16 45,-18 45,-20 45,-22 45,-24 45,-26 45,-28 45,-30 45,-32 45,-34 45,-36 45,-38 45,-40 45,-42 45,-44 45,-46 45,-48 45,-50 45,-52 45,-54 45,-56 45,-58 45,-60 45,-62 45,-64 45,-66 45,-68 45,-70 45,-72 45,-74 45,-76 45,-78 45,-80 45,-82 45,-84 45,-86 45,-88 45,-90 45,-92 45,-94 45,-96 45,-98 45,-100 45,-102 45,-104 45,-106 45,-108 45,-110 45,-112 45,-114 45,-116 45,-118 45,-120 45,-122 45,-124 45,-126 45,-128 45,-130 45,-132 45,-134 45,-136 45,-138 45,-140 45,-142 45,-144 45,-146 45,-148 45,-150 45,-152 45,-154 45,-156 45,-158 45,-160 45,-162 45,-164 45,-166 45,-168 45,-170 45,-172 45,-174 45,-176 45,-178 45,-180 45))'), geometry) AS geometry, id, osm_id, name, name_en, name_de, tags, subclass, mapping_key, station FROM osm_poi_point WHERE ST_IsValid(geometry)) AS t; CREATE MATERIALIZED VIEW osm_poi_polygon_3575 AS SELECT (ST_Dump(ST_MakeValid(ST_Transform(t.geometry,3575)))).geom AS geometry, id, osm_id, name, name_en, name_de, tags, subclass, mapping_key, station FROM (SELECT ST_Intersection(ST_GeomFromEWKT('SRID=4326;POLYGON((-180 45,-180 90,180 90,180 45,178 45,176 45,174 45,172 45,170 45,168 45,166 45,164 45,162 45,160 45,158 45,156 45,154 45,152 45,150 45,148 45,146 45,144 45,142 45,140 45,138 45,136 45,134 45,132 45,130 45,128 45,126 45,124 45,122 45,120 45,118 45,116 45,114 45,112 45,110 45,108 45,106 45,104 45,102 45,100 45,98 45,96 45,94 45,92 45,90 45,88 45,86 45,84 45,82 45,80 45,78 45,76 45,74 45,72 45,70 45,68 45,66 45,64 45,62 45,60 45,58 45,56 45,54 45,52 45,50 45,48 45,46 45,44 45,42 45,40 45,38 45,36 45,34 45,32 45,30 45,28 45,26 45,24 45,22 45,20 45,18 45,16 45,14 45,12 45,10 45,8 45,6 45,4 45,2 45,0 45,-2 45,-4 45,-6 45,-8 45,-10 45,-12 45,-14 45,-16 45,-18 45,-20 45,-22 45,-24 45,-26 45,-28 45,-30 45,-32 45,-34 45,-36 45,-38 45,-40 45,-42 45,-44 45,-46 45,-48 45,-50 45,-52 45,-54 45,-56 45,-58 45,-60 45,-62 45,-64 45,-66 45,-68 45,-70 45,-72 45,-74 45,-76 45,-78 45,-80 45,-82 45,-84 45,-86 45,-88 45,-90 45,-92 45,-94 45,-96 45,-98 45,-100 45,-102 45,-104 45,-106 45,-108 45,-110 45,-112 45,-114 45,-116 45,-118 45,-120 45,-122 45,-124 45,-126 45,-128 45,-130 45,-132 45,-134 45,-136 45,-138 45,-140 45,-142 45,-144 45,-146 45,-148 45,-150 45,-152 45,-154 45,-156 45,-158 45,-160 45,-162 45,-164 45,-166 45,-168 45,-170 45,-172 45,-174 45,-176 45,-178 45,-180 45))'), geometry) AS geometry, id, osm_id, name, name_en, name_de, tags, subclass, mapping_key, station FROM osm_poi_polygon WHERE ST_IsValid(geometry)) AS t; CREATE INDEX osm_poi_point_3575_idx ON osm_poi_point_3575 USING gist (geometry); CREATE INDEX osm_poi_polygon_3575_idx ON osm_poi_polygon_3575 USING gist (geometry); -- etldoc: layer_poi[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: label="layer_poi | <z14_> z14+" ] ; CREATE OR REPLACE FUNCTION layer_poi_3575(bbox geometry, zoom_level integer, pixel_width numeric) RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, name_de text, tags hstore, class text, subclass text, "rank" int) AS $$ SELECT osm_id, geometry, NULLIF(name, '') AS name, COALESCE(NULLIF(name_en, ''), name) AS name_en, COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de, tags, poi_class(subclass, mapping_key) AS class, subclass, row_number() OVER ( PARTITION BY LabelGrid(geometry, 100 * pixel_width) ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass, mapping_key)) END ASC )::int AS "rank" FROM ( -- etldoc: osm_poi_point -> layer_poi:z14_ SELECT * FROM osm_poi_point_3575 WHERE geometry && bbox AND zoom_level >= 14 UNION ALL -- etldoc: osm_poi_polygon -> layer_poi:z14_ SELECT * FROM osm_poi_polygon_3575 WHERE geometry && bbox AND zoom_level >= 14 ) as poi_union ORDER BY "rank" ; $$ LANGUAGE SQL IMMUTABLE;
<filename>ntsiot-system/sql/track/cyoubike_appointment_manager.sql create table appointment_manager ( id BIGINT(19) auto_increment primary key, username VARCHAR(255) null comment '姓名', phone VARCHAR(50) null comment '电话', jurisdiction BIGINT(19) null comment '辖区', switch INT(10) null comment '短信开关,1:开启,0关闭', period INT (10) default 0 null comment '短信发送周期,0:每天,1:每周,2:每月', create_time BIGINT(19) null comment '创建时间', update_time BIGINT(19) null comment '修改时间' ) collate = utf8mb4_unicode_ci; INSERT INTO cyoubike.appointment_manager (id, username, phone, jurisdiction, switch, period, create_time, update_time) VALUES (1, '韩宝昆', '18321563426', 25, 0, 1, 15614300152871231, 1581066305791); INSERT INTO cyoubike.appointment_manager (id, username, phone, jurisdiction, switch, period, create_time, update_time) VALUES (2, '王涛', '17612172512', 2, 0, 1, 15614300152871231, 1572623921572); INSERT INTO cyoubike.appointment_manager (id, username, phone, jurisdiction, switch, period, create_time, update_time) VALUES (4, '李朝阳', '18640561230', 2, 0, 2, 1572448061500, 1581066297672);
<reponame>dedmedved/cheburashka CREATE PROC InsertFromDMLDeleteProc AS BEGIN INSERT INTO TableC SELECT B1 , B2 FROM ( DELETE TableB OUTPUT deleted.B1 AS B1 , deleted.B2 AS B2 ) z; INSERT INTO TableC SELECT B1 , B2 FROM ( DELETE TableB OUTPUT deleted.B1 AS B1 , deleted.B2 AS B2 FROM TableB , TableC ) z; DELETE TableB OUTPUT deleted.B1 AS B1 , deleted.B2 AS B2 FROM TableB , TableC END;
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: May 27, 2019 at 06:27 AM -- Server version: 10.1.38-MariaDB -- PHP Version: 7.3.4 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 */; -- -- Database: `u4354245_tanijaya` -- -- -------------------------------------------------------- -- -- Table structure for table `groups` -- CREATE TABLE `groups` ( `id` mediumint(8) UNSIGNED NOT NULL, `name` varchar(20) NOT NULL, `description` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `groups` -- INSERT INTO `groups` (`id`, `name`, `description`) VALUES (1, 'admin', 'Administrator'), (2, 'members', 'General User'); -- -------------------------------------------------------- -- -- Table structure for table `kategori` -- CREATE TABLE `kategori` ( `id` int(11) NOT NULL, `nama` varchar(128) NOT NULL, `foto` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kategori` -- INSERT INTO `kategori` (`id`, `nama`, `foto`) VALUES (1, 'buah', 'buah-buahan.png'), (2, 'rimpang', 'rimpang.png'), (3, 'sayur', '50f8a-ce22f-sayur.jpeg'), (4, 'pangan', 'tanaman-pangan.png'), (5, 'umbi', 'umbi-umbian.png'), (7, 'Kacang', '0f2a1-kacang-hijau.png'); -- -------------------------------------------------------- -- -- Table structure for table `login_attempts` -- CREATE TABLE `login_attempts` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `login` varchar(100) NOT NULL, `time` int(11) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `login_attempts` -- INSERT INTO `login_attempts` (`id`, `ip_address`, `login`, `time`) VALUES (19, '::1', 'Tani Jaya', 1558930073), (20, '::1', 'admin', 1558930077); -- -------------------------------------------------------- -- -- Table structure for table `pembeli` -- CREATE TABLE `pembeli` ( `id` int(11) NOT NULL, `nama` varchar(128) NOT NULL, `alamat` text NOT NULL, `no_hp` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `pengaturan` -- CREATE TABLE `pengaturan` ( `id` int(11) NOT NULL, `nama` varchar(128) NOT NULL, `isi` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `pengaturan` -- INSERT INTO `pengaturan` (`id`, `nama`, `isi`) VALUES (1, 'no_wa', '823929388421'), (2, 'alamat', 'Jl. Jembatan Merah No. 84C Gejayan, \r\nJakarta 55283'), (3, 'ig', 'bungamatahari'); -- -------------------------------------------------------- -- -- Table structure for table `pesanan` -- CREATE TABLE `pesanan` ( `id` int(11) NOT NULL, `id_produk` int(11) NOT NULL, `qty` int(11) NOT NULL, `subtotal` int(11) NOT NULL, `id_pembeli` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `produk` -- CREATE TABLE `produk` ( `id` int(11) NOT NULL, `nama` varchar(128) NOT NULL, `kota` varchar(128) NOT NULL, `harga` int(11) NOT NULL, `per` int(11) NOT NULL, `satuan` varchar(128) NOT NULL, `deskripsi` text NOT NULL, `foto` varchar(128) NOT NULL, `id_kategori` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `produk` -- INSERT INTO `produk` (`id`, `nama`, `kota`, `harga`, `per`, `satuan`, `deskripsi`, `foto`, `id_kategori`) VALUES (1, 'Apel', 'Madura', 450000, 1, 'kg', '<p>\n Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Maecenas sed diam eget risus varius blandit sit amet magna charta.</p>\n', '30296-5ec35-iconfinder_apple_56029.png', 1), (2, 'Tomat', 'Bantul', 240000, 1, 'kg', 'Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Etiam porta sem malesuada magna mollis euismod. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nulla vitae elit libero, a pharetra augue.', 'iconfinder_Tomato_56019.png', 1), (3, 'Pisang', 'Flores', 370000, 2, 'kg', 'Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Maecenas faucibus mollis interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed posuere consectetur est at lobortis.', 'iconfinder_Banana_56018.png', 1), (4, 'Jeruk', 'Sleman', 129000, 1, 'kg', 'Maecenas faucibus mollis interdum. Nullam id dolor id nibh ultricies vehicula ut id elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec sed odio dui. Donec id elit non mi porta gravida at eget metus. Cras justo odio, dapibus ac facilisis in, egestas eget quam.', 'iconfinder_Lemon_56022.png', 1), (5, 'Pear', '<NAME>', 350000, 1, 'kg', 'Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas sed diam eget risus varius blandit sit amet non magna.', 'iconfinder_Pear_56020.png', 1), (7, 'Cherry', 'Ponorogo', 137000, 10, 'kg', '<p>\r\n Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed posuere consectetur est at lobortis. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cras justo odio, dapibus ac facilisis in, egestas eget quam.</p>\r\n', '79fee-iconfinder_cherry_56023.png', 1), (8, 'Kunyit', 'Yogyakarta', 8000, 1, 'kg', '<p>\n Kunyit atau kunyit termasuk tanaman rempah-rempah dan obat asli dari wilayah Asia Tenggara. Tanaman ini kemudian mengalamai penyebaran daerah Malaysia, Indonesia, Australia bahkan Afrika. Kunyit ini mengandung banyak manfaat. Kunyit ini juga sering digunakan sebagai bumbu dalam masakan karena dapat memberikan warna kuning alami pada masakan atau sebagai&nbsp;</p>\n', '', 2), (9, '<NAME>', 'Klaten', 21000, 1, 'kg', '<p>\n Kacang hijau adalah sejenis palawija yang dikenal luas di daerah tropis. Tumbuhan yang termasu ke dalam polong-polongan ini memiliki banyak manfaat dan sebagai sumber bahan pangan berprotein nabati tinggi. Kacang hijau memiliki protein yang cukup tinggi dan merupakan sumber mineral penting antara lain kalsium dan fosfor. sedangkan kandungan lemaknya merupakan asam lemak tak jenuh. K<NAME>au mengandung vitamin B1 yang berguna untuk pertumbuhan dan vitalitas pria. Kacang hijau juga mengandung multi protein yang berfungsi mengganti sel mati dan membantu pertumbuhan sel tubuh, oleh karena itu anak-anak dan wanita pasca melahirkan dianjurkan untuk mengkonsumsinya.</p>\n', '60fe1-kacang-hijau.png', 7), (14, '<NAME>', 'Wonosobo', 12000, 1, 'Kg', '<p>\n Tanaman sawi memilikia nama latin &ldquo; Brassica juncea L.&rdquo; Merupakan tanaman jenis sayuran semusim. ... Oleh karena itu, tanaman sawi ini memiliki morfologi yang hampir sama , terumaanya di bagian akar, batang, daun, bunga, buah dan juga biji.</p>\n', 'd3e09-sawi.png', 3), (15, 'Delima', 'Malang', 35000, 1, 'Kg', '<p>\n Delima adalah tanaman buah-buahan yang dapat tumbuh hingga 5&ndash;8 m. Tanaman ini diperkirakan berasal dari Iran, namun telah lama dikembangbiakkan di&nbsp;</p>\n', 'b429f-delima.png', 1), (18, 'Strawbery', 'Temanggung', 27000, 1, 'Kg', '<p>\n Buah ini dipercaya berasal dari benua Amerika, tepatnya dari daerah yang sekarang bernama Chile. Bentuknya yang manis dan memikat membuat buah&nbsp;</p>\n', '5459b-strawberry_png2598.png', 1), (19, 'Rambutan', 'Sleman', 20000, 1, 'Kg', '<p>\n Rambutan adalah tanaman tropis yang tergolong ke dalam suku lerak-lerakan atau Sapindaceae, berasal dari daerah di Asia Tenggara. Kata &quot;rambutan&quot; berasal&nbsp;</p>\n', 'daa4f-rambutan-600.png', 1), (21, 'Wortel', 'Tawangmangu', 14000, 1, 'Kg', '<p>\n Batang bunga tumbuh setinggi sekitar 1 m, dengan bunga berwarna putih, dan rasa yang manis langu. Bagian yang dapat dimakan dari wortel adalah bagian umbi&nbsp;</p>\n', '690f9-carrots-2667337_1280.png', 3), (22, 'Anggur', 'Bandung', 73000, 1, 'Kg', '<p>\n Anggur merupakan tanaman buah berupa perdu merambat yang termasuk ke dalam keluarga Vitaceae. Buah ini biasanya digunakan untuk membuat jus anggur,&nbsp;</p>\n', 'b2538-grapes.png', 1), (23, 'Kiwi', 'Bogor', 83000, 1, 'Kg', '<p>\n Kiwi adalah sejenis buah beri yang dapat dimakan dari tanaman merambat berkayu dalam genus Actinidia. Actinidia asli berasal dari Shaanxi, Tiongkok.</p>\n', '879bf-kiwi_png4029.png', 1), (24, 'Alpukat', 'Yogyakarta', 35000, 1, 'Kg', '<p>\n Avokad ialah tumbuhan penghasil buah meja dengan nama sama. Tumbuhan ini berasal dari Meksiko dan Amerika Tengah dan kini banyak dibudidayakan di&nbsp;</p>\n', '5b598-alpukat.png', 1), (27, '<NAME>', 'Bantul', 4000, 1, 'Kg', '<p>\n Terung(Solanum melongena, di Pulau Jawa lebih dikenal sebagai terong) adalah tumbuhan penghasil buah yang dijadikan sayur-sayuran. Asalnya adalah India&nbsp;</p>\n', 'e7616-terong.jpeg', 3), (28, '<NAME>', 'Cilacap', 40000, 1, 'Kg', '<p>\n Sawi putih (Brassica rapa Kelompok Pekinensis; suku sawi-sawian atau Brassicaceae ) dikenal sebagai sayuran olahan dalam masakan Tionghoa; karena itu disebut&nbsp;</p>\n', '21ac2-sawi-pitoh.png', 3), (29, 'Petai', 'Magelang', 200000, 1, 'kg', '<p>\n Petai, pete, atau mlanding merupakan pohon tahunan tropika dari suku polong-polongan, anak-suku petai-petaian. Tumbuhan ini tersebar luas di Nusantara bagian barat. Bijinya, yang disebut &quot;petai&quot; juga, dikonsumsi ketika masih muda, baik segar maupun direbus</p>\n', '759ad-petai.png', 3), (30, 'Asparagus', 'Malang', 80000, 1, 'kg', '<p>\r\n Asparagus, dalam pengertian umum, adalah suatu jenis sayuran dari satu spesies tumbuhan genus Asparagus, terutama batang muda dari Asparagus officinalis. ... Asparagus merupakan sumber terbaik asam folat nabati, sangat rendah kalori, tidak mengandung lemak atau kolesterol, serta mengandung sangat sedikit natrium.</p>\r\n', 'e3f70-asparagus.png', 3), (31, 'Pare', 'Malang', 3500, 1, 'kg', '<p>\r\n Peria atau pare adalah tumbuhan merambat yang berasal dari wilayah Asia Tropis, terutama daerah India bagian barat, yaitu Assam dan Burma. Anggota suku labu-labuan atau Cucurbitaceae ini biasa dibudidayakan untuk dimanfaatkan sebagai sayuran maupun bahan pengobatan.Nama Momordica yang melekat pada nama binomialnya berarti &quot;gigitan&quot; yang menunjukkan pemerian tepi daunnya yang bergerigi menyerupai bekas gigitan</p>\r\n', '81de2-pare.png', 3), (32, 'Buncis', 'Wonosobo', 15000, 1, 'kg', '<p>\r\n Tanaman kacang buncis (Phaseolus vulgaris L.) adalah tanaman sayuran polong semusim yang berumur pendek dan merupakan merupakan salah satu tanaman hortikultura yang penting. Tanaman ini bukan berasal dari Indonesia, melainkan berasal dari daerah Amerika Latin dan Amerika Tengah, lalu menyebar ke wilayah Eropa dan Asia.</p>\r\n', 'ecc38-buncis.png', 3), (33, 'Jagung', 'Batu', 8000, 1, 'kg', '<p>\r\n Jagung (Zea mays ssp. mays) adalah salah satu tanaman pangan penghasil karbohidrat yang terpenting di dunia, selain gandum dan padi. Bagi penduduk Amerika Tengah dan Selatan, bulir jagung adalah pangan pokok, sebagaimana bagi sebagian penduduk Afrika dan beberapa daerah di Indonesia. Pada masa kini, jagung juga sudah menjadi komponen penting pakan ternak. Penggunaan lainnya adalah sebagai sumber minyak pangan dan bahan dasar tepung maizena. Berbagai produk turunan hasil jagung menjadi bahan baku berbagai produk industri farmasi, kosmetika, dan kimia.</p>\r\n', '86b87-jagung.png', 4), (34, '<NAME>', 'Yogyakarta', 11000, 1, 'kg', '<p>\r\n <NAME> (Arachis hypogaea L.) adalah tanaman polong-polongan atau legum anggota suku Fabaceae yang dibudidayakan, serta menjadi kacang-kacangan kedua terpenting setelah kedelai di Indonesia.Tanaman yang berasal dari benua Amerika ini tumbuh secara perdu setinggi 30 hingga 50 cm (1 hingga 1&frac12; kaki) dengan daun-daun kecil tersusun majemuk.</p>\r\n', 'b6810-kacang-tanah.png', 7), (35, '<NAME>', 'Yogyakarta', 15000, 1, 'kg', '<p>\r\n Kedelai, atau kacang kedelai, adalah salah satu tanaman jenis polong-polongan yang menjadi bahan dasar banyak makanan dari Asia Timur seperti kecap, tahu, dan tempe. Berdasarkan peninggalan arkeologi, tanaman ini telah dibudidayakan sejak 3500 tahun yang lalu di Asia Timur.</p>\r\n', 'f3663-kacang-kedelai.png', 7), (37, 'Beras', 'Lamongan', 12000, 1, 'kg', '<p>\r\n Padi (bahasa latin: Oryza sativa L.) merupakan salah satu tanaman budidaya terpenting dalam peradaban. Meskipun terutama mengacu pada jenis tanaman budidaya, padi juga digunakan untuk mengacu pada beberapa jenis dari marga (genus) yang sama, yang biasa disebut sebagai padi liar. Padi diduga berasal dari India atau Indocina dan masuk ke Indonesia dibawa oleh nenek moyang yang migrasi dari daratan Asia sekitar 1500 SM.</p>\r\n', 'a44e7-beras.png', 4), (38, '<NAME>', 'Kediri', 3500, 1, 'kg', '<p>\r\n ubi jalar atau dalam bahasa Inggrisnya sweet potato adalah sejenis tanaman budidaya. Bagian yang dimanfaatkan adalah akarnya yang membentuk umbi dengan kadar gizi yang tinggi. Di Afrika, umbi ubi jalar menjadi salah satu sumber makanan pokok yang penting.</p>\r\n', '1833c-ubi-jalar.png', 5), (39, '<NAME>', 'Semarang', 2000, 1, 'kg', '<p>\n singkong adalah nama lokal di kawasan Jawa Barat untuk tanaman ini. Dalam bahasa melayu secara luas disebut ketela pohon. Singkong ini dapat dimasak dengan berbagai cara dan banyak digunakan pada berbagai macam masakan. Direbus untuk menggantikan kentang dan pelengkap masakan. tepung singkong dpat digunakan untuk mengganti tpung gandum, cocok untuk pengidap alergi gluten.</p>\n', 'e03e3-singkong.png', 5), (40, 'Kentang', 'Malang', 18000, 1, 'kg', '<p>\r\n Kentang adalah tanaman dari suku Solanaceae yang memiliki umbi batang yang dapat dimakan dan disebut &quot;kentang&quot; pula. Umbi kentang sekarang telah menjadi salah satu makanan pokok penting di Eropa walaupun pada awalnya didatangkan dari Amerika. Kentang memiliki banyak manfaat dan dapat diolah menjadi aneka macam makanan.</p>\r\n', 'dc4b1-kentang.png', 5), (41, '<NAME>', 'Padang', 85000, 10, 'kg', '<p>\n <span style=\"font-family: arial, sans-serif; font-size: small;\">Singkong adalah perdu tahunan tropika dan subtropika dari suku Euphorbiaceae. Umbinya dikenal luas sebagai makanan pokok penghasil karbohidrat dan daunnya sebagai sayuran.</span></p>\n', 'bb0ac-singkong.jpg', 5); -- -------------------------------------------------------- -- -- Table structure for table `sub_kategori` -- CREATE TABLE `sub_kategori` ( `Id_sub_kategori` int(11) NOT NULL, `nama_sub_kategori` varchar(200) NOT NULL, `id_kategori` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `username` varchar(100) DEFAULT NULL, `password` varchar(255) NOT NULL, `email` varchar(254) NOT NULL, `activation_selector` varchar(255) DEFAULT NULL, `activation_code` varchar(255) DEFAULT NULL, `forgotten_password_selector` varchar(255) DEFAULT NULL, `forgotten_password_code` varchar(255) DEFAULT NULL, `forgotten_password_time` int(11) UNSIGNED DEFAULT NULL, `remember_selector` varchar(255) DEFAULT NULL, `remember_code` varchar(255) DEFAULT NULL, `created_on` int(11) UNSIGNED NOT NULL, `last_login` int(11) UNSIGNED DEFAULT NULL, `active` tinyint(1) UNSIGNED DEFAULT NULL, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(50) DEFAULT NULL, `company` varchar(100) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `email`, `activation_selector`, `activation_code`, `forgotten_password_selector`, `forgotten_password_code`, `forgotten_password_time`, `remember_selector`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES (1, '127.0.0.1', 'administrator', <PASSWORD>', '<EMAIL>', NULL, '', NULL, NULL, NULL, NULL, NULL, 1268889823, 1556130457, 1, 'Admin', 'istrator', 'ADMIN', '0'), (2, '172.16.58.3', '<EMAIL>', <PASSWORD>', '<EMAIL>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1556130524, 1558930134, 1, 'Tani', 'Jaya', 'Tani Jaya', ''); -- -------------------------------------------------------- -- -- Table structure for table `users_groups` -- CREATE TABLE `users_groups` ( `id` int(11) UNSIGNED NOT NULL, `user_id` int(11) UNSIGNED NOT NULL, `group_id` mediumint(8) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_groups` -- INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES (1, 1, 1), (2, 1, 2), (3, 2, 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `groups` -- ALTER TABLE `groups` ADD PRIMARY KEY (`id`); -- -- Indexes for table `kategori` -- ALTER TABLE `kategori` ADD PRIMARY KEY (`id`); -- -- Indexes for table `login_attempts` -- ALTER TABLE `login_attempts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pembeli` -- ALTER TABLE `pembeli` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pengaturan` -- ALTER TABLE `pengaturan` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pesanan` -- ALTER TABLE `pesanan` ADD PRIMARY KEY (`id`); -- -- Indexes for table `produk` -- ALTER TABLE `produk` ADD PRIMARY KEY (`id`), ADD KEY `id_kategori` (`id_kategori`); -- -- Indexes for table `sub_kategori` -- ALTER TABLE `sub_kategori` ADD PRIMARY KEY (`Id_sub_kategori`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_email` (`email`), ADD UNIQUE KEY `uc_activation_selector` (`activation_selector`), ADD UNIQUE KEY `uc_forgotten_password_selector` (`forgotten_password_selector`), ADD UNIQUE KEY `uc_remember_selector` (`remember_selector`); -- -- Indexes for table `users_groups` -- ALTER TABLE `users_groups` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`), ADD KEY `fk_users_groups_users1_idx` (`user_id`), ADD KEY `fk_users_groups_groups1_idx` (`group_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `groups` -- ALTER TABLE `groups` MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `kategori` -- ALTER TABLE `kategori` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `login_attempts` -- ALTER TABLE `login_attempts` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `pembeli` -- ALTER TABLE `pembeli` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `pengaturan` -- ALTER TABLE `pengaturan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `pesanan` -- ALTER TABLE `pesanan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `produk` -- ALTER TABLE `produk` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users_groups` -- ALTER TABLE `users_groups` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `produk` -- ALTER TABLE `produk` ADD CONSTRAINT `produk_ibfk_1` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id`); -- -- Constraints for table `users_groups` -- ALTER TABLE `users_groups` ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; 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 */;
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 02, 2020 at 02:32 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.4 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: `mytesting` -- -- -------------------------------------------------------- -- -- Table structure for table `tb_golongan` -- CREATE TABLE `tb_golongan` ( `id_golongan` int(11) NOT NULL, `n_golongan` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_golongan` -- INSERT INTO `tb_golongan` (`id_golongan`, `n_golongan`) VALUES (1, 'Golongan III'); -- -------------------------------------------------------- -- -- Table structure for table `tb_jabatan` -- CREATE TABLE `tb_jabatan` ( `id_jabatan` int(11) NOT NULL, `n_jabatan` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_jabatan` -- INSERT INTO `tb_jabatan` (`id_jabatan`, `n_jabatan`) VALUES (1, 'BUPATI'), (3, 'WAKIL BUPATI'), (4, 'SEKRETARIS DAERAH'), (5, 'STAF AHLI'), (6, 'ASISTEN DAERAH'), (7, 'SEKRETARIS DINAS/BADAN'), (8, 'KETUA DPRD KABUPATEN TAPANULI SELATAN'), (9, 'STAF'), (10, 'KEPALA SUBBIDANG/SUBBAGIAN/SEKSI'), (11, 'KEPALA DINAS/BADAN'), (12, 'KEPALA BIDANG/BAGIAN'); -- -------------------------------------------------------- -- -- Table structure for table `tb_pegawai` -- CREATE TABLE `tb_pegawai` ( `id_pegawai` int(11) NOT NULL, `nip` bigint(50) NOT NULL, `pegawai_skpd` int(11) DEFAULT NULL, `pegawai_unitkerja` int(11) NOT NULL, `pegawai_jabatan` int(11) NOT NULL, `nama` varchar(40) NOT NULL, `pangkat` varchar(50) NOT NULL, `no_hp` varchar(15) NOT NULL, `foto` text NOT NULL, `create_on` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tb_pegawai` -- INSERT INTO `tb_pegawai` (`id_pegawai`, `nip`, `pegawai_skpd`, `pegawai_unitkerja`, `pegawai_jabatan`, `nama`, `pangkat`, `no_hp`, `foto`, `create_on`) VALUES (1, 12345, 1, 5, 9, '<NAME>', 'Golongan III', '081260721476', '', '2020-04-28 09:47:42'); -- -------------------------------------------------------- -- -- Table structure for table `tb_role` -- CREATE TABLE `tb_role` ( `id_role` int(11) NOT NULL, `role_pegawai` int(11) NOT NULL, `nama_role` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tb_skpd` -- CREATE TABLE `tb_skpd` ( `id_skpd` int(11) NOT NULL, `n_skpd` varchar(100) NOT NULL, `inisial_skpd` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_skpd` -- INSERT INTO `tb_skpd` (`id_skpd`, `n_skpd`, `inisial_skpd`) VALUES (1, 'SEKRETARIAT DAERAH', 'SEKRETARIAT DAERAH'), (2, 'DINAS SOSIAL', 'DINSOS'), (3, 'DINAS PERIKANAN', 'DINAS PERIKANAN'); -- -------------------------------------------------------- -- -- Table structure for table `tb_unit_kerja` -- CREATE TABLE `tb_unit_kerja` ( `id_unitkerja` int(11) NOT NULL, `unitkerja_skpd` int(11) NOT NULL, `n_unitkerja` varchar(100) NOT NULL, `initial_unitkerja` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_unit_kerja` -- INSERT INTO `tb_unit_kerja` (`id_unitkerja`, `unitkerja_skpd`, `n_unitkerja`, `initial_unitkerja`) VALUES (1, 1, '<NAME>', ''), (4, 1, '<NAME>', ''), (5, 1, 'K<NAME>', ''), (6, 1, 'KABAG UMUM DAN PERLENGKAPAN', ''), (7, 1, 'KABAG PEREKONOMIAN DAN SDA', ''), (8, 1, 'KABAG UNIT LAYANAN PENGADAAN', ''); -- -------------------------------------------------------- -- -- Table structure for table `tb_user` -- CREATE TABLE `tb_user` ( `id_user` int(11) NOT NULL, `pegawai_user` int(11) NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, `role_id` int(11) NOT NULL, `is_active` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_user` -- INSERT INTO `tb_user` (`id_user`, `pegawai_user`, `username`, `password`, `role_id`, `is_active`) VALUES (1, 1, 'admin', <PASSWORD>', 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `tb_user_access_menu` -- CREATE TABLE `tb_user_access_menu` ( `id` int(11) NOT NULL, `role_id` int(11) NOT NULL, `menu_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_user_access_menu` -- INSERT INTO `tb_user_access_menu` (`id`, `role_id`, `menu_id`) VALUES (1, 1, 1), (2, 2, 2), (3, 1, 3), (4, 1, 2); -- -------------------------------------------------------- -- -- Table structure for table `tb_user_menu` -- CREATE TABLE `tb_user_menu` ( `id` int(11) NOT NULL, `menu` varchar(50) NOT NULL, `url` varchar(50) NOT NULL, `icon` varchar(50) NOT NULL, `isParent` enum('0','1') NOT NULL, `parent` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_user_menu` -- INSERT INTO `tb_user_menu` (`id`, `menu`, `url`, `icon`, `isParent`, `parent`) VALUES (1, 'Users', '', '', '0', NULL), (2, 'Dashboard', '', 'fa fa-edit', '0', NULL), (3, 'DATA MASTER', '#', 'fa fa-home', '0', NULL), (4, 'MASTER PEGAWAI', 'pegawai', '', '0', NULL), (5, 'REKAPITULASI SURAT', '#', '', '0', NULL), (6, 'Test', '#', 'fa fa-edit', '0', NULL); -- -------------------------------------------------------- -- -- Table structure for table `tb_user_role` -- CREATE TABLE `tb_user_role` ( `id` int(11) NOT NULL, `role` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_user_role` -- INSERT INTO `tb_user_role` (`id`, `role`) VALUES (1, 'Administrator'), (2, 'Member'); -- -------------------------------------------------------- -- -- Table structure for table `tb_user_sub_menu` -- CREATE TABLE `tb_user_sub_menu` ( `id` int(11) NOT NULL, `menu_id` int(11) NOT NULL, `title` varchar(50) NOT NULL, `url` varchar(50) NOT NULL, `icon` varchar(50) NOT NULL, `is_active` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tb_user_sub_menu` -- INSERT INTO `tb_user_sub_menu` (`id`, `menu_id`, `title`, `url`, `icon`, `is_active`) VALUES (1, 3, 'Jabatan', 'jabatan', 'fa fa-user', 1), (2, 3, 'Golongan', 'golongan', 'fa fa-user', 1), (3, 3, 'SKPD', 'skpd', 'fa fa-book', 1), (4, 3, 'Unit Kerja', 'unit_kerja', 'fa fa-book', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `tb_golongan` -- ALTER TABLE `tb_golongan` ADD PRIMARY KEY (`id_golongan`); -- -- Indexes for table `tb_jabatan` -- ALTER TABLE `tb_jabatan` ADD PRIMARY KEY (`id_jabatan`); -- -- Indexes for table `tb_pegawai` -- ALTER TABLE `tb_pegawai` ADD PRIMARY KEY (`id_pegawai`); -- -- Indexes for table `tb_role` -- ALTER TABLE `tb_role` ADD PRIMARY KEY (`id_role`); -- -- Indexes for table `tb_skpd` -- ALTER TABLE `tb_skpd` ADD PRIMARY KEY (`id_skpd`); -- -- Indexes for table `tb_unit_kerja` -- ALTER TABLE `tb_unit_kerja` ADD PRIMARY KEY (`id_unitkerja`); -- -- Indexes for table `tb_user` -- ALTER TABLE `tb_user` ADD PRIMARY KEY (`id_user`); -- -- Indexes for table `tb_user_access_menu` -- ALTER TABLE `tb_user_access_menu` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_user_menu` -- ALTER TABLE `tb_user_menu` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_user_role` -- ALTER TABLE `tb_user_role` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tb_user_sub_menu` -- ALTER TABLE `tb_user_sub_menu` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tb_golongan` -- ALTER TABLE `tb_golongan` MODIFY `id_golongan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_jabatan` -- ALTER TABLE `tb_jabatan` MODIFY `id_jabatan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `tb_pegawai` -- ALTER TABLE `tb_pegawai` MODIFY `id_pegawai` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tb_role` -- ALTER TABLE `tb_role` MODIFY `id_role` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tb_skpd` -- ALTER TABLE `tb_skpd` MODIFY `id_skpd` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tb_unit_kerja` -- ALTER TABLE `tb_unit_kerja` MODIFY `id_unitkerja` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `tb_user` -- ALTER TABLE `tb_user` MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_user_access_menu` -- ALTER TABLE `tb_user_access_menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tb_user_menu` -- ALTER TABLE `tb_user_menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tb_user_role` -- ALTER TABLE `tb_user_role` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tb_user_sub_menu` -- ALTER TABLE `tb_user_sub_menu` 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 */;
<filename>thenovaleague_2015-11-19.sql # ************************************************************ # Sequel Pro SQL dump # Version 4499 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: localhost (MySQL 5.6.26) # Database: thenovaleague # Generation Time: 2015-11-20 04:22:26 +0000 # ************************************************************ /*!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 */; /*!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 */; # Dump of table cycle # ------------------------------------------------------------ DROP TABLE IF EXISTS `cycle`; CREATE TABLE `cycle` ( `cycle_id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(50) NOT NULL, `start_time` datetime NOT NULL, `end_time` datetime NOT NULL, PRIMARY KEY (`cycle_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; LOCK TABLES `cycle` WRITE; /*!40000 ALTER TABLE `cycle` DISABLE KEYS */; INSERT INTO `cycle` (`cycle_id`, `description`, `start_time`, `end_time`) VALUES (1,'Test','2015-11-11 00:00:00','2015-11-25 00:00:00'), (2,'Another test','2015-12-01 00:00:00','2015-12-31 00:00:00'); /*!40000 ALTER TABLE `cycle` ENABLE KEYS */; UNLOCK TABLES; # Dump of table enrollment # ------------------------------------------------------------ DROP TABLE IF EXISTS `enrollment`; CREATE TABLE `enrollment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `cycle_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `username` (`username`), KEY `cycle_id` (`cycle_id`), CONSTRAINT `enrollment_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`), CONSTRAINT `enrollment_ibfk_2` FOREIGN KEY (`cycle_id`) REFERENCES `cycle` (`cycle_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; LOCK TABLES `enrollment` WRITE; /*!40000 ALTER TABLE `enrollment` DISABLE KEYS */; INSERT INTO `enrollment` (`id`, `username`, `cycle_id`) VALUES (14,'xhu98',1), (23,'calantir',1), (24,'anoek',1), (25,'anoek',2), (26,'matburt',2), (27,'matburt',1), (28,'Fairgo',1), (29,'Fairgo',2), (30,'mark5000',1), (31,'YannickYao',1), (32,'calantir',2); /*!40000 ALTER TABLE `enrollment` ENABLE KEYS */; UNLOCK TABLES; # Dump of table game # ------------------------------------------------------------ DROP TABLE IF EXISTS `game`; CREATE TABLE `game` ( `game_id` int(11) NOT NULL AUTO_INCREMENT, `game_date` datetime DEFAULT NULL, `player1` varchar(255) NOT NULL DEFAULT '', `player2` varchar(255) NOT NULL DEFAULT '', `winner` varchar(255) DEFAULT NULL, `url` varchar(50) DEFAULT NULL, PRIMARY KEY (`game_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; LOCK TABLES `game` WRITE; /*!40000 ALTER TABLE `game` DISABLE KEYS */; INSERT INTO `game` (`game_id`, `game_date`, `player1`, `player2`, `winner`, `url`) VALUES (8,'2015-11-19 23:30:00','calantir','mark5000','mark5000','http://www.google.com/'); /*!40000 ALTER TABLE `game` ENABLE KEYS */; UNLOCK TABLES; # Dump of table user # ------------------------------------------------------------ DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `username` varchar(255) NOT NULL DEFAULT '', `userpass` varchar(255) NOT NULL DEFAULT '', `ogs_userid` int(11) NOT NULL, `rating` double NOT NULL, `rank` varchar(5) NOT NULL DEFAULT '', `about` varchar(600) DEFAULT '', PRIMARY KEY (`ogs_userid`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; INSERT INTO `user` (`username`, `userpass`, `ogs_userid`, `rating`, `rank`, `about`) VALUES ('anoek','1234567890',1,923.417,'12k','OGS Developer'), ('matburt','1234567',4,361.305,'18k','OGS Developer'), ('calantir','123456',444,1702.308,'4k','I started playing Go in November 2011'), ('Fairgo','654321',1367,2330.299,'3d','Hola, I\'m currently an AGA 4d. '), ('saxmaam','123567',62763,820.104,'13k','Hi'), ('mark5000','12345678',64817,2205.714,'2d','##Love Your Neighbor\r\n\r\n'), ('xhu98','12345678',69627,2396.837,'3d','I like cats'), ('YannickYao','12345678987654321',93112,1126,'10k','A member of PEA Go/Weiqi Club'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_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 */;
-- === will be used when view all employees is selected === -- SELECT employee.first_name, employee.last_name, role.title, role.salary, department.name, CONCAT(emp.first_name, ' ', emp.last_name) AS Manager FROM employee INNER JOIN role on role.id = employee.role_id INNER JOIN department on department.id = role.department_id left join employee emp on employee.manager_id = emp.id; -- ======= Roles ======= -- SELECT employee.first_name, employee.last_name, role.title AS Title FROM employee JOIN role ON employee.role_id = role.id; -- ======= Departments ======= -- SELECT employee.first_name, employee.last_name, department.name AS Department FROM employee JOIN role ON employee.id = deparmtnet.id JOIN department ON role.department_id = role.department.id ORDER BY employee.id; -- ======= Employees ======= -- SELECT employee.first_name, employee.last_name, department.name AS Department FROM employee JOIN role ON employee.id = role.id JOIN department ON role.department_id = department.id ORDER BY employee.id; -- ======= Managers ======= -- SELECT employee.first_name, employee.last_name, role.title AS Manager FROM employee JOIN role ON employee.manager_id = role.id; -- ======= Utilized Budget ======= -- SELECT department_id AS id, department.name AS Department, SUM(salary) AS Budget FROM role INNER JOIN department ON role.department_id = department.id GROUP BY role.department_id; -- ======= Department Seeds ======= -- INSERT INTO department (name) VALUE ("Sales"); INSERT INTO department (name) VALUE ("Engineering"); INSERT INTO department (name) VALUE ("Finance"); INSERT INTO department (name) VALUE ("Legal"); -- ======= Employee Role Seeds ====== -- INSERT INTO role (title, salary, department_id) VALUE ("Lead Engineer", 150000, 2); INSERT INTO role (title, salary, department_id) VALUE ("Legal Team Lead", 250000, 4); INSERT INTO role (title, salary, department_id) VALUE ("Accountant", 125000, 3); INSERT INTO role (title, salary, department_id) VALUE ("Sales Lead", 100000, 1); INSERT INTO role (title, salary, department_id) VALUE ("Salesperson", 80000, 1); INSERT INTO role (title, salary, department_id) VALUE ("Software Engineer", 120000, 2); INSERT INTO role (title, salary, department_id) VALUE ("Lawyer", 190000, 4); -- ======= Employee Seeds ======= -- INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Peter", "Parker", null, 1); INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Wanda", "Maximoff", null, 2); INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Natasha", "Romanoff", null, 3); INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Tony", "Stark", 1, 4); INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Stever", "Rogers", 4, 5); INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Bruce", "Banner", 1, 6); INSERT INTO employee (first_name, last_name, manager_id, role_id) VALUE ("Thor", "Son of Odin", 2, 7);
<gh_stars>0 -- MySQL dump 10.13 Distrib 5.5.25, for Linux (x86_64) -- -- ------------------------------------------------------ -- Server version 5.5.20-log /*!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 `ORG_STORAGE_CONFIG_STORAGE_CONFIGURATION` -- DROP TABLE IF EXISTS `ORG_STORAGE_CONFIG_STORAGE_CONFIGURATION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ORG_STORAGE_CONFIG_STORAGE_CONFIGURATION` ( `ORG_STORAGE_CONFIG_ID` bigint(20) NOT NULL, `STORAGE_CONFIGURATION_ID` bigint(20) NOT NULL, PRIMARY KEY (`ORG_STORAGE_CONFIG_ID`,`STORAGE_CONFIGURATION_ID`), KEY `RGSTRGCONFIGSTORAGECONFIGURATIONSTRGCNFIGURATIONID` (`STORAGE_CONFIGURATION_ID`), CONSTRAINT `RGSTRAGECONFIGSTORAGECONFIGURATIONRGSTRAGECONFIGID` FOREIGN KEY (`ORG_STORAGE_CONFIG_ID`) REFERENCES `ORG_STORAGE_CONFIG` (`ID`), CONSTRAINT `RGSTRGCONFIGSTORAGECONFIGURATIONSTRGCNFIGURATIONID` FOREIGN KEY (`STORAGE_CONFIGURATION_ID`) REFERENCES `STORAGE_CONFIGURATION` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `GROUP_USER_REQUEST` -- DROP TABLE IF EXISTS `GROUP_USER_REQUEST`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `GROUP_USER_REQUEST` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `STATUS` varchar(255) DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `ORG_GROUP_ID` bigint(20) DEFAULT NULL, `USER_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_GROUP_USER_REQUEST_USER_ID` (`USER_ID`), KEY `FK_GROUP_USER_REQUEST_ORG_GROUP_ID` (`ORG_GROUP_ID`), CONSTRAINT `FK_GROUP_USER_REQUEST_ORG_GROUP_ID` FOREIGN KEY (`ORG_GROUP_ID`) REFERENCES `ORG_GROUP` (`ID`), CONSTRAINT `FK_GROUP_USER_REQUEST_USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `ORG_STORAGE_CONFIG` -- DROP TABLE IF EXISTS `ORG_STORAGE_CONFIG`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ORG_STORAGE_CONFIG` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `PREFIX` varchar(255) NOT NULL, `VERSION` int(11) DEFAULT NULL, `ORGANIZATION_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `PREFIX` (`PREFIX`), KEY `FK_ORG_STORAGE_CONFIG_ORGANIZATION_ID` (`ORGANIZATION_ID`), CONSTRAINT `FK_ORG_STORAGE_CONFIG_ORGANIZATION_ID` FOREIGN KEY (`ORGANIZATION_ID`) REFERENCES `ORGANIZATION` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `USER_ROLE` -- DROP TABLE IF EXISTS `USER_ROLE`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `USER_ROLE` ( `USER_ID` bigint(20) NOT NULL, `ROLE_ID` bigint(20) NOT NULL, PRIMARY KEY (`USER_ID`,`ROLE_ID`), KEY `FK_USER_ROLE_ROLE_ID` (`ROLE_ID`), CONSTRAINT `FK_USER_ROLE_ROLE_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `ROLE` (`ID`), CONSTRAINT `FK_USER_ROLE_USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `APPLICATION` -- DROP TABLE IF EXISTS `APPLICATION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `APPLICATION` ( `ID` bigint(20) NOT NULL, `APPLICATION_TYPE` varchar(255) DEFAULT NULL, `DESCRIPTION` varchar(10000) DEFAULT NULL, `NAME` varchar(255) DEFAULT NULL, `CATEGORY_ID` bigint(20) DEFAULT NULL, `ICON_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_APPLICATION_CATEGORY_ID` (`CATEGORY_ID`), KEY `FK_APPLICATION_ICON_ID` (`ICON_ID`), CONSTRAINT `FK_APPLICATION_ICON_ID` FOREIGN KEY (`ICON_ID`) REFERENCES `APP_FILE` (`ID`), CONSTRAINT `FK_APPLICATION_CATEGORY_ID` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `STORABLE` (`ID`), CONSTRAINT `FK_APPLICATION_ID` FOREIGN KEY (`ID`) REFERENCES `STORABLE` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `APPLICATION_SCREENSHOT` -- DROP TABLE IF EXISTS `APPLICATION_SCREENSHOT`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `APPLICATION_SCREENSHOT` ( `APPLICATION_ID` bigint(20) NOT NULL, `SCREENSHOT_ID` bigint(20) NOT NULL, PRIMARY KEY (`APPLICATION_ID`,`SCREENSHOT_ID`), KEY `FK_APPLICATION_SCREENSHOT_SCREENSHOT_ID` (`SCREENSHOT_ID`), CONSTRAINT `FK_APPLICATION_SCREENSHOT_SCREENSHOT_ID` FOREIGN KEY (`SCREENSHOT_ID`) REFERENCES `APP_FILE` (`ID`), CONSTRAINT `FK_APPLICATION_SCREENSHOT_APPLICATION_ID` FOREIGN KEY (`APPLICATION_ID`) REFERENCES `STORABLE` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `USER` -- DROP TABLE IF EXISTS `USER`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `USER` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `ACTIVATED` tinyint(1) DEFAULT '0', `ACTIVATION_CODE` varchar(255) DEFAULT NULL, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `EMAIL` varchar(255) DEFAULT NULL, `FIRST_NAME` varchar(255) DEFAULT NULL, `FULL_NAME` varchar(255) DEFAULT NULL, `LAST_NAME` varchar(255) DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `PASSWORD` varchar(255) DEFAULT NULL, `PASSWORD_EXPIRED` tinyint(1) DEFAULT '0', `USERNAME` varchar(255) DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `USERNAME` (`USERNAME`) ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `ORG_GROUP` -- DROP TABLE IF EXISTS `ORG_GROUP`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ORG_GROUP` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `ACCESS_CODE` varchar(255) DEFAULT NULL, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `DOMAIN_TYPE` varchar(255) DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `NAME` varchar(255) DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `ORGANIZATION_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UNQ_ORG_GROUP_0` (`NAME`,`ORGANIZATION_ID`), KEY `FK_ORG_GROUP_ORGANIZATION_ID` (`ORGANIZATION_ID`), CONSTRAINT `FK_ORG_GROUP_ORGANIZATION_ID` FOREIGN KEY (`ORGANIZATION_ID`) REFERENCES `ORGANIZATION` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `APPLICATION_VERSION` -- DROP TABLE IF EXISTS `APPLICATION_VERSION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `APPLICATION_VERSION` ( `ID` bigint(20) NOT NULL, `APP_STATE` varchar(255) DEFAULT NULL, `CF_BUNDLE_IDENTIFIER` varchar(255) DEFAULT NULL, `CF_BUNDLE_NAME` varchar(255) DEFAULT NULL, `CF_BUNDLE_VERSION` varchar(255) DEFAULT NULL, `RECENT_CHANGES` varchar(10000) DEFAULT NULL, `VERSION_NAME` varchar(255) DEFAULT NULL, `APPLICATION_ID` bigint(20) DEFAULT NULL, `INSTALLATION_FILE_ID` bigint(20) DEFAULT NULL, `PROVISIONING_PROFILE_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_APPLICATION_VERSION_PROVISIONING_PROFILE_ID` (`PROVISIONING_PROFILE_ID`), KEY `FK_APPLICATION_VERSION_APPLICATION_ID` (`APPLICATION_ID`), KEY `FK_APPLICATION_VERSION_INSTALLATION_FILE_ID` (`INSTALLATION_FILE_ID`), CONSTRAINT `FK_APPLICATION_VERSION_INSTALLATION_FILE_ID` FOREIGN KEY (`INSTALLATION_FILE_ID`) REFERENCES `APP_FILE` (`ID`), CONSTRAINT `FK_APPLICATION_VERSION_APPLICATION_ID` FOREIGN KEY (`APPLICATION_ID`) REFERENCES `STORABLE` (`ID`), CONSTRAINT `FK_APPLICATION_VERSION_ID` FOREIGN KEY (`ID`) REFERENCES `STORABLE` (`ID`), CONSTRAINT `FK_APPLICATION_VERSION_PROVISIONING_PROFILE_ID` FOREIGN KEY (`PROVISIONING_PROFILE_ID`) REFERENCES `APP_FILE` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `STORAGE_CONFIGURATION` -- DROP TABLE IF EXISTS `STORAGE_CONFIGURATION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `STORAGE_CONFIGURATION` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `DISCRIMINATOR` varchar(31) DEFAULT NULL, `BASE_LOCATION` varchar(255) DEFAULT NULL, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `NAME` varchar(255) NOT NULL, `STORAGE_TYPE` varchar(255) DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `ACCESS_KEY` varchar(255) DEFAULT NULL, `BUCKET_NAME` varchar(255) DEFAULT NULL, `SECRET_KEY` varchar(255) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `NAME` (`NAME`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `ORG_GROUP_GUEST_APPLICATION_VERSION` -- DROP TABLE IF EXISTS `ORG_GROUP_GUEST_APPLICATION_VERSION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ORG_GROUP_GUEST_APPLICATION_VERSION` ( `ORG_GROUP_ID` bigint(20) NOT NULL, `APPLICATION_VERSION_ID` bigint(20) NOT NULL, PRIMARY KEY (`ORG_GROUP_ID`,`APPLICATION_VERSION_ID`), KEY `RGGROUPGUESTAPPLICATIONVERSIONAPPLICATIONVERSIONID` (`APPLICATION_VERSION_ID`), CONSTRAINT `ORG_GROUP_GUEST_APPLICATION_VERSION_ORG_GROUP_ID` FOREIGN KEY (`ORG_GROUP_ID`) REFERENCES `ORG_GROUP` (`ID`), CONSTRAINT `RGGROUPGUESTAPPLICATIONVERSIONAPPLICATIONVERSIONID` FOREIGN KEY (`APPLICATION_VERSION_ID`) REFERENCES `STORABLE` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `CATEGORY` -- DROP TABLE IF EXISTS `CATEGORY`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `CATEGORY` ( `ID` bigint(20) NOT NULL, `DESCRIPTION` varchar(255) DEFAULT NULL, `NAME` varchar(255) DEFAULT NULL, `ORGANIZATION_ID` bigint(20) DEFAULT NULL, `ICON_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_CATEGORY_ICON_ID` (`ICON_ID`), KEY `FK_CATEGORY_ORGANIZATION_ID` (`ORGANIZATION_ID`), CONSTRAINT `FK_CATEGORY_ORGANIZATION_ID` FOREIGN KEY (`ORGANIZATION_ID`) REFERENCES `ORGANIZATION` (`ID`) ON DELETE CASCADE, CONSTRAINT `FK_CATEGORY_ICON_ID` FOREIGN KEY (`ICON_ID`) REFERENCES `APP_FILE` (`ID`), CONSTRAINT `FK_CATEGORY_ID` FOREIGN KEY (`ID`) REFERENCES `STORABLE` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `ORG_GROUP_APPLICATION` -- DROP TABLE IF EXISTS `ORG_GROUP_APPLICATION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ORG_GROUP_APPLICATION` ( `ORG_GROUP_ID` bigint(20) NOT NULL, `APPLICATION_ID` bigint(20) NOT NULL, PRIMARY KEY (`ORG_GROUP_ID`,`APPLICATION_ID`), KEY `FK_ORG_GROUP_APPLICATION_APPLICATION_ID` (`APPLICATION_ID`), CONSTRAINT `FK_ORG_GROUP_APPLICATION_ORG_GROUP_ID` FOREIGN KEY (`ORG_GROUP_ID`) REFERENCES `ORG_GROUP` (`ID`) ON DELETE CASCADE, CONSTRAINT `FK_ORG_GROUP_APPLICATION_APPLICATION_ID` FOREIGN KEY (`APPLICATION_ID`) REFERENCES `STORABLE` (`ID`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `USER_OPENIDIDENTIFIER` -- DROP TABLE IF EXISTS `USER_OPENIDIDENTIFIER`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `USER_OPENIDIDENTIFIER` ( `USER_ID` bigint(20) DEFAULT NULL, `OPENIDIDENTIFIER` varchar(255) DEFAULT NULL, KEY `FK_USER_OPENIDIDENTIFIER_USER_ID` (`USER_ID`), CONSTRAINT `FK_USER_OPENIDIDENTIFIER_USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `ROLE` -- DROP TABLE IF EXISTS `ROLE`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ROLE` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `AUTHORITY` varchar(255) DEFAULT NULL, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `APP_FILE` -- DROP TABLE IF EXISTS `APP_FILE`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `APP_FILE` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `NAME` varchar(255) DEFAULT NULL, `RELATIVE_PATH` varchar(255) DEFAULT NULL, `STORAGE_TYPE` varchar(255) DEFAULT NULL, `TYPE` varchar(255) DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `STORABLE_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_APP_FILE_STORABLE_ID` (`STORABLE_ID`), CONSTRAINT `FK_APP_FILE_STORABLE_ID` FOREIGN KEY (`STORABLE_ID`) REFERENCES `STORABLE` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `INVITATION` -- DROP TABLE IF EXISTS `INVITATION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `INVITATION` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `DOMAIN_ID` bigint(20) DEFAULT NULL, `DOMAIN_TYPE` varchar(255) DEFAULT NULL, `EMAIL` varchar(255) DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `ROLE_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UNQ_INVITATION_0` (`EMAIL`,`DOMAIN_TYPE`,`DOMAIN_ID`,`ROLE_ID`), KEY `FK_INVITATION_ROLE_ID` (`ROLE_ID`), CONSTRAINT `FK_INVITATION_ROLE_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `ROLE` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `ORGANIZATION` -- DROP TABLE IF EXISTS `ORGANIZATION`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ORGANIZATION` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `ACCESS_CODE` varchar(255) DEFAULT NULL, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `DOMAIN_TYPE` varchar(255) DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `NAME` varchar(255) NOT NULL, `VERSION` int(11) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `NAME` (`NAME`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `USER_DOMAIN` -- DROP TABLE IF EXISTS `USER_DOMAIN`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `USER_DOMAIN` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `DOMAIN_ID` bigint(20) DEFAULT NULL, `DOMAIN_TYPE` varchar(255) DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `USER_ID` bigint(20) DEFAULT NULL, `ROLE_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UNQ_USER_DOMAIN_0` (`DOMAIN_TYPE`,`DOMAIN_ID`,`ROLE_ID`,`USER_ID`), KEY `FK_USER_DOMAIN_USER_ID` (`USER_ID`), KEY `FK_USER_DOMAIN_ROLE_ID` (`ROLE_ID`), CONSTRAINT `FK_USER_DOMAIN_ROLE_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `ROLE` (`ID`), CONSTRAINT `FK_USER_DOMAIN_USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `STORABLE` -- DROP TABLE IF EXISTS `STORABLE`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `STORABLE` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `DISCRIMINATOR` varchar(31) DEFAULT NULL, `CHANGED_BY` varchar(255) DEFAULT NULL, `CREATE_DATE` date DEFAULT NULL, `LAST_UPDATE` date DEFAULT NULL, `UUID` varchar(255) DEFAULT NULL, `VERSION` int(11) DEFAULT NULL, `STORAGE_CONFIGURATION_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_STORABLE_STORAGE_CONFIGURATION_ID` (`STORAGE_CONFIGURATION_ID`), CONSTRAINT `FK_STORABLE_STORAGE_CONFIGURATION_ID` FOREIGN KEY (`STORAGE_CONFIGURATION_ID`) REFERENCES `STORAGE_CONFIGURATION` (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!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 2012-06-11 9:34:06
CREATE TABLE SupplierPpeTypes ( SupplierId bigint NOT NULL, PpeTypeId tinyint NOT NULL, PpeTypeOther nvarchar(max), CostTypeId int NOT NULL, CostTypeOther nvarchar(500), CapacityPerWeek int NOT NULL, CurrentStock int NOT NULL, LeadTimeInDays int NOT NULL, Notes nvarchar(max), MeetsRegulatoryRequirementsId int NOT NULL, CONSTRAINT PK_SupplierPpeTypes PRIMARY KEY CLUSTERED (SupplierId, PpeTypeId), CONSTRAINT FK_SupplierPpeTypes_Suppliers FOREIGN KEY (SupplierId) REFERENCES Suppliers (Id) ON DELETE CASCADE, CONSTRAINT FK_SupplierPpeTypes_PpeTypes FOREIGN KEY (PpeTypeId) REFERENCES PpeTypes (Id) ON DELETE CASCADE )
<filename>CSharp DB Fundamentals MSSQL/DataAggregation/DataAggregation/06.DepositSumForOllivanderFamily.sql USE Gringotts SELECT DepositGroup, SUM(DepositAmount) AS [total Sum] FROM WizzardDeposits WHERE MagicWandCreator = '<NAME>' GROUP BY DepositGroup
begin; update testset set test_type='tpc-b' where info like 'tpc-b%' ; update testset set test_type='select' where info like 'select%' ; commit;
create table log.journal ( dt_clock timestamptz not null default clock_timestamp(), dt_trans timestamptz not null default current_timestamp(), site_id bigint, domain text, event text );
<gh_stars>1-10 WITH queries AS ( SELECT userid, xid, pid, starttime, endtime, DATEDIFF(sec, starttime, endtime) AS elapsed_time, "sequence", "type" AS query_type, TRIM(text) AS text FROM svl_statementtext WHERE xid = __xid__ ) SELECT TRIM(usename) AS user_name, queries.* FROM queries INNER JOIN pg_user ON queries.userid = pg_user.usesysid ORDER BY starttime, "sequence"
-- ---------------------------- -- Records of msg_email_config -- ---------------------------- INSERT INTO `msg_email_config` VALUES ('1', '默认配置', 'smtp.qq.com', '<EMAIL>', 'nmyytnzwadukcahh', '1', '1', '2019-07-17 15:42:43', '2019-07-17 15:42:46'); -- ---------------------------- -- Records of msg_email_template -- ---------------------------- INSERT INTO `msg_email_template` VALUES ('1', 'test', '1', '测试{a}数据', '{\"a\":\"\"}', '2019-07-17 15:42:58', '2019-07-17 15:43:01');
<gh_stars>1-10 CREATE TABLE aaa (id INT NOT NULL); ALTER TABLE aaa ADD PRIMARY KEY (id), LOCK=SHARED; -- ^^^^^^^^^^^ This
prompt not installing &&1
-- 2020-07-08T15:11:00.989Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577789,0,'IsReceiveAsSourceHU',TO_TIMESTAMP('2020-07-08 18:11:00','YYYY-MM-DD HH24:MI:SS'),100,'Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.','de.metas.handlingunits','Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.','Y','Als Quell-HU annehmen','Als Quell-HU annehmen',TO_TIMESTAMP('2020-07-08 18:11:00','YYYY-MM-DD HH24:MI:SS'),100) ; -- 2020-07-08T15:11:01.009Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577789 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) ; -- 2020-07-08T15:11:41.245Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Element_Trl SET Description='Automatically marks all received HUs carrying BOM components as ''Source HUs''.', Help='Automatically marks all received HUs carrying BOM components as ''Source HUs''.', Name='Receive as Source HU', PrintName='Receive as Source HU',Updated=TO_TIMESTAMP('2020-07-08 18:11:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577789 AND AD_Language='en_US' ; -- 2020-07-08T15:11:41.292Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577789,'en_US') ; -- 2020-07-08T15:12:24.886Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Column (AD_Reference_ID,DefaultValue,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,IsEncrypted,Updated,UpdatedBy,IsAdvancedText,IsLazyLoading,AD_Table_ID,IsCalculated,Help,AD_Column_ID,IsDimension,IsMandatory,IsStaleable,IsUseDocSequence,IsRangeFilter,IsShowFilterIncrementButtons,IsDLMPartitionBoundary,IsGenericZoomKeyColumn,SelectionColumnSeqNo,IsForceIncludeInGeneratedModel,IsGenericZoomOrigin,ColumnName,IsAutoApplyValidationRule,Name,AD_Org_ID,Description,FacetFilterSeqNo,MaxFacetsToFetch,IsFacetFilter,AD_Element_ID,EntityType) VALUES (20,'N',1,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-07-08 18:12:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N','N','Y','N',TO_TIMESTAMP('2020-07-08 18:12:24','YYYY-MM-DD HH24:MI:SS'),100,'N','N',190,'N','Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.',570909,'N','Y','N','N','N','N','N','N',0,'N','N','IsReceiveAsSourceHU','N','Als Quell-HU annehmen',0,'Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.',0,0,'N',577789,'de.metas.handlingunits') ; -- 2020-07-08T15:12:24.888Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=570909 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) ; -- 2020-07-08T15:12:24.892Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ select update_Column_Translation_From_AD_Element(577789) ; -- 2020-07-08T15:14:11.199Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ SELECT public.db_alter_table('M_Warehouse','ALTER TABLE public.M_Warehouse ADD COLUMN IsReceiveAsSourceHU CHAR(1) DEFAULT ''N'' CHECK (IsReceiveAsSourceHU IN (''Y'',''N'')) NOT NULL') ; -- 2020-07-08T15:16:10.702Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,570909,615224,0,177,0,TO_TIMESTAMP('2020-07-08 18:16:10','YYYY-MM-DD HH24:MI:SS'),100,'Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.',0,'de.metas.handlingunits','Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.',0,'Y','Y','Y','N','N','N','N','N','Als Quell-HU annehmen',220,190,0,1,1,TO_TIMESTAMP('2020-07-08 18:16:10','YYYY-MM-DD HH24:MI:SS'),100) ; -- 2020-07-08T15:16:10.706Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=615224 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) ; -- 2020-07-08T15:16:10.717Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ select update_FieldTranslation_From_AD_Name_Element(577789) ; -- 2020-07-08T15:16:10.728Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator DELETE FROM AD_Element_Link WHERE AD_Field_ID=615224 ; -- 2020-07-08T15:16:10.735Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ select AD_Element_Link_Create_Missing_Field(615224) ; -- 2020-07-08T15:16:54.938Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,615224,0,177,570252,540174,'F',TO_TIMESTAMP('2020-07-08 18:16:54','YYYY-MM-DD HH24:MI:SS'),100,'Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.','Alle empfangenen HUs mit Stücklistenbestandteilen werden automatisch als ''Quell-HUs'' gekennzeichnet.','Y','N','N','Y','N','N','N',0,'Als Quell-HU annehmen',90,0,0,TO_TIMESTAMP('2020-07-08 18:16:54','YYYY-MM-DD HH24:MI:SS'),100) ; -- 2020-07-08T15:21:17.784Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2020-07-08 18:21:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570909 ;
Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-AB','D','D3C1CEB4A1A645EBA83AA4EAD246AA25',1,'Document','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-AWARD','A','8D2232910ACB40B1A0054A1524F41B6C',1,'All','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-AWARD','D','8A1FEC0A24974EA4AFE06B92DC9E0F64',1,'Document','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-GEN','A','5BBB6B8601534307AB917F09846BC18B',1,'All','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-GEN','D','8987E26AF90242E5B57DF760EADB9A4D',1,'Document','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-IP','D','BCEA42AF0E7B4FB2959331D603582446',1,'Document','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KC-T','D','564A1151F4F94BC389B30AE9FCAC5CAB',1,'Document','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KR-IDM','PersonDocumentName','DC765D5CFF414A9DB60CCAA743D06C76',1,'Person Document Name','Y'); Insert into KRNS_PARM_DTL_TYP_T ( nmspc_cd, parm_dtl_typ_cd, OBJ_ID, VER_NBR, NM, ACTV_IND) Values ('KR-WKFLW','DocSearchCriteriaDTO','669A821CEB5945AFA9C0CA33923997D9',1,'Document Search','Y'); update KRNS_PARM_DTL_TYP_T set PARM_DTL_TYP_CD = 'EDocLite' where NMSPC_CD='KR-WKFLW' and PARM_DTL_TYP_CD like 'EDocLite %';
<reponame>Laurent-c4/IP-WILDLIFE-TRACKER CREATE DATABASE wildlife_tracker; \c wildlife_tracker; CREATE TABLE fauna_species (id SERIAL PRIMARY KEY, name VARCHAR, type VARCHAR); CREATE TABLE animals (id SERIAL PRIMARY KEY, name VARCHAR, type VARCHAR, health VARCHAR, age VARCHAR, animalid INTEGER); CREATE TABLE sightings (id SERIAL PRIMARY KEY, animalid INTEGER, location VARCHAR, rangername VARCHAR, sighted TIMESTAMP); CREATE DATABASE wildlife_tracker_test WITH TEMPLATE wildlife_tracker;
CREATE OR REPLACE VIEW public.master_attribute_summary AS SELECT trip.code AS trip_code, s.code AS set_code, trip.id AS trip_id, s.id AS set_id, s.reef_habitat_id, mas.id AS video_id, mst.id AS master_status_id, mst.name AS master_status, obs.id AS observation_id, obs.type AS observation_type, evt.id AS event_id, aobs.animal_id, evt.event_time, ((((lpad((((evt.event_time / 1000) / 60))::text, 3, '0'::text) || ':'::text) || lpad((((evt.event_time / 1000) % 60))::text, 2, '0'::text)) || ':'::text) || lpad(((evt.event_time % 1000))::text, 3, '0'::text)) AS event_time_minutes, CASE WHEN (evt.note = 'Time on seabed'::text) THEN 1 ELSE 0 END AS zero_time_em_note, CASE WHEN (evt.note = 'Time off seabed'::text) THEN 1 ELSE 0 END AS haul_time_em_note, CASE WHEN (EXISTS ( SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id = 16) AND (evtat.masterevent_id = evt.id)))) THEN 1 ELSE 0 END AS zero_time_tagged, CASE WHEN (EXISTS ( SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id = 33) AND (evtat.masterevent_id = evt.id)))) THEN 1 ELSE 0 END AS sixty_minute_time_tagged, CASE WHEN (EXISTS ( SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id = 24) AND (evtat.masterevent_id = evt.id)))) THEN 1 ELSE 0 END AS ninty_minute_time_tagged, CASE WHEN (EXISTS ( SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id = 23) AND (evtat.masterevent_id = evt.id)))) THEN 1 ELSE 0 END AS haul_time_tagged, CASE WHEN (EXISTS ( SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id = 13) AND (evtat.masterevent_id = evt.id)))) THEN 1 ELSE 0 END AS max_n_tagged, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=31) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS bait_gone, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=3) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS courtship_or_mating, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=18) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS female_identified, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=19) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS male_identified, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=21) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS feeding, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=7) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS fouled, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=28) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS guarding_bait, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=34) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS human_activity, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=32) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS parasites, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=26) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS passing, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=41) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS reviewed_for_sharks, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=22) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS same_species_interaction, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=30) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS scavenging, CASE WHEN (EXISTS (SELECT evtat.id FROM annotation_masterevent_attribute evtat WHERE ((evtat.attribute_id=5) AND (evtat.masterevent_id=evt.id)))) THEN 1 ELSE 0 END AS wounded, "substring"(evt.note, '[0-9]+'::text) AS numeric_value_from_event_note, "substring"(obs.comment, '[0-9]+'::text) AS numeric_value_from_obs_comment, evt.note AS event_note, obs.comment AS observation_comment, mas.id AS master_record_id, mst.id AS master_record_state_id, mst.name AS master_record_state FROM ((((((trip_trip trip JOIN bruv_set s ON ((s.trip_id = trip.id))) JOIN annotation_masterrecord mas ON ((mas.set_id = s.id))) JOIN annotation_masterrecordstate mst ON ((mst.id = mas.status_id))) JOIN annotation_masterobservation obs ON ((obs.master_record_id = mas.id))) JOIN annotation_masterevent evt ON ((evt.master_observation_id = obs.id))) LEFT JOIN annotation_masteranimalobservation aobs ON ((aobs.master_observation_id = obs.id)));
<gh_stars>0 SET @current_time = NOW(); SET @game_type=1; SELECT @@global.time_zone; SET @@global.time_zone = '+01:00'; SELECT UNIX_TIMESTAMP(), NOW(); # Pridobimo naslednji cikel za določen tip igre SELECT tc.id, tc.from_timestamp, tc.to_timestamp FROM task_cycle AS tc WHERE tc.from_timestamp > @current_time AND tc.task_type_id=@game_type ORDER BY tc.from_timestamp limit 10; SET @task_cyc_id = 12002; # Najdemo vse taske za ta cikel # Najdemo besede, ki se prikažejo SELECT t.id, t.position as "t_position", w.text, csw.position as "csw_position", cs.structure_id as "structure_id", s.text as "structure_text" FROM task AS t JOIN collocation_shell AS cs JOIN collocation_shell_word AS csw JOIN word AS w JOIN structure as s ON cs.id = t.collocation_shell_id AND csw.collocation_shell_id = t.collocation_shell_id AND w.id = csw.word_id AND s.id = cs.structure_id WHERE t.task_cycle_id=@task_cyc_id ORDER BY t.position; # Dobili smo vse task_id => primer: "delo" SET @task_id=65148; # poiščemo še vse možne odgovore: SELECT tpa.id, w.text, tpa.score, tpa.group_position FROM task_possible_answer AS tpa JOIN possible_answer AS pa JOIN linguistic_unit AS lu JOIN word AS w ON tpa.possible_answer_id=pa.id AND pa.linguistic_unit_id=lu.id AND w.linguistic_unit_id=lu.id WHERE tpa.task_id=@task_id ORDER BY tpa.score DESC;
DROP TABLE IF EXISTS ${TARGET_DB}.${NAMESPACE}tbl_rainbow_schema; CREATE TABLE ${TARGET_DB}.${NAMESPACE}tbl_rainbow_schema ( id VARCHAR(256), timestamp_value TIMESTAMP, int_value INT );
ALTER TABLE tb_cerveja ADD foto VARCHAR(100), ADD content_type VARCHAR(100);
<filename>identity-core/identity-core-test/src/main/resources/com/sflpro/identity/test/db/resource.sql insert into resource(id, type, identifier, created, updated) values (1, 'customer', '1', now(), now());
<gh_stars>1-10 select name, dest_range, description, kind, network, self_link from gcp.gcp_compute_route where name = '{{ resourceName }}'
CREATE ROLE scalafiddle; CREATE DATABASE scalafiddle; -- log in to scalafiddle DB CREATE TABLE "fiddle" ( "id" VARCHAR NOT NULL, "version" INTEGER NOT NULL, "name" VARCHAR NOT NULL, "description" VARCHAR NOT NULL, "sourcecode" VARCHAR NOT NULL, "libraries" VARCHAR NOT NULL, "scala_version" VARCHAR NOT NULL, "user" VARCHAR NOT NULL, "parent" VARCHAR, "created" BIGINT NOT NULL, "removed" BOOLEAN NOT NULL ); CREATE TABLE "user" ( "user_id" VARCHAR NOT NULL, "login_info" VARCHAR NOT NULL, "first_name" VARCHAR, "last_name" VARCHAR, "full_name" VARCHAR, "email" VARCHAR, "avatar_url" VARCHAR, "activated" BOOLEAN NOT NULL ); CREATE TABLE "access" ( "id" SERIAL PRIMARY KEY, "fiddle_id" VARCHAR NOT NULL, "version" INTEGER NOT NULL, "timestamp" BIGINT NOT NULL, "user_id" VARCHAR, "embedded" BOOLEAN NOT NULL, "source_ip" VARCHAR NOT NULL ); ALTER TABLE "fiddle" ADD CONSTRAINT "pk_fiddle" PRIMARY KEY ("id", "version"); ALTER TABLE "user" ADD CONSTRAINT "pk_user" PRIMARY KEY ("user_id"); CREATE INDEX "access_id_idx" ON "access" USING BTREE (fiddle_id); CREATE INDEX "access_time_idx" ON "access" USING BTREE (timestamp); GRANT ALL ON TABLE "fiddle" TO scalafiddle; GRANT ALL ON TABLE "user" TO scalafiddle; GRANT ALL ON TABLE "access" TO scalafiddle; GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO scalafiddle;
select akas from aws.aws_s3_bucket where name = '{{resourceName}}'