sql
stringlengths 6
1.05M
|
---|
DEFINE RECORD CDD$TOP.TK.TK_WORDLIST
DESCRIPTION IS /*Spelling Word List*/.
TK_WORDLIST_CDD STRUCTURE.
END TK_WORDLIST_CDD STRUCTURE.
END TK_WORDLIST.
|
<reponame>navikt/fp-abakus
ALTER TABLE iay_inntektspost
ADD COLUMN opprinelig_utbetaler_orgnr VARCHAR(19);
comment on column iay_inntektspost.opprinelig_utbetaler_orgnr is 'Hvilken enhet som opprinnelig stod for denne utbetalingen.';
|
<reponame>Renanrbsc/Machine-Learning
-- Tabela da Api produtos 'nao testada'
CREATE TABLE PRODUTO (
ID INT(11) NOT NULL AUTO_INCREMENT,
NOME VARCHAR(100) NOT NULL,
TIPO VARCHAR(100) NOT NULL,
MARCA VARCHAR(100) NOT NULL,
QUANTIDADE INT(11) NOT NULL,
VALOR FLOAT(2) NOT NULL,
VALIDADE DATE,
PRIMARY KEY (ID)
); |
/*
Add number of crime victimisations to the fact table and relevant dimensions to the dimension tables
Takes about 3 minutes in total
<NAME> 26 September 2017
<NAME> 16 October 2017,
Updates to align with new dim_date table:
NOTE: uses date offence is REPORTED, not date it OCCURRED.
*/
IF OBJECT_ID('TempDB..#value_codes') IS NOT NULL DROP TABLE #value_codes
GO
DECLARE @var_name VARCHAR(15) = 'Victimisations'
USE IDI_Sandpit
EXECUTE lib.clean_out_qtr @var_name = @var_name, @schema = 'pop_exp_dev';
-- grab back from the table the new code for our variable and store as a temp table #var_code
DECLARE @var_code INT
SET @var_code = (
SELECT variable_code
FROM IDI_Sandpit.pop_exp_dev.dim_explorer_variable
WHERE short_name = @var_name)
------------------add categorical values to the value table------------------------
INSERT INTO IDI_Sandpit.pop_exp_dev.dim_explorer_value_qtr
(short_name, fk_variable_code, var_val_sequence)
VALUES
('One', @var_code, 1),
('More than one', @var_code, 2)
-- and grab back the mini-lookup table with just our value codes
SELECT value_code, short_name AS value_category
INTO #value_codes
FROM IDI_Sandpit.pop_exp_dev.dim_explorer_value_qtr
WHERE fk_variable_code = @var_code
-- if interested in our look up table check out:
-- select * from #value_codes
----------------add facts to the fact table-------------------------
INSERT IDI_Sandpit.pop_exp_dev.fact_rollup_qtr(fk_date_period_ending, fk_snz_uid, fk_variable_code, value, fk_value_code)
SELECT
fk_date_period_ending,
fk_snz_uid,
@var_code AS fk_variable_code,
victimisations AS value,
value_code AS fk_value_code
FROM
(SELECT
qtr_end_date AS fk_date_period_ending,
fk_snz_uid,
@var_code AS fk_variable_code,
victimisations,
CASE WHEN victimisations = 1 THEN 'One'
ELSE 'More than one'
END AS vict_cat
FROM
(SELECT
COUNT(*) AS victimisations,
v.snz_uid AS fk_snz_uid,
d.qtr_end_date
FROM IDI_Clean.pol_clean.post_count_victimisations AS v
-- we only want people in our dimension table:
INNER JOIN IDI_Sandpit.pop_exp_dev.dim_person AS p
ON v.snz_uid = p.snz_uid
LEFT JOIN IDI_Sandpit.pop_exp_dev.dim_date d
-- we want to roll up by quarter
ON v.pol_pov_reported_date = d.date_dt
GROUP BY v.snz_uid, d.qtr_end_date
) AS by_qtr
) AS with_cats
-- we want to covert the categories back from categories to codes
LEFT JOIN #value_codes vc
ON with_cats.vict_cat = vc.value_category
|
CREATE ROLE projectname;
ALTER ROLE projectname WITH LOGIN PASSWORD '<PASSWORD>' NOSUPERUSER NOCREATEDB NOCREATEROLE;
CREATE DATABASE projectname OWNER projectname;
REVOKE ALL ON DATABASE projectname FROM PUBLIC;
GRANT CONNECT ON DATABASE projectname TO projectname;
GRANT ALL ON DATABASE projectname TO projectname; |
/*
Warnings:
- A unique constraint covering the columns `[userId]` on the table `sessions` will be added. If there are existing duplicate values, this will fail.
*/
-- DropIndex
DROP INDEX "sessions_accessToken_key";
-- AlterTable
ALTER TABLE "sessions" ALTER COLUMN "accessToken" DROP NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "sessions_userId_key" ON "sessions"("userId");
|
<filename>06. Databases/2018/2018.11.10/611.sql
/* 611. Average Interest */
USE gringotts;
SELECT deposit_group,
is_deposit_expired,
AVG(deposit_interest) AS average_interest
FROM wizzard_deposits
WHERE deposit_start_date >= 01/01/1985
GROUP BY deposit_group, is_deposit_expired
ORDER BY deposit_group DESC, is_deposit_expired ASC; |
<filename>src/main/resources/db/migration/V9__optimized_4.sql
ALTER TABLE `t_config`
CHANGE COLUMN `config_value` `config_value` TEXT NULL COMMENT '参数值' AFTER `config_key`;
INSERT INTO `hexo-boot`.`t_config` (`config_key`, `config_value`, `remark`) VALUES ('we_chat_official_account', "", '微信公众号');
|
<gh_stars>100-1000
/* Make first and last name optional and add email confirmation */
alter table Cofoundry.[User] alter column FirstName nvarchar(32) null
alter table Cofoundry.[User] alter column LastName nvarchar(32) null
alter table Cofoundry.[User] add IsEmailConfirmed bit null
go
update Cofoundry.[User] set IsEmailConfirmed = 0
go
alter table Cofoundry.[User] alter column IsEmailConfirmed bit not null
go
/* Role.SpecialistRoleTypeCode > Role.RoleCode */
drop index UIX_Role_SpecialistRoleTypeCode on Cofoundry.[Role]
go
exec sp_rename 'Cofoundry.[Role].SpecialistRoleTypeCode', 'RoleCode', 'column'
go
create unique index UIX_Role_RoleCode on Cofoundry.[Role] (RoleCode) where RoleCode is not null
go
/* Renaming WebDirectory to PageDirectory */
-- WebDirectory -> PageDirectory
exec sp_rename 'Cofoundry.WebDirectory', 'PageDirectory'
go
exec sp_rename 'Cofoundry.PageDirectory.WebDirectoryId' , 'PageDirectoryId', 'column'
go
exec sp_rename 'Cofoundry.PageDirectory.ParentWebDirectoryId' , 'ParentPageDirectoryId', 'column'
go
exec sp_rename 'Cofoundry.PK_WebDirectory', 'PK_PageDirectory', 'object'
go
exec sp_rename 'Cofoundry.FK_WebDirectory_CreatorUser', 'FK_PageDirectory_CreatorUser', 'object'
go
exec sp_rename 'Cofoundry.FK_WebDirectory_ParentWebDirectory', 'FK_PageDirectory_ParentPageDirectory', 'object'
go
exec sp_rename 'Cofoundry.PageDirectory.UIX_WebDirectory_UrlPath', 'UIX_PageDirectory_UrlPath', 'index'
go
-- WebDirectoryLocale -> PageDirectoryLocale
exec sp_rename 'Cofoundry.WebDirectoryLocale', 'PageDirectoryLocale'
go
exec sp_rename 'Cofoundry.PageDirectoryLocale.WebDirectoryLocaleId' , 'PageDirectoryLocaleId', 'column'
go
exec sp_rename 'Cofoundry.PageDirectoryLocale.WebDirectoryId' , 'PageDirectoryId', 'column'
go
exec sp_rename 'Cofoundry.PK_WebDirectoryLocale', 'PK_PageDirectoryLocale', 'object'
go
exec sp_rename 'Cofoundry.FK_WebDirectoryLocale_CreatorUser', 'FK_PageDirectoryLocale_CreatorUser', 'object'
go
exec sp_rename 'Cofoundry.FK_WebDirectoryLocale_Locale', 'FK_PageDirectoryLocale_Locale', 'object'
go
exec sp_rename 'Cofoundry.FK_WebDirectoryLocale_WebDirectory', 'FK_PageDirectoryLocale_PageDirectory', 'object'
go
-- Page.WebDirectoryId
exec sp_rename 'Cofoundry.[Page].WebDirectoryId' , 'PageDirectoryId', 'column'
go
exec sp_rename 'Cofoundry.FK_Page_WebDirectory', 'FK_Page_PageDirectory', 'object'
go
update Cofoundry.EntityDefinition set [Name] = 'Page Directory' where EntityDefinitionCode = 'COFDIR'
go
/* Correct PasswordHash terminology */
exec sp_rename 'Cofoundry.[User].PasswordEncryptionVersion' , 'PasswordHashVersion', 'column'
go
/* Re-naming of template sections to regions and page modules to page blocks */
-- PageTemplateSection to PageTemplateRegion
exec sp_rename 'Cofoundry.PageTemplateSection', 'PageTemplateRegion'
go
exec sp_rename 'Cofoundry.PageTemplateRegion.PageTemplateSectionId' , 'PageTemplateRegionId', 'column'
go
exec sp_rename 'Cofoundry.PageTemplateRegion.IsCustomEntitySection' , 'IsCustomEntityRegion', 'column'
go
exec sp_rename 'Cofoundry.PK_PageTemplateSection', 'PK_PageTemplateRegion', 'object'
go
exec sp_rename 'Cofoundry.FK_PageTemplateSection_PageTemplate', 'FK_PageTemplateRegion_PageTemplate', 'object'
go
exec sp_rename 'Cofoundry.PageTemplateRegion.UIX_PageTemplateSection_Name', 'UIX_PageTemplateRegion_Name', 'index'
go
-- PageModuleType to PageBlockType
exec sp_rename 'Cofoundry.PageModuleType', 'PageBlockType'
go
exec sp_rename 'Cofoundry.PageBlockType.PageModuleTypeId' , 'PageBlockTypeId', 'column'
go
exec sp_rename 'Cofoundry.PK_PageModuleType', 'PK_PageBlockType', 'object'
go
exec sp_rename 'Cofoundry.PageBlockType.UIX_PageModuleType_Name', 'UIX_PageBlockType_Name', 'index'
go
-- PageModuleTypeTemplate to PageBlockTypeTemplate
exec sp_rename 'Cofoundry.PageModuleTypeTemplate', 'PageBlockTypeTemplate'
go
exec sp_rename 'Cofoundry.PageBlockTypeTemplate.PageModuleTypeTemplateId' , 'PageBlockTypeTemplateId', 'column'
go
exec sp_rename 'Cofoundry.PageBlockTypeTemplate.PageModuleTypeId' , 'PageBlockTypeId', 'column'
go
exec sp_rename 'Cofoundry.PK_PageModuleTypeTemplate', 'PK_PageBlockTypeTemplate', 'object'
go
exec sp_rename 'Cofoundry.FK_PageModuleTypeTemplate_PageModuleType', 'FK_PageBlockTypeTemplate_PageBlockType', 'object'
go
-- PageVersionModule to PageVersionBlock
exec sp_rename 'Cofoundry.PageVersionModule', 'PageVersionBlock'
go
exec sp_rename 'Cofoundry.PageVersionBlock.PageVersionModuleId' , 'PageVersionBlockId', 'column'
go
exec sp_rename 'Cofoundry.PageVersionBlock.PageTemplateSectionId' , 'PageTemplateRegionId', 'column'
go
exec sp_rename 'Cofoundry.PageVersionBlock.PageModuleTypeId' , 'PageBlockTypeId', 'column'
go
exec sp_rename 'Cofoundry.PageVersionBlock.PageModuleTypeTemplateId' , 'PageBlockTypeTemplateId', 'column'
go
exec sp_rename 'Cofoundry.PK_PageVersionModule', 'PK_PageVersionBlock', 'object'
go
exec sp_rename 'Cofoundry.FK_PageVersionModule_CreatorUser', 'FK_PageVersionBlock_CreatorUser', 'object'
go
exec sp_rename 'Cofoundry.FK_PageVersionModule_PageModuleType', 'FK_PageVersionBlock_PageBlockType', 'object'
go
exec sp_rename 'Cofoundry.FK_PageVersionModule_PageModuleTypeTemplate', 'FK_PageVersionBlock_PageBlockTypeTemplate', 'object'
go
exec sp_rename 'Cofoundry.FK_PageVersionModule_PageTemplateSection', 'FK_PageVersionBlock_PageTemplateRegion', 'object'
go
exec sp_rename 'Cofoundry.FK_PageVersionModule_PageVersion', 'FK_PageVersionBlock_PageVersion', 'object'
go
-- CustomEntityVersionPageModule to CustomEntityVersionPageBlock
exec sp_rename 'Cofoundry.CustomEntityVersionPageModule', 'CustomEntityVersionPageBlock'
go
exec sp_rename 'Cofoundry.CustomEntityVersionPageBlock.CustomEntityVersionPageModuleId' , 'CustomEntityVersionPageBlockId', 'column'
go
exec sp_rename 'Cofoundry.CustomEntityVersionPageBlock.PageTemplateSectionId' , 'PageTemplateRegionId', 'column'
go
exec sp_rename 'Cofoundry.CustomEntityVersionPageBlock.PageModuleTypeId' , 'PageBlockTypeId', 'column'
go
exec sp_rename 'Cofoundry.CustomEntityVersionPageBlock.PageModuleTypeTemplateId' , 'PageBlockTypeTemplateId', 'column'
go
exec sp_rename 'Cofoundry.PK_CustomEntityVersionPageModule', 'PK_CustomEntityVersionPageBlock', 'object'
go
exec sp_rename 'Cofoundry.FK_CustomEntityVersionPageModule_CustomEntityVersion', 'FK_CustomEntityVersionPageBlock_CustomEntityVersion', 'object'
go
exec sp_rename 'Cofoundry.FK_CustomEntityVersionPageModule_PageModuleType', 'FK_CustomEntityVersionPageBlock_PageBlockType', 'object'
go
exec sp_rename 'Cofoundry.FK_CustomEntityVersionPageModule_PageModuleTypeTemplate', 'FK_CustomEntityVersionPageBlock_PageBlockTypeTemplate', 'object'
go
exec sp_rename 'Cofoundry.FK_CustomEntityVersionPageModule_PageTemplateSection', 'FK_CustomEntityVersionPageBlock_PageTemplateRegion', 'object'
go
-- remove renamed triggers if this isn't first install
if (ObjectProperty(object_id('Cofoundry.CustomEntityVersionPageModule_CascadeDelete'), 'IsTrigger') = 1)
begin
drop trigger Cofoundry.CustomEntityVersionPageModule_CascadeDelete
end
if (ObjectProperty(object_id('Cofoundry.PageTemplateSection_CascadeDelete'), 'IsTrigger') = 1)
begin
drop trigger Cofoundry.PageTemplateSection_CascadeDelete
end
if (ObjectProperty(object_id('Cofoundry.PageVersionModule_CascadeDelete'), 'IsTrigger') = 1)
begin
drop trigger Cofoundry.PageVersionModule_CascadeDelete
end
go
-- update entity definitions to match the new terms
insert into Cofoundry.EntityDefinition (EntityDefinitionCode, [Name]) values ('COFPGB', 'Page Version Block')
update Cofoundry.UnstructuredDataDependency set RootEntityDefinitionCode = 'COFPGB' where RootEntityDefinitionCode = 'COFPGM'
update Cofoundry.UnstructuredDataDependency set RelatedEntityDefinitionCode = 'COFPGB' where RelatedEntityDefinitionCode = 'COFPGM'
delete Cofoundry.EntityDefinition where EntityDefinitionCode = 'COFPGM'
insert into Cofoundry.EntityDefinition (EntityDefinitionCode, [Name]) values ('COFCEB', 'Custom Entity Version Page Block')
update Cofoundry.UnstructuredDataDependency set RootEntityDefinitionCode = 'COFCEB' where RootEntityDefinitionCode = 'COFCEM'
update Cofoundry.UnstructuredDataDependency set RelatedEntityDefinitionCode = 'COFCEB' where RelatedEntityDefinitionCode = 'COFCEM'
delete Cofoundry.EntityDefinition where EntityDefinitionCode = 'COFCEM'
go
/* Add missing unique indexes, mistakenly created as non-unique */
-- remove duplicates
with pageTemplateDuplicates as (
select
[FileName],
IsArchived,
row_number() over (partition by [FileName], IsArchived order by UpdateDate) as [RowNumber]
from Cofoundry.PageTemplate
)
delete pageTemplateDuplicates where [RowNumber] > 1;
with pageBlockDuplicates as (
select
[FileName],
IsArchived,
row_number() over (partition by [FileName], IsArchived order by UpdateDate) as [RowNumber]
from Cofoundry.PageBlockType
)
delete pageBlockDuplicates where [RowNumber] > 1;
go
-- recreate indexes
drop index UIX_PageTemplate_FullPath on Cofoundry.PageTemplate
drop index UIX_PageTemplate_Name on Cofoundry.PageTemplate
drop index UIX_PageTemplateRegion_Name on Cofoundry.PageTemplateRegion
drop index UIX_PageBlockType_Name on Cofoundry.PageBlockType
drop index UIX_User_IsSystemAccount on Cofoundry.[User]
go
create unique index UIX_PageTemplate_FullPath on Cofoundry.PageTemplate ([FullPath]) where IsArchived = 0
create unique index UIX_PageTemplate_Name on Cofoundry.PageTemplate ([Name]) where IsArchived = 0
create unique index UIX_PageTemplateRegion_Name on Cofoundry.PageTemplateRegion (PageTemplateId, [Name])
create unique index UIX_PageBlockType_Name on Cofoundry.PageBlockType ([Name]) where IsArchived = 0
create unique index UIX_User_IsSystemAccount on Cofoundry.[User] (IsSystemAccount) where IsSystemAccount = 1
go |
select '1'::int::boolean as bool;
update table_name
set
col1 = CURRENT_TIMESTAMP::TIMESTAMP_TZ,
col2 = '1'::int::boolean
;
|
with trans as (UPDATE "Avatars"
SET "coins" = "coins" + ${amount}
WHERE id = ${id} returning *)
INSERT INTO "CoinTransactions" (delta, coins, "createdAt", "AvatarId")
values (${amount}, (select coins from trans), CURRENT_TIMESTAMP, ${id});
|
CREATE TABLE [dbo].[RESOURCE]
(
[Id] UNIQUEIDENTIFIER NOT NULL,
[CreatedDate] DATETIME NOT NULL,
[UpdatedDate] DATETIME NOT NULL,
[Name] NVARCHAR(MAX) NOT NULL,
[Path] NVARCHAR(MAX) NOT NULL,
[UserDefinableId] UNIQUEIDENTIFIER NOT NULL
) |
<reponame>OWASP/open-swamp
# v1.13
use assessment;
drop PROCEDURE if exists upgrade_35;
DELIMITER $$
CREATE PROCEDURE upgrade_35 ()
BEGIN
declare script_version_no int;
declare cur_db_version_no int;
set script_version_no = 35;
select max(database_version_no)
into cur_db_version_no
from assessment.database_version;
if cur_db_version_no < script_version_no then
begin
# Android Package Version Columns
ALTER TABLE package_store.package_version ADD COLUMN android_sdk_target VARCHAR(255) NULL DEFAULT NULL COMMENT 'used for android java source code only' AFTER bytecode_source_path;
ALTER TABLE package_store.package_version ADD COLUMN android_redo_build tinyint(1) NULL DEFAULT NULL COMMENT 'used for android java source code only' AFTER android_sdk_target;
# update database version number
insert into assessment.database_version (database_version_no, description) values (script_version_no, 'upgrade to v1.13');
commit;
end;
end if;
END
$$
DELIMITER ;
|
-- -----------------------------------------------------------------------------------------------------
--
-- #%L
-- isy-persistence
-- %%
--
-- %%
-- See the NOTICE file distributed with this work for additional
-- information regarding copyright ownership.
-- The Federal Office of Administration (Bundesverwaltungsamt, BVA)
-- licenses this file to you under the Apache License, Version 2.0 (the
-- License). You may not use this file except in compliance with the
-- License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
-- #L%
--
-- Dieses Skript erzeugt die benötigten Tablespaces des Systems Terminfindung.
--
-- Erstellungsdatum: 13.07.216
-- Erstellt durch: <NAME>, msg systems
--
-- Datum der letzten Änderung:
-- Änderung durch:
--
-- -----------------------------------------------------------------------------------------------------
-- Tablespaces erzeugen: Terminfindung
CREATE SMALLFILE TABLESPACE &TABLESPACE_NAME DATAFILE '&DATAFILE_NAME' SIZE &DATAFILE_SIZE AUTOEXTEND ON NEXT &AUTOEXTEND_NEXT_SIZE MAXSIZE &AUTOEXTEND_MAX_SIZE;
|
<gh_stars>1-10
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
SELECT DISTINCT
ssd.studentsectionkey,
CONCAT(ssd.StudentKey, '-', ssd.SchoolKey) as studentschoolkey,
ssd.studentkey,
ssd.sectionkey,
ssd.localcoursecode,
ssd.subject,
ssd.coursetitle,
ssd.teachername,
ssd.studentsectionstartdatekey,
ssd.studentsectionenddatekey,
ssd.schoolkey,
ssd.schoolyear
FROM analytics.StudentSectionDim ssd;
|
<gh_stars>10-100
drop table if exists rule cascade;
drop table if exists rule_group cascade;
drop table if exists rule_data_group cascade;
drop table if exists rule_layer_group cascade;
-- rule_group ---
-- rule 그룹
create table rule_group (
rule_group_id integer,
rule_group_name varchar(256) not null,
rule_group_key varchar(256) not null,
rule_type varchar(50),
rule_inherit_type boolean default true,
user_id varchar(32),
ancestor integer default 0,
parent integer default 1,
depth integer default 1,
view_order integer default 1,
basic boolean default false,
available boolean default true,
description varchar(256),
update_date timestamp with time zone,
insert_date timestamp with time zone default now(),
constraint rule_group_pk primary key (rule_group_id)
);
comment on table rule_group is '룰 그룹';
comment on column rule_group.rule_group_id is '룰 그룹 고유번호';
comment on column rule_group.rule_group_name is '룰 그룹명';
comment on column rule_group.rule_group_key is '룰 그룹 Key. 확장용';
comment on column rule_group.rule_type is '룰 구분. data, data_group, data_attributes, data_library, layer, simulation 등';
comment on column rule_group.rule_inherit_type is '최상위 룰 상속 여부. true : 상속, false : 상속 안함';
comment on column rule_group.user_id is '사용자 아이디';
comment on column rule_group.view_order is '나열 순서';
comment on column rule_group.available is '사용 여부';
comment on column rule_group.description is '설명';
comment on column rule_group.update_date is '수정일';
comment on column rule_group.insert_date is '등록일';
-- rule 관리
create table rule (
rule_id integer,
rule_group_id integer,
rule_key varchar(100) not null,
rule_name varchar(256) not null,
user_id varchar(32),
attributes json,
view_order integer default 1,
available boolean default true,
description varchar(256),
update_date timestamp with time zone default now(),
insert_date timestamp with time zone default now(),
constraint rule_pk primary key (rule_id)
);
comment on table rule is '룰';
comment on column rule.rule_id is '룰 고유번호';
comment on column rule.rule_group_id is '룰 그룹 고유번호';
comment on column rule.rule_key is '룰 고유키(API용)';
comment on column rule.rule_name is '룰명';
comment on column rule.user_id is '사용자 아이디';
comment on column rule.attributes is '속성';
comment on column rule.view_order is '나열 순서';
comment on column rule.available is '사용유무.';
comment on column rule.description is '설명';
comment on column rule.update_date is '수정일';
comment on column rule.insert_date is '등록일';
|
<gh_stars>10-100
CREATE TABLE BATCHEX_ITEM_HASH (
`item_key` varchar(200) NOT NULL PRIMARY KEY,
`item_hash` varchar(50) NOT NULL,
`expiry` datetime NOT NULL
); |
begin;
create table account(
id serial primary key,
email varchar(255) not null
);
comment on table account is e'@graphql({"totalCount": {"enabled": true}})';
insert into public.account(email)
values
('<EMAIL>');
create table blog(
id serial primary key,
owner_id integer not null references account(id),
name varchar(255) not null
);
comment on table blog is e'@graphql({"totalCount": {"enabled": true}})';
insert into blog(owner_id, name)
values
(1, 'A: Blog 1');
-- Connection: alias all field types and operation
select jsonb_pretty(
graphql.resolve($$
{
aA: accountCollection(first: 1) {
tc: totalCount
pi: pageInfo {
hnp: hasNextPage
}
e: edges {
c: cursor
n: node{
id_: id
b: blogCollection {
tc2: totalCount
}
}
}
}
}
$$)
);
select graphql.resolve($$
query Introspec {
s: __schema {
q: queryType {
n: name
}
}
}
$$);
rollback;
|
<filename>Web/Install/Core/Database/mysql/1.5.0.sql
/*
* DDL Changes
*/
ALTER TABLE cuyahoga_site
ADD COLUMN metadescription MEDIUMTEXT;
ALTER TABLE cuyahoga_site
ADD COLUMN metakeywords MEDIUMTEXT;
ALTER TABLE cuyahoga_node
ADD COLUMN metadescription MEDIUMTEXT;
ALTER TABLE cuyahoga_node
ADD COLUMN metakeywords MEDIUMTEXT;
CREATE TABLE cuyahoga_moduleservice(
moduleserviceid INT NOT NULL AUTO_INCREMENT,
moduletypeid INT NOT NULL,
servicekey VARCHAR(50) NOT NULL,
servicetype VARCHAR(255) NOT NULL,
classtype VARCHAR(255) NOT NULL,
lifestyle VARCHAR(10),
FOREIGN KEY (moduletypeid) REFERENCES cuyahoga_moduletype (moduletypeid),
PRIMARY KEY (moduleserviceid),
UNIQUE IX_moduleservice_moduletypeid_servicekey (moduletypeid,servicekey));
/*
* Version
*/
UPDATE cuyahoga_version SET major = 1, minor = 5, patch = 0 WHERE assembly = 'Cuyahoga.Core';
|
<gh_stars>0
#create table politicians_votes(
# politician_id integer not null references politicians(id),
# vote_id integer not null references vote(id)
#);
|
CREATE DATABASE Project0;
GO
CREATE SCHEMA Project0;
GO
CREATE TABLE Project0.Cupcake (
CupcakeId INT NOT NULL PRIMARY KEY IDENTITY,
Type NVARCHAR(100) NOT NULL,
Cost DECIMAL(8,2) NOT NULL DEFAULT(6.00)
);
CREATE TABLE Project0.Ingredient (
IngredientId INT NOT NULL PRIMARY KEY IDENTITY,
Type NVARCHAR(100) NOT NULL
);
CREATE TABLE Project0.RecipeItem (
RecipeItemId INT NOT NULL PRIMARY KEY IDENTITY,
CupcakeID INT NOT NULL,
IngredientID INT NOT NULL,
Amount DECIMAL(10,6) NOT NULL,
Units NVARCHAR(50) NOT NULL,
CONSTRAINT CupcakeIngredient UNIQUE (CupcakeID, IngredientID),
CONSTRAINT FK_Recipe_Cupcake FOREIGN KEY (CupcakeID) REFERENCES Project0.Cupcake (CupcakeId),
CONSTRAINT FK_Recipe_Ingredient FOREIGN KEY (IngredientID) REFERENCES Project0.Ingredient (IngredientId)
);
INSERT INTO Project0.Cupcake (Type, Cost) VALUES
('Vanilla', 3.5),
('Chocolate', 5.25),
('ChocPeanutButter', 6.25),
('RaspAmaretto', 6),
('ChocPeppermint', 6.5),
('MintOreo', 6),
('Coconut', 4),
('Lemon', 4.7);
INSERT INTO Project0.Ingredient (Type) VALUES
('Flour'),
('BakingPowder'),
('Salt'),
('UnsaltedButter'),
('GranulatedSugar'),
('LargeEgg'),
('VanillaExtract'),
('SourCream'),
('ConfectionerSugar'),
('HeavyCream'),
('CocoaPowder'),
('Raspberry'),
('PeanutButter'),
('Peppermint'),
('Oreo'),
('CoconutMilk'),
('Lemon'),
('Amaretto');
SELECT *
FROM Project0.Cupcake;
SELECT *
FROM Project0.Ingredient;
INSERT INTO Project0.RecipeItem
(CupcakeID, IngredientID, Amount, Units) VALUES
(1, 1, 0.028, 'lbs'),
(1, 2, 0.00094, 'lbs'),
(1, 3, 0.00045, 'lbs'),
(1, 4, 0.054, 'lbs'),
(1, 5, 0.031, 'lbs'),
(1, 6, 0.14, 'each'),
(1, 7, 0.0004, 'gallons'),
(1, 8, 0.019, 'lbs'),
(1, 9, 0.057, 'lbs'),
(1, 10, 0.0045, 'gallons'),
(1, 11, 0, 'lbs'),
(1, 12, 0, 'each'),
(1, 13, 0, 'lbs'),
(1, 14, 0, 'each'),
(1, 15, 0, 'lbs'),
(1, 16, 0, 'gallons'),
(1, 17, 0, 'each'),
(1, 18, 0, 'lbs'),
(2, 1, 0.028, 'lbs'),
(2, 2, 0.00094, 'lbs'),
(2, 3, 0.00045, 'lbs'),
(2, 4, 0.054, 'lbs'),
(2, 5, 0.031, 'lbs'),
(2, 6, 0.14, 'each'),
(2, 7, 0.0004, 'gallons'),
(2, 8, 0.019, 'lbs'),
(2, 9, 0.057, 'lbs'),
(2, 10, 0.0045, 'gallons'),
(2, 11, 0.024, 'lbs'),
(2, 12, 0, 'each'),
(2, 13, 0, 'lbs'),
(2, 14, 0, 'each'),
(2, 15, 0, 'lbs'),
(2, 16, 0, 'gallons'),
(2, 17, 0, 'each'),
(2, 18, 0, 'lbs'),
(3, 1, 0.028, 'lbs'),
(3, 2, 0.00094, 'lbs'),
(3, 3, 0.00045, 'lbs'),
(3, 4, 0.054, 'lbs'),
(3, 5, 0.031, 'lbs'),
(3, 6, 0.14, 'each'),
(3, 7, 0.0004, 'gallons'),
(3, 8, 0.019, 'lbs'),
(3, 9, 0.057, 'lbs'),
(3, 10, 0.0045, 'gallons'),
(3, 11, 0.024, 'lbs'),
(3, 12, 0, 'each'),
(3, 13, 0.011, 'lbs'),
(3, 14, 0, 'each'),
(3, 15, 0, 'lbs'),
(3, 16, 0, 'gallons'),
(3, 17, 0, 'each'),
(3, 18, 0, 'lbs'),
(4, 1, 0.028, 'lbs'),
(4, 2, 0.00094, 'lbs'),
(4, 3, 0.00045, 'lbs'),
(4, 4, 0.054, 'lbs'),
(4, 5, 0.031, 'lbs'),
(4, 6, 0.14, 'each'),
(4, 7, 0.0004, 'gallons'),
(4, 8, 0.019, 'lbs'),
(4, 9, 0.057, 'lbs'),
(4, 10, 0.0045, 'gallons'),
(4, 11, 0, 'lbs'),
(4, 12, 7, 'each'),
(4, 13, 0, 'lbs'),
(4, 14, 0, 'each'),
(4, 15, 0, 'lbs'),
(4, 16, 0, 'gallons'),
(4, 17, 0, 'each'),
(4, 18, 0.014, 'lbs'),
(5, 1, 0.028, 'lbs'),
(5, 2, 0.00094, 'lbs'),
(5, 3, 0.00045, 'lbs'),
(5, 4, 0.054, 'lbs'),
(5, 5, 0.031, 'lbs'),
(5, 6, 0.14, 'each'),
(5, 7, 0.0004, 'gallons'),
(5, 8, 0.019, 'lbs'),
(5, 9, 0.057, 'lbs'),
(5, 10, 0.0045, 'gallons'),
(5, 11, 0.024, 'lbs'),
(5, 12, 0, 'each'),
(5, 13, 0, 'lbs'),
(5, 14, 1, 'each'),
(5, 15, 0, 'lbs'),
(5, 16, 0, 'gallons'),
(5, 17, 0, 'each'),
(5, 18, 0, 'lbs'),
(6, 1, 0.028, 'lbs'),
(6, 2, 0.00094, 'lbs'),
(6, 3, 0.00045, 'lbs'),
(6, 4, 0.054, 'lbs'),
(6, 5, 0.031, 'lbs'),
(6, 6, 0.14, 'each'),
(6, 7, 0.0004, 'gallons'),
(6, 8, 0.019, 'lbs'),
(6, 9, 0.057, 'lbs'),
(6, 10, 0.0045, 'gallons'),
(6, 11, 0, 'lbs'),
(6, 12, 0, 'each'),
(6, 13, 0, 'lbs'),
(6, 14, 0.5, 'each'),
(6, 15, 0.02, 'lbs'),
(6, 16, 0, 'gallons'),
(6, 17, 0, 'each'),
(6, 18, 0, 'lbs'),
(7, 1, 0.028, 'lbs'),
(7, 2, 0.00094, 'lbs'),
(7, 3, 0.00045, 'lbs'),
(7, 4, 0.054, 'lbs'),
(7, 5, 0.031, 'lbs'),
(7, 6, 0.14, 'each'),
(7, 7, 0.0004, 'gallons'),
(7, 8, 0.019, 'lbs'),
(7, 9, 0.057, 'lbs'),
(7, 10, 0.0045, 'gallons'),
(7, 11, 0, 'lbs'),
(7, 12, 0, 'each'),
(7, 13, 0, 'lbs'),
(7, 14, 0, 'each'),
(7, 15, 0, 'lbs'),
(7, 16, 0.0025, 'gallons'),
(7, 17, 0, 'each'),
(7, 18, 0, 'lbs'),
(8, 1, 0.028, 'lbs'),
(8, 2, 0.00094, 'lbs'),
(8, 3, 0.00045, 'lbs'),
(8, 4, 0.054, 'lbs'),
(8, 5, 0.031, 'lbs'),
(8, 6, 0.14, 'each'),
(8, 7, 0.0004, 'gallons'),
(8, 8, 0.019, 'lbs'),
(8, 9, 0.057, 'lbs'),
(8, 10, 0.0045, 'gallons'),
(8, 11, 0, 'lbs'),
(8, 12, 0, 'each'),
(8, 13, 0, 'lbs'),
(8, 14, 0, 'each'),
(8, 15, 0, 'lbs'),
(8, 16, 0, 'gallons'),
(8, 17, 0.15, 'each'),
(8, 18, 0, 'lbs');
SELECT *
FROM Project0.RecipeItem;
CREATE TABLE Project0.Location (
LocationId INT NOT NULL PRIMARY KEY IDENTITY
);
CREATE TABLE Project0.LocationInventory (
LocationInventoryId INT NOT NULL PRIMARY KEY IDENTITY,
LocationID INT NOT NULL,
IngredientID INT NOT NULL,
Amount DECIMAL(10,6) NOT NULL,
Units NVARCHAR(50) NOT NULL,
CONSTRAINT InventoryIngredient UNIQUE (LocationID, IngredientID),
CONSTRAINT FK_Location FOREIGN KEY (LocationID) REFERENCES Project0.Location (LocationId),
CONSTRAINT FK_Ingredient FOREIGN KEY (IngredientID) REFERENCES Project0.Ingredient (IngredientId)
);
CREATE TABLE Project0.Customer (
CustomerId INT NOT NULL PRIMARY KEY IDENTITY,
FirstName NVARCHAR(100) NOT NULL,
LastName NVARCHAR(100) NOT NULL,
DefaultStore INT NOT NULL,
CONSTRAINT FK_Default_Location FOREIGN KEY (DefaultStore) REFERENCES Project0.Location (LocationId)
);
CREATE TABLE Project0.CupcakeOrder (
OrderId INT NOT NULL PRIMARY KEY IDENTITY,
LocationID INT NOT NULL,
CustomerID INT NOT NULL,
CupcakeID INT NOT NULL,
Quantity INT NOT NULL,
OrderTime DATETIME2 NOT NULL,
CONSTRAINT FK_Order_Location FOREIGN KEY (LocationID) REFERENCES Project0.Location (LocationId),
CONSTRAINT FK_Order_Customer FOREIGN KEY (CustomerID) REFERENCES Project0.Customer (CustomerId),
CONSTRAINT FK_Order_Cupcake FOREIGN KEY (CupcakeID) REFERENCES Project0.Cupcake (CupcakeId)
);
|
INSERT INTO burgers (burger_name) VALUES ('Quarter Pounder with Cheese');
INSERT INTO burgers (burger_name) VALUES ('Impossible Whopper');
INSERT INTO burgers (burger_name) VALUES ('BBQ Bacon Burger');
INSERT INTO burgers (burger_name, devoured) VALUES ('Veggie Burger', true); |
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.6.25 - MySQL Community Server (GPL)
-- ОС Сервера: Win32
-- HeidiSQL Версия: 9.3.0.4984
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Дамп структуры базы данных tdarsenal
CREATE DATABASE IF NOT EXISTS `tdarsenal` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `tdarsenal`;
-- Дамп структуры для таблица tdarsenal.city
CREATE TABLE IF NOT EXISTS `city` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
-- Дамп данных таблицы tdarsenal.city: ~17 rows (приблизительно)
/*!40000 ALTER TABLE `city` DISABLE KEYS */;
INSERT INTO `city` (`id`, `name`) VALUES
(1, 'Краснодар'),
(2, 'Каневская'),
(3, 'Славянск-на-Кубани'),
(4, 'Ростов-на-Дону'),
(5, 'Сочи'),
(6, 'Новороссийск'),
(7, 'Таганрог'),
(8, 'Ставрополь'),
(9, 'Армавир'),
(10, 'Пятигорск'),
(11, 'Кисловодск'),
(12, 'Минеральные воды'),
(13, 'Керчь'),
(14, 'Феодосия'),
(15, 'Ялта'),
(16, 'Симферополь'),
(17, 'Севастополь');
/*!40000 ALTER TABLE `city` ENABLE KEYS */;
-- Дамп структуры для таблица tdarsenal.punkt
CREATE TABLE IF NOT EXISTS `punkt` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`rejimRab` text,
`id_city` int(5) NOT NULL,
`phone` text,
`coords` varchar(50) NOT NULL DEFAULT '0',
`addr` varchar(255) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `id_city` (`id_city`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- Дамп данных таблицы tdarsenal.punkt: ~10 rows (приблизительно)
/*!40000 ALTER TABLE `punkt` DISABLE KEYS */;
INSERT INTO `punkt` (`id`, `rejimRab`, `id_city`, `phone`, `coords`, `addr`) VALUES
(1, 'пн — пт: 9:00–18:00, сб: 9:00–15:00', 1, '8 (800) 100-11-77', '45.028438/39.063608', '2ое отделение АФ "Солнечная", 9/5'),
(2, 'Пн-Пт - 9.00-19.00, Сб - 10.00-16.00', 1, '8-800-100-11-77', '45.072758/39.018163', 'ул. Текстильная, 9/2'),
(3, '8:30 - 19:30 без выходных', 2, '8-800-100-11-77', '45.258244/38.119111', 'ул. Свердликова, 120'),
(4, '8:30 - 19:30 без выходных', 3, ' 8-800-100-11-77\r\n8 (988) 381-35-11', '47.229171/39.721391', 'ул. Ковтюха, 82'),
(5, 'вт — сб: 10:00-19:00\r\nВыходной: воскресение, понедельник', 4, ' 8-800-100-11-77', '46.079848/38.95723', 'п<NAME>, 79'),
(6, 'пн-пт: 09:00 - 18:00, сб: 10:00 - 16:00', 5, '8-800-100-11-77', '43.601873/39.733976', 'Пластунская, 47А, офис 11 (1 этаж)'),
(7, ' Пн-Пт 9.00-18.00, Сб 10.00-14.00', 6, '8-800-100-11-77', '43.581509/39.722882', 'пр. Ленина 13'),
(8, 'пн-пт: 09:00 - 18:00, сб: 10:00 - 14:00', 5, ' 8-800-100-11-77', '44.699115/37.784039', 'ул. <NAME>, 119'),
(9, 'пн-пт: 10:00 - 19:00, сб: 10:00 - 18:00', 5, ' 8 (800) 100-11-77', '43.581509/39.722882', 'ул. Лермонтовская, 102, оф. 5'),
(10, 'пн. - пт.: 09:00 - 18:00, сб.: 10:00 - 14:00', 7, '8-800-100-11-77', '47.209794/38.938195', 'ул. Петровская, д. 42, оф. 12');
/*!40000 ALTER TABLE `punkt` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
<filename>db/tables/TransactionStatus.sql
/*
Transaction statuses
*/
CREATE TABLE [dbo].[TransactionStatus](
[Status] [int] NOT NULL,
[Name] [nvarchar](20) NOT NULL,
[Description] [nvarchar](1000) NOT NULL,
CONSTRAINT [PK_TransactionStatus] PRIMARY KEY CLUSTERED
(
[Status] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
-- Data:
INSERT [dbo].[TransactionStatus] ([Status], [Name], [Description]) VALUES (-1, N'ROLLED BACK', N'The processing failed. The transaction has been rolled back. The transaction is not active. ')
GO
INSERT [dbo].[TransactionStatus] ([Status], [Name], [Description]) VALUES (0, N'IDLE', N'The transaction is in idle state and is active.')
GO
INSERT [dbo].[TransactionStatus] ([Status], [Name], [Description]) VALUES (1, N'PROCESSING', N'The transaction is being processed right now. The transaction is active.')
GO
INSERT [dbo].[TransactionStatus] ([Status], [Name], [Description]) VALUES (2, N'COMMITED', N'The transaction has been successfully commited. The transaction is not active.')
GO
INSERT [dbo].[TransactionStatus] ([Status], [Name], [Description]) VALUES (3, N'INVALID', N'The transaction is invalid. It produces disallowed duplicates. This status means that something got wrong at the data provider. Transaction cannot be processed.')
GO
|
SELECT t1.name, count(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1
WHERE
q1.owner_user_id = u1.id
AND a1.question_id = q1.id
AND a1.owner_user_id = u1.id
AND s.site_id = q1.site_id
AND s.site_id = a1.site_id
AND s.site_id = u1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = t1.site_id
AND q1.id = tq1.question_id
AND t1.id = tq1.tag_id
AND (s.site_name in ('stackoverflow','superuser'))
AND (t1.name in ('closures','concatenation','conditional','data-structures','doctrine-orm','google-apps-script','linq-to-sql','printf','properties','subquery','vue.js'))
AND (q1.view_count >= 0)
AND (q1.view_count <= 100)
AND (u1.downvotes >= 0)
AND (u1.downvotes <= 10)
GROUP BY t1.name |
<gh_stars>0
-- psql $POSTGRES_URL -f tpch-postgres.sql
DROP TABLE IF EXISTS LINEITEM;
CREATE TABLE LINEITEM ( L_ORDERKEY INTEGER NOT NULL,
L_PARTKEY INTEGER NOT NULL,
L_SUPPKEY INTEGER NOT NULL,
L_LINENUMBER INTEGER NOT NULL,
L_QUANTITY DECIMAL(15,2) NOT NULL,
L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL,
L_DISCOUNT DECIMAL(15,2) NOT NULL,
L_TAX DECIMAL(15,2) NOT NULL,
L_RETURNFLAG CHAR(1) NOT NULL,
L_LINESTATUS CHAR(1) NOT NULL,
L_SHIPDATE DATE NOT NULL,
L_COMMITDATE DATE NOT NULL,
L_RECEIPTDATE DATE NOT NULL,
L_SHIPINSTRUCT CHAR(25) NOT NULL,
L_SHIPMODE CHAR(10) NOT NULL,
L_COMMENT VARCHAR(44) NOT NULL);
CREATE INDEX lineitem_l_orderkey_idx ON LINEITEM (l_orderkey);
-- bcp tpch.dbo.lineitem in '$TPCH_DIR/lineitem.tbl' -f format.fmt
|
<filename>data/open-source/extracted_sql/Automattic_Jetpack.sql
SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1
SELECT 1 FROM $wpdb->posts WHERE ID = %d )
SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id IN (
SELECT count(*) FROM $wpdb->posts WHERE
SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}capabilities'
SELECT 1 FROM $wpdb->comments WHERE comment_ID = %d )
SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}user_level' AND meta_value > 0 LIMIT
SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT 1
SELECT term_id FROM $wpdb->terms
SELECT 1 FROM $wpdb->terms WHERE term_id = %d )
SELECT * FROM $wpdb->term_relationships WHERE object_id = 5
SELECT MAX(comment_date_gmt) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND comment_type=''
SELECT * FROM $wpdb->options WHERE option_name LIKE 'jpsq_my_queue%'
SELECT * FROM $wpdb->posts WHERE post_type = 'revision' AND post_parent = %d ORDER BY ID DESC
SELECT count(*) FROM $wpdb->options WHERE option_name LIKE %s", "jpsq_{$this->id}-%
SELECT 1 FROM $table WHERE meta_id = %d )
SELECT COUNT(*) FROM (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}capabilities' LIMIT 2) AS someusers
SELECT COUNT(*) FROM $wpdb->comments WHERE $where
SELECT * FROM `$wpdb->options` WHERE option_name = %s", "jetpack_nonce_{$timestamp}_{$nonce}
SELECT COUNT(*) FROM {$wpdb->site}
SELECT COUNT(*) FROM $table WHERE $where_sql
SELECT * FROM {$table} WHERE {$object_id_column} IN ( {$ids_string} ) AND meta_key = %s
None
SELECT count(*) FROM $wpdb->usermeta
SELECT * FROM $wpdb->options WHERE option_name = %s LIMIT 1
SELECT COUNT(*) FROM $wpdb->posts WHERE $where
SELECT ID, post_type, post_modified_gmt, comment_count FROM $wpdb->posts WHERE post_status='publish' AND post_type IN ({$post_types_in}) ORDER BY post_modified_gmt DESC LIMIT 1000
SELECT option_value FROM $wpdb->options WHERE option_name = %s
SELECT count FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s', $blog_id, $post->ID, $name ) );
SELECT * FROM `$wpdb->comments` WHERE `comment_post_ID` = %d AND `user_id` = 0 AND `comment_author` = %s AND `comment_author_email` = %s AND `comment_approved` = '0' ORDER BY `comment_date_gmt` /* Highlander_Comments_Base::comments_array() */
SELECT * FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_id DESC LIMIT %d, %d
SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = %s
SELECT count(term_id) FROM $wpdb->term_taxonomy WHERE taxonomy = %s
SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_password = '' AND post_status = 'publish' %s ORDER BY RAND() LIMIT 1
SELECT * FROM $wpdb->blogs WHERE 1=1
SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s )", "jpsq_{$this->id}-%
SELECT requires_authentication FROM rest_api_documentation WHERE `version` = %s AND `path` = %s AND `method` = %s LIMIT 1
SELECT count(*) FROM $wpdb->comments
|
<gh_stars>1-10
SELECT jsonPayload.password AS passwd, COUNT(jsonPayload.password) AS cnt
FROM `gcp-honeypot-book.cowrie.cowrie_access_*`
WHERE
_TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH))
AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
AND (jsonPayload.eventid = 'cowrie.login.success' OR jsonPayload.eventid = 'cowrie.login.failed')
GROUP BY passwd
ORDER BY cnt DESC
LIMIT 10 |
<gh_stars>10-100
CREATE PROCEDURE [dbo].[BulkUpdateIssueEvents]
@UserId BIGINT,
@RepositoryId BIGINT,
@Timeline BIT,
@IssueEvents IssueEventTableType READONLY,
@ReferencedAccounts ItemListTableType READONLY
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON
-- For tracking required updates to sync log
DECLARE @Changes TABLE (
[IssueEventId] BIGINT NOT NULL,
[Action] NVARCHAR(10) NOT NULL
)
DECLARE @WorkEvents IssueEventTableType
BEGIN TRY
BEGIN TRANSACTION
-- Procedure TVPs are read only :(
INSERT INTO @WorkEvents
SELECT * FROM @IssueEvents
-- Lookup already assigned IDs
UPDATE @WorkEvents
SET Id = ie.Id
FROM @WorkEvents as iie
INNER LOOP JOIN IssueEvents as ie ON (ie.UniqueKey = iie.UniqueKey)
WHERE iie.Id IS NULL
OPTION (FORCE ORDER)
-- Allocate synthetic ids for every event that isn't already in IssueEvents and that didn't get one from GitHub
UPDATE @WorkEvents
SET Id = NEXT VALUE FOR [dbo].[SyntheticIssueEventIdentifier]
WHERE Id IS NULL
IF (@Timeline = 1 AND (SELECT COUNT (DISTINCT IssueId) FROM @WorkEvents) = 1)
BEGIN
DECLARE @IssueId BIGINT = (SELECT TOP (1) IssueId FROM @WorkEvents)
-- Delete "committed" events that aren't included.
-- Needed to properly handle rebases in PRs
INSERT INTO @Changes
SELECT ie.Id, 'DELETE'
FROM IssueEvents as ie
LEFT OUTER LOOP JOIN @WorkEvents as we ON (we.Id = ie.Id)
WHERE ie.[Event] = 'committed'
AND ie.IssueId = @IssueId
AND we.Id IS NULL
OPTION (FORCE ORDER)
DELETE FROM IssueEventAccess
FROM @Changes as c
INNER LOOP JOIN IssueEventAccess as iea ON (iea.IssueEventId = c.IssueEventId)
WHERE c.[Action] = 'DELETE'
OPTION (FORCE ORDER)
DELETE FROM IssueEvents
FROM @Changes as c
INNER LOOP JOIN IssueEvents as ie ON (ie.Id = c.IssueEventId)
WHERE c.[Action] = 'DELETE'
OPTION (FORCE ORDER)
END
MERGE INTO IssueEvents WITH (SERIALIZABLE) as [Target]
USING (
SELECT Id, UniqueKey, IssueId, ActorId, [Event], CreatedAt, [Hash], Restricted, ExtensionData
FROM @WorkEvents
) as [Source]
ON ([Target].Id = [Source].Id)
WHEN NOT MATCHED BY TARGET THEN
INSERT (Id, UniqueKey, RepositoryId, IssueId, ActorId, [Event], CreatedAt, [Hash], Restricted, Timeline, ExtensionData)
VALUES (Id, UniqueKey, @RepositoryId, IssueId, ActorId, [Event], CreatedAt, [Hash], Restricted, @Timeline, ExtensionData)
WHEN MATCHED AND (
[Source].[Hash] != [Target].[Hash] -- different
AND ([Target].Timeline = 0 OR @Timeline = 1) -- prefer timeline over bulk issues
AND ([Target].Restricted = 0 OR [Source].Restricted = 1) -- prefer more detailed events
) THEN UPDATE SET
ActorId = [Source].ActorId,
[Event] = [Source].[Event],
CreatedAt = [Source].CreatedAt,
[Hash] = [Source].[Hash],
Restricted = [Source].Restricted,
Timeline = @Timeline,
ExtensionData = [Source].ExtensionData
OUTPUT INSERTED.Id, $action INTO @Changes
OPTION (LOOP JOIN, FORCE ORDER);
-- Add access grants
INSERT INTO IssueEventAccess (IssueEventId, UserId)
OUTPUT INSERTED.IssueEventId, 'INSERT' INTO @Changes
SELECT ie.Id, @UserId
FROM @WorkEvents as ie
WHERE ie.Restricted = 1
AND NOT EXISTS(SELECT * FROM IssueEventAccess WHERE IssueEventId = ie.Id AND UserId = @UserId)
-- Update existing events
UPDATE SyncLog SET
[Delete] = IIF([Action] = 'DELETE', 1, 0),
[RowVersion] = DEFAULT
FROM @Changes as c
INNER LOOP JOIN SyncLog ON (OwnerType = 'repo' AND OwnerId = @RepositoryId AND ItemType = 'event' AND ItemId = c.IssueEventId)
OPTION (FORCE ORDER)
-- New events
INSERT INTO SyncLog (OwnerType, OwnerId, ItemType, ItemId, [Delete])
SELECT 'repo', @RepositoryId, 'event', c.IssueEventId, 0
FROM (SELECT DISTINCT IssueEventId FROM @Changes WHERE [Action] = 'INSERT') as c
WHERE NOT EXISTS (
SELECT * FROM SyncLog
WHERE OwnerType = 'repo' AND OwnerId = @RepositoryId AND ItemType = 'event' AND ItemId = c.IssueEventId)
-- New Accounts
INSERT INTO SyncLog (OwnerType, OwnerId, ItemType, ItemId, [Delete])
SELECT 'repo', @RepositoryId, 'account', c.UserId, 0
FROM (SELECT DISTINCT Item as UserId FROM @ReferencedAccounts) as c
WHERE NOT EXISTS (
SELECT * FROM SyncLog
WHERE OwnerType = 'repo' AND OwnerId = @RepositoryId AND ItemType = 'account' AND ItemId = c.UserId)
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF (XACT_STATE() != 0) ROLLBACK TRANSACTION;
THROW;
END CATCH
-- Return sync notifications
SELECT 'repo' as ItemType, @RepositoryId as ItemId
WHERE EXISTS (SELECT * FROM @Changes)
END
|
-- file:transactions.sql ln:413 expect:true
ROLLBACK TO s1
|
<reponame>Shuttl-Tech/antlr_psql
-- file:path.sql ln:36 expect:true
SELECT '' AS count, pclose(f1) AS closed_path FROM PATH_TBL
|
-- 1830 Number of measurement records inside a valid observation period
SELECT
1830 AS analysis_id,
CAST(NULL AS VARCHAR(255)) AS stratum_1,
CAST(NULL AS VARCHAR(255)) AS stratum_2,
CAST(NULL AS VARCHAR(255)) AS stratum_3,
CAST(NULL AS VARCHAR(255)) AS stratum_4,
CAST(NULL AS VARCHAR(255)) AS stratum_5,
COUNT_BIG(*) AS count_value
INTO
@scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_1830
FROM
@cdmDatabaseSchema.measurement m
JOIN
@cdmDatabaseSchema.observation_period op
ON
m.person_id = op.person_id
AND
m.measurement_date >= op.observation_period_start_date
AND
m.measurement_date <= op.observation_period_end_date
;
|
CREATE TABLE Messages (
ID int NOT NULL,
scadenza datetime NOT NULL,
destinatario varchar(16) NOT NULL,
testo varchar(1000) NOT NULL,
titolo varchar(100) NOT NULL,
PRIMARY KEY (ID)
);
INSERT INTO Messages (ID, scadenza, destinatario, testo, titolo) VALUES (1, '2020-11-30', 'MRRSSI79C01E388D', '__Questo è un messaggio di prova__', 'titolo messaggio di prova');
INSERT INTO Messages (ID, scadenza, destinatario, testo, titolo) VALUES (2, '2020-12-31', 'GDDAAR79C01E388D', '__Questo è un messaggio di prova 2__', 'titolo messaggio di prova 2');
|
<filename>scripts/postgres_tables/verifiermain.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.4
-- Dumped by pg_dump version 12.4
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;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: verifiermain; Type: TABLE; Schema: public; Owner: keylime
--
CREATE TABLE public.verifiermain (
agent_id character varying(80) NOT NULL,
v character varying,
ip character varying(15),
port integer,
operational_state integer,
public_key character varying,
tpm_policy character varying,
vtpm_policy character varying,
meta_data character varying,
allowlist character varying,
ima_sign_verification_keys character varying,
revocation_key character varying,
accept_tpm_hash_algs text,
accept_tpm_encryption_algs text,
accept_tpm_signing_algs text,
hash_alg character varying,
enc_alg character varying,
sign_alg character varying,
boottime integer,
ima_pcrs character varying,
pcr10 bytea,
next_ima_ml_entry integer,
);
ALTER TABLE public.verifiermain OWNER TO keylime;
--
-- Name: verifiermain verifiermain_pkey; Type: CONSTRAINT; Schema: public; Owner: keylime
--
ALTER TABLE ONLY public.verifiermain
ADD CONSTRAINT verifiermain_pkey PRIMARY KEY (agent_id);
--
-- PostgreSQL database dump complete
--
|
<reponame>chhavip/debaised-analysis<filename>intents/data/spider_eval/spider/database/dog_kennels/schema.sql
version https://git-lfs.github.com/spec/v1
oid sha256:aaa60f4dc4d0198bb3031b144b8ccdc32ec5f68c1e819a3999736dcd76633c8f
size 21522
|
<reponame>jichuangsi/69Vedio_console
alter table ms_member add `try_and_see` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '剩余试看次数';
DROP TABLE IF EXISTS `ms_video_try_log`;
CREATE TABLE `ms_video_try_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`video_id` int(11) NOT NULL COMMENT '视频id',
`user_id` int(11) DEFAULT '0' COMMENT '用户Id',
`user_ip` varchar(15) DEFAULT '0' COMMENT '用户ip',
`try_time` int(10) NOT NULL COMMENT '观看时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='视频试看日志表'; |
IF OBJECT_ID('inventory.get_brand_id_by_brand_name') IS NOT NULL
DROP FUNCTION inventory.get_brand_id_by_brand_name;
GO
CREATE FUNCTION inventory.get_brand_id_by_brand_name(@brand_name national character varying(24))
RETURNS integer
AS
BEGIN
RETURN
(
SELECT brand_id
FROM inventory.brands
WHERE inventory.brands.brand_name=@brand_name
AND inventory.brands.deleted = 0
);
END;
GO
|
<gh_stars>1-10
/*
Navicat MySQL Data Transfer
Source Server : jxc_db
Source Server Version : 50632
Source Host : localhost:3306
Source Database : jxc_db
Target Server Type : MYSQL
Target Server Version : 50632
File Encoding : 65001
Date: 2017-08-09 09:24:12
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for goods_brand_tb
-- ----------------------------
DROP TABLE IF EXISTS `goods_brand_tb`;
CREATE TABLE `goods_brand_tb` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`brand_number` bigint(20) DEFAULT NULL COMMENT '品牌编号(暂定)',
`brand_name` varchar(255) DEFAULT NULL COMMENT '品牌中文名',
`brand_english_name` varchar(128) DEFAULT NULL COMMENT '品牌英文名',
`brand_initial` varchar(64) DEFAULT NULL COMMENT '品牌首字母',
`state` int(1) DEFAULT NULL COMMENT '状态(0:停用,1启用)',
`is_delete` int(1) DEFAULT NULL COMMENT '是否删除(0,否;1,是)',
`directly_org_id` bigint(20) DEFAULT NULL COMMENT '直属机构ID',
`hierarchy_id` varchar(320) DEFAULT NULL COMMENT '机构层级ID',
`creator_id` bigint(20) DEFAULT NULL COMMENT '创建人ID',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updator_id` bigint(20) DEFAULT NULL COMMENT '修改人ID',
`updator` varchar(255) DEFAULT NULL COMMENT '修改人',
`update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '修改时间',
`extends_params` longblob COMMENT '扩展参数',
`remark1` varchar(4000) DEFAULT NULL COMMENT '扩展字段1',
`remark2` varchar(4000) DEFAULT NULL COMMENT '扩展字段2',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='品牌表';
|
select *
from aws.aws_dms_replication_instance
where arn = '{{ output.resource_aka.value }}1p000'; |
<filename>azkaban-db/src/main/sql/upgrade.3.69.0.to.3.70.0.sql
-- DB Migration from release 3.69.0 to 3.70.0
-- PR #2140 Implements “flowPriority” (at the time of polling) feature for new dispatching logic.
-- flow_priority column can hold a positive int, negative int or 5 which is the default flow
-- priority set in ExecutionOptions.DEFAULT_FLOW_PRIORITY for all flows.
-- "flowPriority" is an execution option an Azkaban admin can specify when launching a new execution.
-- It will allow a flow to be dispatched or polled first.
--
ALTER TABLE execution_flows ADD COLUMN flow_priority TINYINT NOT NULL DEFAULT 5;
|
SELECT
listing_changes_mview.id,
event_id,
taxon_concept_id,
original_taxon_concept_id,
CASE
WHEN listing_changes_mview.change_type_name = 'DELETION'
OR listing_changes_mview.change_type_name = 'RESERVATION_WITHDRAWAL'
THEN FALSE
ELSE listing_changes_mview.is_current
END AS is_current,
listing_changes_mview.effective_at::DATE,
listing_changes_mview.species_listing_name,
listing_changes_mview.change_type_name,
CASE
WHEN listing_changes_mview.change_type_name = 'ADDITION' THEN '+'
WHEN listing_changes_mview.change_type_name = 'DELETION' THEN '-'
WHEN listing_changes_mview.change_type_name = 'RESERVATION' THEN 'R+'
WHEN listing_changes_mview.change_type_name = 'RESERVATION_WITHDRAWAL' THEN 'R-'
ELSE ''
END AS change_type,
listing_changes_mview.inclusion_taxon_concept_id,
listing_changes_mview.party_id,
CASE
WHEN party_id IS NULL THEN NULL::JSON
ELSE
ROW_TO_JSON(
ROW(
party_iso_code,
party_full_name_en,
geo_entity_type
)::api_geo_entity
)
END AS party_en,
CASE
WHEN party_id IS NULL THEN NULL::JSON
ELSE
ROW_TO_JSON(
ROW(
party_iso_code,
party_full_name_es,
geo_entity_type
)::api_geo_entity
)
END AS party_es,
CASE
WHEN party_id IS NULL THEN NULL::JSON
ELSE
ROW_TO_JSON(
ROW(
party_iso_code,
party_full_name_fr,
geo_entity_type
)::api_geo_entity
)
END AS party_fr,
CASE
WHEN listing_changes_mview.auto_note_en IS NULL
AND listing_changes_mview.inherited_full_note_en IS NULL
AND listing_changes_mview.inherited_short_note_en IS NULL
AND listing_changes_mview.full_note_en IS NULL
AND listing_changes_mview.short_note_en IS NULL
AND listing_changes_mview.nomenclature_note_en IS NULL
THEN NULL
ELSE
CASE
WHEN LENGTH(listing_changes_mview.auto_note_en) > 0 THEN '[' || listing_changes_mview.auto_note_en || '] '
ELSE ''
END
|| CASE
WHEN LENGTH(listing_changes_mview.inherited_full_note_en) > 0 THEN strip_tags(listing_changes_mview.inherited_full_note_en)
WHEN LENGTH(listing_changes_mview.inherited_short_note_en) > 0 THEN strip_tags(listing_changes_mview.inherited_short_note_en)
WHEN LENGTH(listing_changes_mview.full_note_en) > 0 THEN strip_tags(listing_changes_mview.full_note_en)
WHEN LENGTH(listing_changes_mview.short_note_en) > 0 THEN strip_tags(listing_changes_mview.short_note_en)
ELSE ''
END
|| CASE
WHEN LENGTH(listing_changes_mview.nomenclature_note_en) > 0 THEN strip_tags(listing_changes_mview.nomenclature_note_en)
ELSE ''
END
END AS annotation_en,
CASE
WHEN listing_changes_mview.auto_note_es IS NULL
AND listing_changes_mview.inherited_full_note_es IS NULL
AND listing_changes_mview.inherited_short_note_es IS NULL
AND listing_changes_mview.full_note_es IS NULL
AND listing_changes_mview.short_note_es IS NULL
AND listing_changes_mview.nomenclature_note_es IS NULL
THEN NULL
ELSE
CASE
WHEN LENGTH(listing_changes_mview.auto_note_es) > 0 THEN '[' || listing_changes_mview.auto_note_es || '] '
ELSE ''
END
|| CASE
WHEN LENGTH(listing_changes_mview.inherited_full_note_es) > 0 THEN strip_tags(listing_changes_mview.inherited_full_note_es)
WHEN LENGTH(listing_changes_mview.inherited_short_note_es) > 0 THEN strip_tags(listing_changes_mview.inherited_short_note_es)
WHEN LENGTH(listing_changes_mview.full_note_es) > 0 THEN strip_tags(listing_changes_mview.full_note_es)
WHEN LENGTH(listing_changes_mview.short_note_es) > 0 THEN strip_tags(listing_changes_mview.short_note_es)
ELSE ''
END
|| CASE
WHEN LENGTH(listing_changes_mview.nomenclature_note_en) > 0 THEN strip_tags(listing_changes_mview.nomenclature_note_en)
ELSE ''
END
END AS annotation_es,
CASE
WHEN listing_changes_mview.auto_note_fr IS NULL
AND listing_changes_mview.inherited_full_note_fr IS NULL
AND listing_changes_mview.inherited_short_note_fr IS NULL
AND listing_changes_mview.full_note_fr IS NULL
AND listing_changes_mview.short_note_fr IS NULL
AND listing_changes_mview.nomenclature_note_fr IS NULL
THEN NULL
ELSE
CASE
WHEN LENGTH(listing_changes_mview.auto_note_fr) > 0 THEN '[' || listing_changes_mview.auto_note_fr || '] '
ELSE ''
END
|| CASE
WHEN LENGTH(listing_changes_mview.inherited_full_note_fr) > 0 THEN strip_tags(listing_changes_mview.inherited_full_note_fr)
WHEN LENGTH(listing_changes_mview.inherited_short_note_fr) > 0 THEN strip_tags(listing_changes_mview.inherited_short_note_fr)
WHEN LENGTH(listing_changes_mview.full_note_fr) > 0 THEN strip_tags(listing_changes_mview.full_note_fr)
WHEN LENGTH(listing_changes_mview.short_note_fr) > 0 THEN strip_tags(listing_changes_mview.short_note_fr)
ELSE ''
END
|| CASE
WHEN LENGTH(listing_changes_mview.nomenclature_note_fr) > 0 THEN strip_tags(listing_changes_mview.nomenclature_note_fr)
ELSE ''
END
END AS annotation_fr,
CASE
WHEN listing_changes_mview.hash_ann_symbol IS NULL
AND listing_changes_mview.hash_full_note_en IS NULL
THEN NULL::JSON
ELSE
ROW_TO_JSON(
ROW(
listing_changes_mview.hash_ann_symbol,
strip_tags(listing_changes_mview.hash_full_note_en)
)::api_annotation
)
END AS hash_annotation_en,
CASE
WHEN listing_changes_mview.hash_ann_symbol IS NULL
AND listing_changes_mview.hash_full_note_es IS NULL
THEN NULL::JSON
ELSE
ROW_TO_JSON(
ROW(
listing_changes_mview.hash_ann_parent_symbol || ' ' || listing_changes_mview.hash_ann_symbol,
strip_tags(listing_changes_mview.hash_full_note_es)
)::api_annotation
)
END AS hash_annotation_es,
CASE
WHEN listing_changes_mview.hash_ann_symbol IS NULL
AND listing_changes_mview.hash_full_note_fr IS NULL
THEN NULL::JSON
ELSE
ROW_TO_JSON(
ROW(
listing_changes_mview.hash_ann_symbol,
strip_tags(listing_changes_mview.hash_full_note_fr)
)::api_annotation
)
END AS hash_annotation_fr,
listing_changes_mview.show_in_history,
listing_changes_mview.full_note_en,
listing_changes_mview.short_note_en,
listing_changes_mview.auto_note_en,
listing_changes_mview.hash_full_note_en,
listing_changes_mview.hash_ann_parent_symbol,
listing_changes_mview.hash_ann_symbol,
listing_changes_mview.inherited_full_note_en,
listing_changes_mview.inherited_short_note_en,
listing_changes_mview.nomenclature_note_en,
listing_changes_mview.nomenclature_note_fr,
listing_changes_mview.nomenclature_note_es,
CASE
WHEN change_type_name = 'ADDITION' THEN 0
WHEN change_type_name = 'RESERVATION' THEN 1
WHEN change_type_name = 'RESERVATION_WITHDRAWAL' THEN 2
WHEN change_type_name = 'DELETION' THEN 3
END AS change_type_order
FROM cites_listing_changes_mview listing_changes_mview
WHERE "listing_changes_mview"."show_in_history";
|
INSERT INTO department (name)
VALUES
('c suite'),
('marketing'),
('engineering');
INSERT INTO role (title, salary, department_id)
VALUES
('CEO', 60, 1),
('sales lead', 50, 2),
('salesperson', 45, 2),
('engineering lead', 50, 3),
('engineer', 47, 3),
('executive secretary', 45, 1);name
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES
('Unica', 'Zurn', 1, NULL),
('Virginia', 'Woolf', 2, 1),
('Ronald', 'Firbank', 2, 1),
('Piers', 'Gaveston', 3, 1),
('Charles', 'LeRoi', 2, 1),
('Katherine', 'Mansfield', 5, 4),
('Dora', 'Carrington', 6, 1),
('Edward', 'Bellamy', 3, 5),
('Montague', 'Summers', 5, 4),
('Octavia', 'Butler', 5, 4)
; |
<reponame>anqh/anqh
CREATE TABLE `blog_entries` (
`id` int(11) NOT NULL auto_increment,
`author_id` int(11) NOT NULL,
`name` varchar(250) collate utf8_swedish_ci default NULL,
`content` text collate utf8_swedish_ci,
`created` int(11) default NULL,
`view_count` int(11) default '0',
`modified` int(11) default NULL,
`modify_count` int(11) default '0',
`comment_count` int(11) default '0',
`new_comment_count` int(11) default '0',
PRIMARY KEY (`id`),
KEY `author_id` (`author_id`),
CONSTRAINT `blog_entries_author_id` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
|
<reponame>matthaw/bookstore-api<filename>src/main/resources/db/migration/V2__Populate_Table_Person.sql
INSERT INTO person (address, first_name, gender, last_name)
VALUES ('Uberlândia - Minas Gerais - Brasil', 'Leandro', 'Male', 'Costa'),
('Uberlândia - Minas Gerais - Brasil', 'Gabriela', 'Female', 'Costa'),
('Patos de Minas - Minas Gerais - Brasil', 'Flávio', 'Male', 'Costa'),
('Uberlândia - Minas Gerais - Brasil', 'Fernanda', 'Female', '<NAME> Silva'),
('Patos de Minas - Minas Gerais - Brasil', 'Pedro', 'Male', 'Paulo'),
('Patos de Minas - Minas Gerais - Brasil', 'Marcos', 'Male', 'Paulo'); |
<reponame>vijendra-codingkart/Node-Work
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 11, 2019 at 05:44 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
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: `test`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`age` int(3) NOT NULL,
`email` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `age`, `email`) VALUES
(2, 'saikat', 45, '<EMAIL>'),
(3, 'ghjghj', 45, '<EMAIL>');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>egalli64/hron
-- union example
-- two queries on two different tables...
select title as info, 'job' as source
from job
where title like 'A%';
select name, 'department'
from department
where name like 'A%';
-- ... could give a combined result set
select title as info, 'job' as source
from job
where title like 'A%'
union
select name, 'department'
from department
where name like 'A%'
order by info;
|
ALTER TABLE booking ADD `booking_reference` VARCHAR(60);
|
<filename>kernel/Install/Install.sql
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `__PREFIX__bill`;
CREATE TABLE `__PREFIX__bill` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`owner` int UNSIGNED NOT NULL COMMENT '用户id',
`amount` decimal(10, 2) UNSIGNED NOT NULL COMMENT '金额',
`balance` decimal(14, 2) UNSIGNED NOT NULL COMMENT '余额',
`type` tinyint NOT NULL COMMENT '类型:0=支出,1=收入',
`currency` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '货币:0=余额,1=硬币',
`log` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `owner`(`owner` ASC) USING BTREE,
INDEX `type`(`type` ASC) USING BTREE,
CONSTRAINT `__PREFIX__bill_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `__PREFIX__user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__business`;
CREATE TABLE `__PREFIX__business` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` int UNSIGNED NOT NULL COMMENT '用户id',
`shop_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '店铺名称',
`title` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '浏览器标题',
`notice` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '店铺公告',
`service_qq` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客服QQ',
`service_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网页客服链接',
`subdomain` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '子域名',
`topdomain` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '顶级域名',
`master_display` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '主站显示:0=否,1=是',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `user_id`(`user_id` ASC) USING BTREE,
UNIQUE INDEX `subdomain`(`subdomain` ASC) USING BTREE,
UNIQUE INDEX `topdomain`(`topdomain` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__business_level`;
CREATE TABLE `__PREFIX__business_level` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '等级名称',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标',
`cost` decimal(4, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '商家自己的商品,抽成百分比',
`accrual` decimal(4, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '主站商品,分给商家的收益百分比',
`substation` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '分站:0=关闭,1=启用',
`top_domain` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '顶级域名:0=关闭,1=启用',
`price` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '购买价格',
`supplier` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '供货商权限:0=关闭,1=启用',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__business_level` VALUES (1, '体验版', '/assets/static/images/business/v1.png', 0.30, 0.10, 1, 0, 188.00, 1);
INSERT INTO `__PREFIX__business_level` VALUES (3, '普通版', '/assets/static/images/business/v2.png', 0.25, 0.15, 1, 0, 288.00, 1);
INSERT INTO `__PREFIX__business_level` VALUES (4, '专业版', '/assets/static/images/business/v3.png', 0.20, 0.20, 1, 1, 388.00, 1);
DROP TABLE IF EXISTS `__PREFIX__card`;
CREATE TABLE `__PREFIX__card` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`owner` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属会员:0=系统,其他等于会员UID',
`commodity_id` int UNSIGNED NOT NULL COMMENT '商品id',
`draft` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预选信息',
`secret` varchar(760) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '卡密信息',
`create_time` datetime NOT NULL COMMENT '添加时间',
`purchase_time` datetime NULL DEFAULT NULL COMMENT '购买时间',
`order_id` int UNSIGNED NULL DEFAULT NULL COMMENT '订单id',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=未出售,1=已出售,2=已锁定',
`note` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注信息',
`race` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品种类',
PRIMARY KEY (`id`) USING BTREE,
INDEX `owner`(`owner` ASC) USING BTREE,
INDEX `commodity_id`(`commodity_id` ASC) USING BTREE,
INDEX `order_id`(`order_id` ASC) USING BTREE,
INDEX `secret`(`secret` ASC) USING BTREE,
INDEX `status`(`status` ASC) USING BTREE,
INDEX `note`(`note` ASC) USING BTREE,
INDEX `race`(`race` ASC) USING BTREE,
CONSTRAINT `__PREFIX__card_ibfk_1` FOREIGN KEY (`commodity_id`) REFERENCES `__PREFIX__commodity` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__cash`;
CREATE TABLE `__PREFIX__cash` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` int UNSIGNED NOT NULL COMMENT '用户id',
`amount` decimal(14, 2) UNSIGNED NOT NULL COMMENT '提现金额',
`type` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型:0=自动提现,1=手动提现',
`card` tinyint UNSIGNED NOT NULL COMMENT '收款:0=支付宝,1=微信',
`create_time` datetime NOT NULL COMMENT '提现时间',
`arrive_time` datetime NULL DEFAULT NULL COMMENT '到账时间',
`cost` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '手续费',
`status` tinyint UNSIGNED NOT NULL COMMENT '状态:0=处理中,1=成功,2=失败,3=冻结期',
`message` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息',
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_id`(`user_id` ASC) USING BTREE,
INDEX `type`(`type` ASC) USING BTREE,
INDEX `message`(`message` ASC) USING BTREE,
CONSTRAINT `__PREFIX__cash_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `__PREFIX__user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__category`;
CREATE TABLE `__PREFIX__category` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品分类名称',
`sort` smallint UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序',
`create_time` datetime NOT NULL COMMENT '创建时间',
`owner` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属会员:0=系统,其他等于会员UID',
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类图标',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=停用,1=启用',
`hide` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '隐藏:1=隐藏,0=不隐藏',
`user_level_config` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '会员配置',
PRIMARY KEY (`id`) USING BTREE,
INDEX `owner`(`owner` ASC) USING BTREE,
INDEX `sort`(`sort` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__category` VALUES (1, 'DEMO', 1, '2021-11-26 17:59:45', 0, '/favicon.ico', 1, 0, NULL);
DROP TABLE IF EXISTS `__PREFIX__commodity`;
CREATE TABLE `__PREFIX__commodity` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`category_id` int UNSIGNED NOT NULL COMMENT '商品分类ID',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名称',
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '商品说明',
`cover` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品封面图片',
`factory_price` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '成本单价',
`price` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '商品单价(未登录)',
`user_price` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '商品单价(会员价)',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=下架,1=上架',
`owner` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属会员:0=系统,其他等于会员UID',
`create_time` datetime NOT NULL COMMENT '创建时间',
`api_status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'API对接:0=关闭,1=启用',
`code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品代码(API对接)',
`delivery_way` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '发货方式:0=自动发货,1=手动发货/插件发货',
`delivery_auto_mode` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '自动发卡模式:0=旧卡先发,1=随机发卡,2=新卡先发',
`delivery_message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手动发货显示信息',
`contact_type` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '联系方式:0=任意,1=手机,2=邮箱,3=QQ',
`password_status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单密码:0=关闭,1=启用',
`sort` smallint UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序',
`coupon` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠卷:0=关闭,1=启用',
`shared_id` int UNSIGNED NULL DEFAULT NULL COMMENT '共享平台ID',
`shared_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '共享平台-商品代码',
`shared_premium` float(10, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '商品加价',
`shared_premium_type` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '加价模式',
`seckill_status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品秒杀:0=关闭,1=开启',
`seckill_start_time` datetime NULL DEFAULT NULL COMMENT '秒杀开始时间',
`seckill_end_time` datetime NULL DEFAULT NULL COMMENT '秒杀结束时间',
`draft_status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '指定卡密购买:0=关闭,1=启用',
`draft_premium` decimal(10, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '指定卡密购买时溢价',
`inventory_hidden` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '隐藏库存:0=否,1=是',
`leave_message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发货留言',
`recommend` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '推荐商品:0=否,1=是',
`send_email` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '发送邮件:0=否,1=是',
`only_user` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '限制登录购买:0=否,1=是',
`purchase_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '限制购买数量:0=无限制',
`widget` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '控件',
`level_price` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '会员等级-定制价格',
`level_disable` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '禁用会员等级折扣,0=关闭,1=启用',
`minimum` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最低购买数量,0=无限制',
`maximum` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '最大购买数量,0=无限制',
`shared_sync` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '同步平台价格:0=关,1=开',
`config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '配置文件',
`hide` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '隐藏:1=隐藏,0=不隐藏',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `code`(`code` ASC) USING BTREE,
INDEX `owner`(`owner` ASC) USING BTREE,
INDEX `status`(`status` ASC) USING BTREE,
INDEX `sort`(`sort` ASC) USING BTREE,
INDEX `category_id`(`category_id` ASC) USING BTREE,
INDEX `shared_id`(`shared_id` ASC) USING BTREE,
INDEX `seckill_status`(`seckill_status` ASC) USING BTREE,
INDEX `api_status`(`api_status` ASC) USING BTREE,
INDEX `recommend`(`recommend` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__commodity` VALUES (1, 1, 'DEMO', '<p>该商品是演示商品</p>', '/favicon.ico', 0.00, 1.00, 0.90, 1, 0, '2021-11-26 18:01:30', 1, '8AE80574F3CA98BE', 1, 0, '', 0, 0, 1, 1, NULL, '', 0.00, 0, 0, NULL, NULL, 0, 0.00, 0, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, NULL, 0);
DROP TABLE IF EXISTS `__PREFIX__config`;
CREATE TABLE `__PREFIX__config` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '配置键名称',
`value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置内容',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `key`(`key`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 45 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__config` VALUES (1, 'shop_name', '异次元店铺');
INSERT INTO `__PREFIX__config` VALUES (2, 'title', '异次元店铺 - 最适合你的个人店铺系统!');
INSERT INTO `__PREFIX__config` VALUES (3, 'description', '');
INSERT INTO `__PREFIX__config` VALUES (4, 'keywords', '');
INSERT INTO `__PREFIX__config` VALUES (14, 'user_theme', 'Cartoon');
INSERT INTO `__PREFIX__config` VALUES (5, 'registered_state', '1');
INSERT INTO `__PREFIX__config` VALUES (6, 'registered_type', '0');
INSERT INTO `__PREFIX__config` VALUES (7, 'registered_verification', '1');
INSERT INTO `__PREFIX__config` VALUES (8, 'registered_phone_verification', '0');
INSERT INTO `__PREFIX__config` VALUES (9, 'registered_email_verification', '0');
INSERT INTO `__PREFIX__config` VALUES (10, 'sms_config', '{\"accessKeyId\":\"\",\"accessKeySecret\":\"\",\"signName\":\"\",\"templateCode\":\"\"}');
INSERT INTO `__PREFIX__config` VALUES (11, 'email_config', '{\"smtp\":\"\",\"port\":\"\",\"username\":\"\",\"password\":\"\"}');
INSERT INTO `__PREFIX__config` VALUES (12, 'login_verification', '1');
INSERT INTO `__PREFIX__config` VALUES (13, 'forget_type', '0');
INSERT INTO `__PREFIX__config` VALUES (15, 'notice', '<p><b><font color=\"#f9963b\">本程序为开源程序,使用者造成的一切法律后果与作者无关。</font></b></p>');
INSERT INTO `__PREFIX__config` VALUES (16, 'trade_verification', '1');
INSERT INTO `__PREFIX__config` VALUES (17, 'recharge_welfare', '0');
INSERT INTO `__PREFIX__config` VALUES (18, 'recharge_welfare_config', '');
INSERT INTO `__PREFIX__config` VALUES (19, 'promote_rebate_v1', '0.1');
INSERT INTO `__PREFIX__config` VALUES (20, 'promote_rebate_v2', '0.2');
INSERT INTO `__PREFIX__config` VALUES (21, 'promote_rebate_v3', '0.3');
INSERT INTO `__PREFIX__config` VALUES (22, 'substation_display', '1');
INSERT INTO `__PREFIX__config` VALUES (24, 'domain', '');
INSERT INTO `__PREFIX__config` VALUES (25, 'service_qq', '');
INSERT INTO `__PREFIX__config` VALUES (26, 'service_url', '');
INSERT INTO `__PREFIX__config` VALUES (27, 'cash_type_alipay', '1');
INSERT INTO `__PREFIX__config` VALUES (28, 'cash_type_wechat', '1');
INSERT INTO `__PREFIX__config` VALUES (29, 'cash_cost', '5');
INSERT INTO `__PREFIX__config` VALUES (30, 'cash_min', '100');
INSERT INTO `__PREFIX__config` VALUES (31, 'cname', '');
INSERT INTO `__PREFIX__config` VALUES (32, 'background_url', '/assets/admin/images/login/bg.jpg');
INSERT INTO `__PREFIX__config` VALUES (33, 'default_category', '0');
INSERT INTO `__PREFIX__config` VALUES (34, 'substation_display_list', '[]');
INSERT INTO `__PREFIX__config` VALUES (35, 'closed', '0');
INSERT INTO `__PREFIX__config` VALUES (36, 'closed_message', '我们正在升级,请耐心等待完成。');
INSERT INTO `__PREFIX__config` VALUES (37, 'recharge_min', '10');
INSERT INTO `__PREFIX__config` VALUES (38, 'recharge_max', '1000');
INSERT INTO `__PREFIX__config` VALUES (39, 'user_mobile_theme', '0');
INSERT INTO `__PREFIX__config` VALUES (40, 'commodity_recommend', '0');
INSERT INTO `__PREFIX__config` VALUES (41, 'commodity_name', '推荐');
INSERT INTO `__PREFIX__config` VALUES (42, 'background_mobile_url', '');
INSERT INTO `__PREFIX__config` VALUES (43, 'username_len', '6');
INSERT INTO `__PREFIX__config` VALUES (44, 'cash_type_balance', '0');
INSERT INTO `__PREFIX__config` VALUES (45, 'callback_domain', '');
DROP TABLE IF EXISTS `__PREFIX__coupon`;
CREATE TABLE `__PREFIX__coupon` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠卷代码',
`commodity_id` int UNSIGNED NOT NULL COMMENT '商品id',
`owner` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属会员:0=系统,其他等于会员UID',
`create_time` datetime NOT NULL COMMENT '创建时间',
`expire_time` datetime NULL DEFAULT NULL COMMENT '过期时间',
`service_time` datetime NULL DEFAULT NULL COMMENT '使用时间',
`money` decimal(10, 2) UNSIGNED NOT NULL COMMENT '抵扣金额',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=未使用,1=已使用,2=锁定',
`trade_no` char(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单号',
`note` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注信息',
`mode` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '抵扣模式',
`category_id` int UNSIGNED NULL DEFAULT 0 COMMENT '商品分类ID',
`life` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '卡密使用寿命',
`use_life` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '已使用次数',
`race` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品类别',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `code`(`code` ASC) USING BTREE,
INDEX `commodity_id`(`commodity_id` ASC) USING BTREE,
INDEX `owner`(`owner` ASC) USING BTREE,
INDEX `create_time`(`create_time` ASC) USING BTREE,
INDEX `money`(`money` ASC) USING BTREE,
INDEX `status`(`status` ASC) USING BTREE,
INDEX `order_id`(`trade_no` ASC) USING BTREE,
INDEX `note`(`note` ASC) USING BTREE,
INDEX `race`(`race` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__manage`;
CREATE TABLE `__PREFIX__manage` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`email` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '邮箱',
`password` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`security_password` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '安全密码',
`nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',
`salt` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '盐',
`avatar` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=冻结,1=正常',
`type` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型:0=系统账号,1=普通账号(全天),2=日间账号,3=夜间账号',
`create_time` datetime NOT NULL COMMENT '创建时间',
`login_time` datetime NULL DEFAULT NULL COMMENT '登录时间',
`last_login_time` datetime NULL DEFAULT NULL COMMENT '上一次登录时间',
`login_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录IP',
`last_login_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上一次登录IP',
`note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `username`(`email` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__manage` VALUES (1, '__MANAGE_EMAIL__', '__MANAGE_PASSWORD__', NULL, '__MANAGE_NICKNAME__', '__MANAGE_SALT__', '/favicon.ico', 1, 0, '1997-01-01 00:00:00', NULL , NULL, NULL, NULL, NULL);
DROP TABLE IF EXISTS `__PREFIX__order`;
CREATE TABLE `__PREFIX__order` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`owner` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属会员:0=游客,其他等于会员UID',
`user_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '商户ID:0=系统,其他等于会员ID',
`trade_no` char(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单号',
`amount` decimal(10, 2) UNSIGNED NOT NULL COMMENT '订单金额',
`commodity_id` int UNSIGNED NOT NULL COMMENT '商品id',
`card_id` int UNSIGNED NULL DEFAULT NULL COMMENT '预选卡密id',
`card_num` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '卡密数量',
`pay_id` int UNSIGNED NOT NULL COMMENT '支付方式id',
`create_time` datetime NOT NULL COMMENT '下单时间',
`create_ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '下单IP',
`create_device` tinyint UNSIGNED NOT NULL COMMENT '下单设备:0=电脑,1=安卓,2=IOS,3=IPAD',
`pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单状态:0=未支付,1=已支付',
`secret` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '卡密信息',
`password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '查询密码',
`contact` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系方式',
`delivery_status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '发货状态:0=未发货,1=已发货',
`pay_url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`coupon_id` int UNSIGNED NULL DEFAULT NULL COMMENT '优惠卷id',
`cost` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '手续费',
`from` int UNSIGNED NULL DEFAULT NULL COMMENT '推广人id',
`premium` decimal(10, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '加价',
`widget` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '控件内容',
`rent` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '成本价',
`race` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品种类',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `trade_no`(`trade_no` ASC) USING BTREE,
INDEX `commodity_id`(`commodity_id` ASC) USING BTREE,
INDEX `pay_id`(`pay_id` ASC) USING BTREE,
INDEX `contact`(`contact` ASC) USING BTREE,
INDEX `create_ip`(`create_ip` ASC) USING BTREE,
INDEX `owner`(`owner` ASC) USING BTREE,
INDEX `from`(`from` ASC) USING BTREE,
INDEX `user_id`(`user_id` ASC) USING BTREE,
INDEX `card_id`(`card_id` ASC) USING BTREE,
INDEX `create_time`(`create_time` ASC) USING BTREE,
INDEX `delivery_status`(`delivery_status` ASC) USING BTREE,
INDEX `coupon_id`(`coupon_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__order_option`;
CREATE TABLE `__PREFIX__order_option` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`order_id` int UNSIGNED NOT NULL COMMENT '订单id',
`option` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '配置数据',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `order_id`(`order_id` ASC) USING BTREE,
CONSTRAINT `__PREFIX__order_option_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `__PREFIX__order` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__pay`;
CREATE TABLE `__PREFIX__pay` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付名称',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标',
`code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付代码',
`commodity` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '前台状态:0=停用,1=启用',
`recharge` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '充值状态:0=停用,1=启用',
`create_time` datetime NOT NULL COMMENT '添加时间',
`handle` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付平台',
`sort` smallint UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序',
`equipment` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '设备:0=通用,1=手机,2=电脑',
`cost` decimal(10, 3) UNSIGNED NULL DEFAULT 0.000 COMMENT '手续费',
`cost_type` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '手续费模式:0=单笔固定,1=百分比',
PRIMARY KEY (`id`) USING BTREE,
INDEX `commodity`(`commodity` ASC) USING BTREE,
INDEX `recharge`(`recharge` ASC) USING BTREE,
INDEX `sort`(`sort` ASC) USING BTREE,
INDEX `equipment`(`equipment` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__pay` VALUES (1, '余额', '/assets/static/images/wallet.png', '#system', 1, 0, '1997-01-01 00:00:00', '#system', 999, 0, 0.000, 0);
INSERT INTO `__PREFIX__pay` VALUES (2, '支付宝', '/assets/user/images/cash/alipay.png', 'alipay', 1, 1, '1997-01-01 00:00:00', 'Epay', 1, 0, 0.000, 0);
DROP TABLE IF EXISTS `__PREFIX__shared`;
CREATE TABLE `__PREFIX__shared` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`type` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '对接类型:0=内置,其他待扩展',
`name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店铺名称',
`domain` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店铺地址',
`app_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商户ID',
`app_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密钥',
`create_time` datetime NOT NULL COMMENT '创建时间',
`balance` decimal(14, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '余额(缓存)',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `domain`(`domain` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__user`;
CREATE TABLE `__PREFIX__user` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '会员名',
`email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机',
`qq` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'QQ号',
`password` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录密码',
`salt` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '盐',
`app_key` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对接密钥',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像',
`balance` decimal(14, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '余额',
`coin` decimal(14, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '硬币,可提现的币',
`integral` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '积分',
`create_time` datetime NOT NULL COMMENT '注册时间',
`login_time` datetime NULL DEFAULT NULL COMMENT '登录时间',
`last_login_time` datetime NULL DEFAULT NULL COMMENT '上一次登录时间',
`login_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录IP',
`last_login_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上一次登录IP',
`pid` int UNSIGNED NULL DEFAULT 0 COMMENT '上级ID',
`recharge` decimal(14, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '累计充值',
`total_coin` decimal(14, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '累计获得的硬币',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=封禁,1=正常',
`business_level` int UNSIGNED NULL DEFAULT NULL COMMENT '商户等级id',
`nicename` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真实姓名',
`alipay` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付宝账号',
`wechat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信收款二维码',
`settlement` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '自动结算:0=支付宝,1=微信',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE,
UNIQUE INDEX `email`(`email` ASC) USING BTREE,
UNIQUE INDEX `phone`(`phone` ASC) USING BTREE,
INDEX `pid`(`pid` ASC) USING BTREE,
INDEX `business_level`(`business_level` ASC) USING BTREE,
INDEX `coin`(`coin` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__user_category`;
CREATE TABLE `__PREFIX__user_category` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` int UNSIGNED NOT NULL COMMENT '商家id',
`category_id` int UNSIGNED NOT NULL COMMENT '分类id',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '自定义分类名称',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=屏蔽,1=显示',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `user_id`(`user_id` ASC, `category_id` ASC) USING BTREE,
INDEX `status`(`status` ASC) USING BTREE,
INDEX `__PREFIX__user_category_ibfk_2`(`category_id` ASC) USING BTREE,
INDEX `user_id_2`(`user_id` ASC) USING BTREE,
CONSTRAINT `__PREFIX__user_category_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `__PREFIX__user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `__PREFIX__user_category_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `__PREFIX__category` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__user_commodity`;
CREATE TABLE `__PREFIX__user_commodity` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` int UNSIGNED NOT NULL COMMENT '商家id',
`commodity_id` int UNSIGNED NOT NULL COMMENT '商品id',
`premium` float(10, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '商品加价',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '自定义名称',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=隐藏,1=显示',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `user_id`(`user_id` ASC, `commodity_id` ASC) USING BTREE,
INDEX `commodity_id`(`commodity_id` ASC) USING BTREE,
INDEX `user_id_2`(`user_id` ASC) USING BTREE,
INDEX `status`(`status` ASC) USING BTREE,
CONSTRAINT `__PREFIX__user_commodity_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `__PREFIX__user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `__PREFIX__user_commodity_ibfk_2` FOREIGN KEY (`commodity_id`) REFERENCES `__PREFIX__commodity` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__user_group`;
CREATE TABLE `__PREFIX__user_group` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '等级名称',
`icon` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '等级图标',
`discount` decimal(4, 2) UNSIGNED NOT NULL COMMENT '折扣百分比',
`cost` decimal(4, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '抽成比例',
`recharge` decimal(14, 2) UNSIGNED NOT NULL COMMENT '累计充值(达到该等级)',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `recharge`(`recharge` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
INSERT INTO `__PREFIX__user_group` VALUES (1, '一贫如洗', '/assets/static/images/group/ic_user level_1.png', 0.00, 0.30, 0.00);
INSERT INTO `__PREFIX__user_group` VALUES (2, '小康之家', '/assets/static/images/group/ic_user level_2.png', 0.10, 0.25, 50.00);
INSERT INTO `__PREFIX__user_group` VALUES (3, '腰缠万贯', '/assets/static/images/group/ic_user level_3.png', 0.20, 0.20, 100.00);
INSERT INTO `__PREFIX__user_group` VALUES (4, '富甲一方', '/assets/static/images/group/ic_user level_4.png', 0.30, 0.15, 200.00);
INSERT INTO `__PREFIX__user_group` VALUES (5, '富可敌国', '/assets/static/images/group/ic_user level_5.png', 0.40, 0.10, 300.00);
INSERT INTO `__PREFIX__user_group` VALUES (6, '至尊', '/assets/static/images/group/ic_user level_6.png', 0.50, 0.05, 500.00);
DROP TABLE IF EXISTS `__PREFIX__user_recharge`;
CREATE TABLE `__PREFIX__user_recharge` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`trade_no` char(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单号',
`user_id` int UNSIGNED NOT NULL COMMENT '用户id',
`amount` decimal(10, 2) UNSIGNED NOT NULL COMMENT '充值金额',
`pay_id` int UNSIGNED NOT NULL COMMENT '支付id',
`status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态:0=未支付,1=已支付',
`create_time` datetime NOT NULL COMMENT '创建时间',
`create_ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '下单IP',
`pay_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付地址',
`pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
`option` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '配置参数',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `trade_no`(`trade_no` ASC) USING BTREE,
INDEX `user_id`(`user_id` ASC) USING BTREE,
INDEX `pay_id`(`pay_id` ASC) USING BTREE,
INDEX `status`(`status` ASC) USING BTREE,
CONSTRAINT `__PREFIX__user_recharge_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `__PREFIX__user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `__PREFIX__manage_log`;
CREATE TABLE `__PREFIX__manage_log` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '管理员邮箱',
`nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '管理员呢称',
`content` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志内容',
`create_time` datetime NOT NULL COMMENT '创建时间',
`create_ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'IP地址',
`ua` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '浏览器UA',
`risk` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '风险:0=正常,1=异常',
PRIMARY KEY (`id`) USING BTREE,
INDEX `create_ip`(`create_ip`) USING BTREE,
INDEX `create_time`(`create_time`) USING BTREE,
INDEX `risk`(`risk`) USING BTREE,
INDEX `email`(`email`) USING BTREE,
INDEX `nickname`(`nickname`) USING BTREE,
INDEX `content`(`content`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; |
create or replace package body SearchArea as
function searchPlace(loc in location.area@site_link%TYPE)
return number
is
sl number := 0;
begin
select lid into sl from location@site_link
where area = loc;
return sl;
exception
when no_data_found then
dbms_output.put_line('No location found !!');
end searchPlace;
--for find location and price
--/*
procedure ShowParkingSloat(locid in location.lid@site_link%TYPE)
IS
--a number := 0 ;
begin
DBMS_OUTPUT.PUT_LINE('ParkingSlotId Price Availability OwnerName PhoneNo');
FOR R IN (SELECT psid,lid,price,booked,oid,oname,phoneno from pjw) LOOP
if (locid = R.lid and R.booked = 0) then
--DBMS_OUTPUT.PUT_LINE(R.psid||' '||R.lid||' '||R.price||' '||R.booked||' '|| R.oid||' '||R.oname||' '|| R.phoneno);
DBMS_OUTPUT.PUT_LINE(R.psid||' '||R.price||' '||R.booked||' '||R.oname||' '|| R.phoneno);
end if;
END LOOP;
--execute immediate 'select psid,lid,price,booked,oid,phoneno from pjw where oid = (:b1)'using locid;
--Uses(a);
end ShowParkingSloat;
--*/
end SearchArea;
/ |
-------------------------------------------------------
--
-- Title : [dbo].[GetAverageCommunityRating]
-- Description : This function can be used to retrieve average rating of a Community
-- Input : ID of the Community.
-- Output : Average Rating of the community.
-- Author : v-vichan
-- Date : 09 Aug 2011
--
-------------------------------------------------------
CREATE FUNCTION [dbo].[GetAverageCommunityRating]
(
@CommunityID BIGINT
)
RETURNS DECIMAL(3,2)
AS
BEGIN
DECLARE @AverageRating DECIMAL(3,2)
SELECT @AverageRating = AVG (dbo.[CommunityRatings].[Rating])
FROM dbo.[CommunityRatings]
WHERE dbo.[CommunityRatings].CommunityID = @CommunityID
RETURN @AverageRating
END
|
DROP TABLE IF EXISTS TASK;
DROP TABLE IF EXISTS ApplicationUser;
create table if not exists TASK (
id int GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) primary key,
description varchar(7000000));
create table if not exists ApplicationUser (
id int GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) primary key,
username varchar(64),
password varchar(64));
|
<filename>db/mysql/resumen_fenograma_ejecucion.sql
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-10-2020 a las 15:58:55
-- Versión del servidor: 10.1.36-MariaDB
-- Versión de PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `yura_db`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `resumen_fenograma_ejecucion`
--
CREATE TABLE `resumen_fenograma_ejecucion` (
`id_resumen_fenograma_ejecucion` int(11) NOT NULL,
`id_ciclo` int(11) NOT NULL,
`id_modulo` int(11) NOT NULL,
`nombre_modulo` varchar(250) COLLATE utf8_bin NOT NULL,
`fecha_inicio` date NOT NULL,
`fecha_fin` date NOT NULL,
`semana` int(4) NOT NULL,
`id_variedad` int(11) NOT NULL,
`siglas_variedad` varchar(6) COLLATE utf8_bin NOT NULL,
`nombre_variedad` varchar(250) COLLATE utf8_bin NOT NULL,
`poda_siembra` char(1) COLLATE utf8_bin NOT NULL,
`dias` int(11) NOT NULL,
`area_m2` float NOT NULL,
`total_x_semana_m2` float NOT NULL,
`primera_flor` int(11) DEFAULT NULL,
`porciento_mortalidad` float NOT NULL,
`tallos_cosechados` int(11) DEFAULT NULL,
`real_tallos_m2` float NOT NULL,
`porciento_cosechado` float NOT NULL,
`proy_tallos_m2` float NOT NULL,
`plantas_iniciales` int(11) NOT NULL,
`plantas_actuales` int(11) NOT NULL,
`plantas_muertas` int(11) NOT NULL,
`densidad_plantas_ini_m2` float NOT NULL,
`conteo` float NOT NULL,
`id_planta` int(11) NOT NULL,
`siglas_planta` varchar(6) COLLATE utf8_bin NOT NULL,
`nombre_planta` varchar(250) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `resumen_fenograma_ejecucion`
--
ALTER TABLE `resumen_fenograma_ejecucion`
ADD PRIMARY KEY (`id_resumen_fenograma_ejecucion`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `resumen_fenograma_ejecucion`
--
ALTER TABLE `resumen_fenograma_ejecucion`
MODIFY `id_resumen_fenograma_ejecucion` 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 */;
|
<filename>CMSDataScripts/dbo/Views/vw_carrot_CategoryURL.sql
CREATE VIEW [dbo].[vw_carrot_CategoryURL]
AS
select s.SiteID, cc.ContentCategoryID, cc.CategoryText, cc.IsPublic, cc2.EditDate,
ISNULL(cc2.TheCount, 0) as UseCount, ISNULL(cc3.TheCount, 0) as PublicUseCount,
'/' + s.Blog_FolderPath + '/' + s.Blog_CategoryPath + '/' + cc.CategorySlug + '.aspx' as CategoryUrl
from [dbo].carrot_Sites as s
inner join [dbo].carrot_ContentCategory as cc on s.SiteID = cc.SiteID
left join (select m.ContentCategoryID, MAX(v_cc.EditDate) as EditDate, COUNT(m.Root_ContentID) as TheCount
from [dbo].vw_carrot_Content v_cc
join [dbo].carrot_CategoryContentMapping m on v_cc.Root_ContentID = m.Root_ContentID
where v_cc.IsLatestVersion = 1
group by m.ContentCategoryID) as cc2 on cc.ContentCategoryID = cc2.ContentCategoryID
left join (select m.ContentCategoryID, COUNT(m.Root_ContentID) as TheCount
from [dbo].vw_carrot_Content v_cc
join [dbo].carrot_CategoryContentMapping m on v_cc.Root_ContentID = m.Root_ContentID
where v_cc.IsLatestVersion = 1
and v_cc.PageActive = 1 and v_cc.RetireDate >= GETUTCDATE() and v_cc.GoLiveDate <= GETUTCDATE()
group by m.ContentCategoryID) as cc3 on cc.ContentCategoryID = cc3.ContentCategoryID |
create table sec_messages
(
id int auto_increment
primary key,
guild_id bigint not null,
channel_id bigint not null,
author_name text not null,
author_id bigint not null,
content longtext not null,
media_url text not null,
createdAt datetime default CURRENT_TIMESTAMP null,
fl_pin tinyint(1) default 0 not null,
constraint sec_messages_sec_channels_id_fk
foreign key (channel_id) references sec_channels (id)
on delete cascade,
constraint sec_messages_sec_guilds_id_fk
foreign key (guild_id) references sec_guilds (id)
on delete cascade
);
|
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 31, 2020 at 02:34 PM
-- Server version: 5.7.26
-- PHP Version: 5.6.40
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: `reactorsdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `adherance`
--
DROP TABLE IF EXISTS `adherance`;
CREATE TABLE IF NOT EXISTS `adherance`
(
`user_id` int(11) NOT NULL,
`association_id` int(11) NOT NULL,
`joined` datetime NOT NULL,
`fonction` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`role` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_2819DB33A76ED395` (`user_id`),
KEY `IDX_2819DB33EFB9C8A5` (`association_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 10
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
--
-- Dumping data for table `adherance`
--
INSERT INTO `adherance` (`user_id`, `association_id`, `joined`, `fonction`, `id`, `description`, `role`)
VALUES (74, 20, '2020-02-27 00:00:00', 'TESTING UPDATE', 9, 'Fondée lassociation', 1);
-- --------------------------------------------------------
--
-- Table structure for table `association`
--
DROP TABLE IF EXISTS `association`;
CREATE TABLE IF NOT EXISTS `association`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`domaine_id` int(11) DEFAULT NULL,
`id_manager` int(11) DEFAULT NULL,
`nom` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`telephone` int(11) NOT NULL,
`horaire_travail` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`photo_agence` text COLLATE utf8_unicode_ci NOT NULL,
`piece_justificatif` text COLLATE utf8_unicode_ci NOT NULL,
`rue` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`code_postal` int(11) DEFAULT NULL,
`ville` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`latitude` double DEFAULT NULL,
`longitude` double DEFAULT NULL,
`approuved` tinyint(1) NOT NULL,
`description` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_FD8521CC4272FC9F` (`domaine_id`),
KEY `id_manager` (`id_manager`)
) ENGINE = InnoDB
AUTO_INCREMENT = 22
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
--
-- Dumping data for table `association`
--
INSERT INTO `association` (`id`, `domaine_id`, `id_manager`, `nom`, `telephone`, `horaire_travail`, `photo_agence`,
`piece_justificatif`, `rue`, `code_postal`, `ville`, `latitude`, `longitude`, `approuved`,
`description`)
VALUES (20, 76, 74, 'Enactus', 71268147, '8 vers 17', 'enactus.jpeg', 'enactus.docx', '45 rue bab jedid', 2000,
'Nabeul', 0, 0, 1, 'azeazeazeaze'),
(21, 139, 73, 'Lions', 25478985, 'De 6:00 Vers 8:00', 'enactus.jpeg', 'enactus.docx', '45 Rue elsalema', 200,
'Tunis', 20, 20, 0,
'Notre Mission. ENACTUS est une organisation non gouvernementale internationale à but non lucratif, créée en 1975 aux USA. ... ENACTUS accompagne les étudiants dans la mise en oeuvre de projets d\'entrepreneuriat social avec l\'implication de professionnels de l\'entreprise et du corps enseignant.');
-- --------------------------------------------------------
--
-- Table structure for table `association_user`
--
DROP TABLE IF EXISTS `association_user`;
CREATE TABLE IF NOT EXISTS `association_user`
(
`association_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`association_id`, `user_id`),
KEY `IDX_A2312D48EFB9C8A5` (`association_id`),
KEY `IDX_A2312D48A76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
--
-- Dumping data for table `association_user`
--
INSERT INTO `association_user` (`association_id`, `user_id`)
VALUES (16, 42),
(16, 43);
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
CREATE TABLE IF NOT EXISTS `category`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 144
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `name`, `description`)
VALUES (76, 'Humanitaire', 'azeaze'),
(133, 'added', 'added'),
(138, 'testaazeazezeaze', 'aaaaaaaaaaa'),
(139, 'azeazeazeaze', 'eazeazeaze'),
(141, 'azeazeazeazeazeaze', 'eazeazeazeazeazeazeaze'),
(142, 'azeazeazeaze', 'eazeazeaze'),
(143, 'Sanitaire', 'Domaine de dra chnya');
-- --------------------------------------------------------
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
CREATE TABLE IF NOT EXISTS `comment`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`hebergement_id` int(11) NOT NULL,
`content` longtext COLLATE utf8_unicode_ci NOT NULL,
`creation_date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_9474526CA76ED395` (`user_id`),
KEY `IDX_9474526C23BB0F66` (`hebergement_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
CREATE TABLE IF NOT EXISTS `comments`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`thread_id` int(11) NOT NULL,
`content` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_5F9E962AA76ED395` (`user_id`),
KEY `IDX_5F9E962AE2904019` (`thread_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `demande`
--
DROP TABLE IF EXISTS `demande`;
CREATE TABLE IF NOT EXISTS `demande`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`domaine_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`state` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ups` int(11) NOT NULL,
`creationDate` date NOT NULL,
`rib` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`latitude` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`longitude` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_2694D7A54272FC9F` (`domaine_id`),
KEY `IDX_2694D7A5A76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `don`
--
DROP TABLE IF EXISTS `don`;
CREATE TABLE IF NOT EXISTS `don`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`domaine_id` int(11) DEFAULT NULL,
`Title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`Description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`state` int(11) NOT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ups` int(11) NOT NULL,
`creationDate` date NOT NULL,
`latitude` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`longitude` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_F8F081D9A76ED395` (`user_id`),
KEY `IDX_F8F081D94272FC9F` (`domaine_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `forum_category`
--
DROP TABLE IF EXISTS `forum_category`;
CREATE TABLE IF NOT EXISTS `forum_category`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`describtion` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `gouvernerat`
--
DROP TABLE IF EXISTS `gouvernerat`;
CREATE TABLE IF NOT EXISTS `gouvernerat`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `hebergement`
--
DROP TABLE IF EXISTS `hebergement`;
CREATE TABLE IF NOT EXISTS `hebergement`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`governorat` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`nbr_rooms` int(11) NOT NULL,
`duration` int(11) NOT NULL,
`creation_date` date NOT NULL,
`state` int(11) NOT NULL,
`telephone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_4852DD9CA76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `hebergement_request`
--
DROP TABLE IF EXISTS `hebergement_request`;
CREATE TABLE IF NOT EXISTS `hebergement_request`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`description` longtext COLLATE utf8_unicode_ci NOT NULL,
`region` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`state` int(11) NOT NULL,
`native_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`arrival_date` date NOT NULL,
`passport_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`civil_status` int(11) NOT NULL,
`children_number` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`telephone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`creation_date` date NOT NULL,
`is_anonymous` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_D42117ADA76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `image`
--
DROP TABLE IF EXISTS `image`;
CREATE TABLE IF NOT EXISTS `image`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`hebergement_id` int(11) NOT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_C53D045F23BB0F66` (`hebergement_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `imagedon`
--
DROP TABLE IF EXISTS `imagedon`;
CREATE TABLE IF NOT EXISTS `imagedon`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`don_id` int(11) DEFAULT NULL,
`demande_id` int(11) DEFAULT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_9B5927647B3C9061` (`don_id`),
KEY `IDX_9B59276480E95E18` (`demande_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `invitation`
--
DROP TABLE IF EXISTS `invitation`;
CREATE TABLE IF NOT EXISTS `invitation`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_mission` int(11) DEFAULT NULL,
`id_notification` int(11) DEFAULT NULL,
`id_user` int(11) DEFAULT NULL,
`etat` enum ('inviter','accepter','réfuser') COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_F11D61A29C9503B8` (`id_notification`),
KEY `IDX_F11D61A24EFA5B4C` (`id_mission`),
KEY `IDX_F11D61A26B3CA4B` (`id_user`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `mission`
--
DROP TABLE IF EXISTS `mission`;
CREATE TABLE IF NOT EXISTS `mission`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`domaine_id` int(11) DEFAULT NULL,
`TitleMission` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`picture` text COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`location` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`sumCollected` double NOT NULL,
`objectif` double NOT NULL,
`DateCreation` date NOT NULL,
`ups` int(11) NOT NULL,
`DateFin` date NOT NULL,
`latitude` double DEFAULT NULL,
`longitude` double DEFAULT NULL,
`CreatedBy` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_9067F23C4272FC9F` (`domaine_id`),
KEY `IDX_9067F23C51A7C4E1` (`CreatedBy`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `mission_donation`
--
DROP TABLE IF EXISTS `mission_donation`;
CREATE TABLE IF NOT EXISTS `mission_donation`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_user` int(11) DEFAULT NULL,
`id_mission` int(11) DEFAULT NULL,
`somme_donner` double NOT NULL,
`dateDonation` date NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_391980196B3CA4B` (`id_user`),
KEY `IDX_391980194EFA5B4C` (`id_mission`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `notification`
--
DROP TABLE IF EXISTS `notification`;
CREATE TABLE IF NOT EXISTS `notification`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_user` int(11) DEFAULT NULL,
`id_mission` int(11) DEFAULT NULL,
`id_association` int(11) DEFAULT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` longtext COLLATE utf8_unicode_ci NOT NULL,
`icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`route` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`route_parameters` longtext COLLATE utf8_unicode_ci COMMENT '(DC2Type:array)',
`notification_date` datetime NOT NULL,
`seen` tinyint(1) NOT NULL,
`id_invitation` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_BF5476CA5497E175` (`id_invitation`),
KEY `IDX_BF5476CA6B3CA4B` (`id_user`),
KEY `IDX_BF5476CA4EFA5B4C` (`id_mission`),
KEY `IDX_BF5476CAE597EC3B` (`id_association`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `post_like`
--
DROP TABLE IF EXISTS `post_like`;
CREATE TABLE IF NOT EXISTS `post_like`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`don_id` int(11) DEFAULT NULL,
`demande_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_653627B8A76ED395` (`user_id`),
KEY `IDX_653627B87B3C9061` (`don_id`),
KEY `IDX_653627B880E95E18` (`demande_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `refugee`
--
DROP TABLE IF EXISTS `refugee`;
CREATE TABLE IF NOT EXISTS `refugee`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`native_country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`case_description` longtext COLLATE utf8_unicode_ci NOT NULL,
`arrival_date` date NOT NULL,
`passport_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`civil_status` int(11) NOT NULL,
`children_number` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_9CFB8546A76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `requete`
--
DROP TABLE IF EXISTS `requete`;
CREATE TABLE IF NOT EXISTS `requete`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`rponse_id` int(11) DEFAULT NULL,
`Sujet` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`DernierMAJ` datetime NOT NULL,
`Statut` int(11) NOT NULL,
`Type` int(11) NOT NULL,
`Description` longtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_1E6639AAF086BD47` (`rponse_id`),
KEY `IDX_1E6639AAA76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `rponse`
--
DROP TABLE IF EXISTS `rponse`;
CREATE TABLE IF NOT EXISTS `rponse`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`requete_id` int(11) NOT NULL,
`Sujet` longtext COLLATE utf8_unicode_ci NOT NULL,
`Rep` longtext COLLATE utf8_unicode_ci NOT NULL,
`Date` datetime NOT NULL,
`Rating` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_163C533B18FB544F` (`requete_id`),
KEY `IDX_163C533BA76ED395` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `threads`
--
DROP TABLE IF EXISTS `threads`;
CREATE TABLE IF NOT EXISTS `threads`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`Lastmodified` date NOT NULL,
PRIMARY KEY (`id`),
KEY `IDX_6F8E3DDDA76ED395` (`user_id`),
KEY `IDX_6F8E3DDD12469DE2` (`category_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `up`
--
DROP TABLE IF EXISTS `up`;
CREATE TABLE IF NOT EXISTS `up`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`mission_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_4394EE70A76ED395` (`user_id`),
KEY `IDX_4394EE70BE6CAE90` (`mission_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(180) COLLATE utf8_unicode_ci NOT NULL,
`username_canonical` varchar(180) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(180) COLLATE utf8_unicode_ci NOT NULL,
`email_canonical` varchar(180) COLLATE utf8_unicode_ci NOT NULL,
`enabled` tinyint(1) NOT NULL,
`salt` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_login` datetime DEFAULT NULL,
`confirmation_token` varchar(180) COLLATE utf8_unicode_ci DEFAULT NULL,
`password_requested_at` datetime DEFAULT NULL,
`roles` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:array)',
`nom` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`prenom` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`date_naissance` date DEFAULT NULL,
`telephone` int(11) DEFAULT NULL,
`adresse` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`approuved` tinyint(1) DEFAULT NULL,
`banned` tinyint(1) NOT NULL,
`image` text COLLATE utf8_unicode_ci,
`cin` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`is_admin` tinyint(1) DEFAULT NULL,
`is_ass_admin` tinyint(1) DEFAULT NULL,
`password_plain` varchar(120) COLLATE utf8_unicode_ci DEFAULT NULL,
`is_member` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_8D93D64992FC23A8` (`username_canonical`),
UNIQUE KEY `UNIQ_8D93D649A0D96FBF` (`email_canonical`),
UNIQUE KEY `UNIQ_8D93D649C05FB297` (`confirmation_token`)
) ENGINE = InnoDB
AUTO_INCREMENT = 80
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `username_canonical`, `email`, `email_canonical`, `enabled`, `salt`, `password`,
`last_login`, `confirmation_token`, `password_requested_at`, `roles`, `nom`, `prenom`,
`date_naissance`, `telephone`, `adresse`, `approuved`, `banned`, `image`, `cin`, `is_admin`,
`is_ass_admin`, `password_plain`, `is_member`)
VALUES (72, 'adminuser1', 'adminuser1', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$kPwcufWkmi/Gb6TVlx2DTOY9vF.dHNbfmXski6oBUEwny0ikWwtXO', '2020-03-03 00:00:00', NULL, NULL,
'a:1:{i:0;s:16:\"ROLE_SUPER_ADMIN\";}', 'Chihab', 'Hajji', '2020-03-10', NULL, NULL, 1, 0, 'user.png',
'09632013', NULL, NULL, NULL, NULL),
(73, 'user', 'user', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$tP8GcF7YwV/dB0j9LO0oieWxQXqx24W9PZBH/RQ6WLYmpPMF2Gc6S', '2020-03-03 00:00:00', NULL, NULL,
'a:1:{i:0;s:11:\"ROLE_CLIENT\";}', 'Chihab', 'Hajji', '2020-03-17', NULL, NULL, 1, 0, 'user.png', NULL, NULL,
NULL, NULL, NULL),
(74, 'assadmin', 'assadmin', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$06u5uSPoVQplVn/n.o8LWuuyqIwAItQejvrFXMASY0ChV7ixWMIoO', '2020-02-27 10:47:51', NULL, NULL,
'a:1:{i:0;s:22:\"ROLE_ASSOCIATION_ADMIN\";}', 'Hajji', 'Chihab', '2020-03-18', NULL, NULL, 1, 0, 'user.png',
NULL, NULL, NULL, NULL, NULL),
(75, 'test', 'test', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$JUFUU46O3lE6HF76UjNNAugE0SMKudpsmPeFlvQXJZfRFz0/n28IO', '2020-03-02 10:48:40', NULL, NULL,
'a:1:{i:0;s:11:\"ROLE_CLIENT\";}', 'chihab', 'hajji', '2017-03-03', 96320, 'azeaze', 1, 0, 'user.png', NULL,
NULL, NULL, NULL, NULL),
(76, 'yfzyafrr', 'yfzyafrr', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$E9K1yJfBotlReYYVL1dQBeJGVIGiBLuGRbLImnK.f1bqjaPVAVLFG', '2020-03-16 22:18:23', NULL, NULL,
'a:1:{i:0;s:11:\"ROLE_CLIENT\";}', 'chihab', 'hajji', '2019-04-04', 9632013, 'azeaze', 1, 0, 'user.png', NULL,
NULL, NULL, NULL, NULL),
(78, 'chih', 'chih', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$kQFsyhtsAiCNGJydA5doaOH31J46cUZ4VZCXZVeZuJqOgeUCppB82', '2020-03-16 22:54:58', NULL, NULL,
'a:1:{i:0;s:11:\"ROLE_CLIENT\";}', 'chihab', 'hajji', '2018-04-03', 29164666, 'aez', 1, 0, 'user.png', NULL,
NULL, NULL, NULL, NULL),
(79, 'pol', 'pol', '<EMAIL>', '<EMAIL>', 1, NULL,
'$2y$13$Ai7Qi1tCXg3R1np4RedabO9L3rZ5bNAbl3xBBeTutNGJY54U2PxLS', '2020-03-16 23:00:21', NULL, NULL,
'a:1:{i:0;s:11:\"ROLE_CLIENT\";}', 'caze', 'eaze', '2018-04-03', 29164666, 'azea', 1, 0, 'user.png', NULL, NULL,
NULL, NULL, NULL);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `adherance`
--
ALTER TABLE `adherance`
ADD CONSTRAINT `FK_2819DB33A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_2819DB33EFB9C8A5` FOREIGN KEY (`association_id`) REFERENCES `association` (`id`);
--
-- Constraints for table `association`
--
ALTER TABLE `association`
ADD CONSTRAINT `FK_FD8521CC24B98CC9` FOREIGN KEY (`id_manager`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_FD8521CC4272FC9F` FOREIGN KEY (`domaine_id`) REFERENCES `category` (`id`);
--
-- Constraints for table `comment`
--
ALTER TABLE `comment`
ADD CONSTRAINT `FK_9474526C23BB0F66` FOREIGN KEY (`hebergement_id`) REFERENCES `hebergement` (`id`),
ADD CONSTRAINT `FK_9474526CA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `FK_5F9E962AA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_5F9E962AE2904019` FOREIGN KEY (`thread_id`) REFERENCES `threads` (`id`);
--
-- Constraints for table `demande`
--
ALTER TABLE `demande`
ADD CONSTRAINT `FK_2694D7A54272FC9F` FOREIGN KEY (`domaine_id`) REFERENCES `category` (`id`),
ADD CONSTRAINT `FK_2694D7A5A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `don`
--
ALTER TABLE `don`
ADD CONSTRAINT `FK_F8F081D94272FC9F` FOREIGN KEY (`domaine_id`) REFERENCES `category` (`id`),
ADD CONSTRAINT `FK_F8F081D9A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `hebergement`
--
ALTER TABLE `hebergement`
ADD CONSTRAINT `FK_4852DD9CA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `hebergement_request`
--
ALTER TABLE `hebergement_request`
ADD CONSTRAINT `FK_D42117ADA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `image`
--
ALTER TABLE `image`
ADD CONSTRAINT `FK_C53D045F23BB0F66` FOREIGN KEY (`hebergement_id`) REFERENCES `hebergement` (`id`);
--
-- Constraints for table `imagedon`
--
ALTER TABLE `imagedon`
ADD CONSTRAINT `FK_9B5927647B3C9061` FOREIGN KEY (`don_id`) REFERENCES `don` (`id`),
ADD CONSTRAINT `FK_9B59276480E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`);
--
-- Constraints for table `invitation`
--
ALTER TABLE `invitation`
ADD CONSTRAINT `FK_F11D61A24EFA5B4C` FOREIGN KEY (`id_mission`) REFERENCES `mission` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `FK_F11D61A26B3CA4B` FOREIGN KEY (`id_user`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_F11D61A29C9503B8` FOREIGN KEY (`id_notification`) REFERENCES `notification` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `mission`
--
ALTER TABLE `mission`
ADD CONSTRAINT `FK_9067F23C4272FC9F` FOREIGN KEY (`domaine_id`) REFERENCES `category` (`id`),
ADD CONSTRAINT `FK_9067F23C51A7C4E1` FOREIGN KEY (`CreatedBy`) REFERENCES `user` (`id`);
--
-- Constraints for table `mission_donation`
--
ALTER TABLE `mission_donation`
ADD CONSTRAINT `FK_391980194EFA5B4C` FOREIGN KEY (`id_mission`) REFERENCES `mission` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `FK_391980196B3CA4B` FOREIGN KEY (`id_user`) REFERENCES `user` (`id`);
--
-- Constraints for table `notification`
--
ALTER TABLE `notification`
ADD CONSTRAINT `FK_BF5476CA4EFA5B4C` FOREIGN KEY (`id_mission`) REFERENCES `mission` (`id`),
ADD CONSTRAINT `FK_BF5476CA5497E175` FOREIGN KEY (`id_invitation`) REFERENCES `invitation` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `FK_BF5476CA6B3CA4B` FOREIGN KEY (`id_user`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_BF5476CAE597EC3B` FOREIGN KEY (`id_association`) REFERENCES `association` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `post_like`
--
ALTER TABLE `post_like`
ADD CONSTRAINT `FK_653627B87B3C9061` FOREIGN KEY (`don_id`) REFERENCES `don` (`id`),
ADD CONSTRAINT `FK_653627B880E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`),
ADD CONSTRAINT `FK_653627B8A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `refugee`
--
ALTER TABLE `refugee`
ADD CONSTRAINT `FK_9CFB8546A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `requete`
--
ALTER TABLE `requete`
ADD CONSTRAINT `FK_1E6639AAA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_1E6639AAF086BD47` FOREIGN KEY (`rponse_id`) REFERENCES `rponse` (`id`);
--
-- Constraints for table `rponse`
--
ALTER TABLE `rponse`
ADD CONSTRAINT `FK_163C533B18FB544F` FOREIGN KEY (`requete_id`) REFERENCES `requete` (`id`),
ADD CONSTRAINT `FK_163C533BA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `threads`
--
ALTER TABLE `threads`
ADD CONSTRAINT `FK_6F8E3DDD12469DE2` FOREIGN KEY (`category_id`) REFERENCES `forum_category` (`id`),
ADD CONSTRAINT `FK_6F8E3DDDA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `up`
--
ALTER TABLE `up`
ADD CONSTRAINT `FK_4394EE70A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_4394EE70BE6CAE90` FOREIGN KEY (`mission_id`) REFERENCES `mission` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT = @OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS = @OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION = @OLD_COLLATION_CONNECTION */;
|
CREATE TABLE metric (
id int NOT NULL AUTO_INCREMENT,
wifiSpeed double NOT NULL,
timeStamp VARCHAR(255) NOT NULL,
isConsumed boolean,
PRIMARY KEY (id)
); |
CREATE DATABASE trsearch;
|
{{
config(
tags=['unit-test', 'bigquery', 'snowflake', 'postgres', 'subpack']
)
}}
{% call dbt_unit_testing.test('sub_package_model_b_references_a', 'sample test') %}
{% call dbt_unit_testing.mock_ref ('sub_package_model_a') %}
select 0 as a, 'a' as b
UNION ALL
select 1 as a, 'b' as b
{% endcall %}
{% call dbt_unit_testing.mock_source ('dbt_unit_testing', 'sub_package_sample_source') %}
select 2 as a, 'c' as b
{% endcall %}
{% call dbt_unit_testing.expect() %}
select 1 as a, 'b' as b
UNION ALL
select 2 as a, 'c' as b
{% endcall %}
{% endcall %}
|
create or replace function pgq.register_consumer(
x_queue_name text,
x_consumer_id text)
returns integer as $$
-- ----------------------------------------------------------------------
-- Function: pgq.register_consumer(2)
--
-- Subscribe consumer on a queue.
--
-- From this moment forward, consumer will see all events in the queue.
--
-- Parameters:
-- x_queue_name - Name of queue
-- x_consumer_name - Name of consumer
--
-- Returns:
-- 0 - if already registered
-- 1 - if new registration
-- ----------------------------------------------------------------------
begin
return pgq.register_consumer_at(x_queue_name, x_consumer_id, NULL);
end;
$$ language plpgsql security definer;
create or replace function pgq.register_consumer_at(
x_queue_name text,
x_consumer_name text,
x_tick_pos bigint)
returns integer as $$
-- ----------------------------------------------------------------------
-- Function: pgq.register_consumer(3)
--
-- Extended registration, allows to specify tick_id.
--
-- Note:
-- For usage in special situations.
--
-- Parameters:
-- x_queue_name - Name of a queue
-- x_consumer_name - Name of consumer
-- x_tick_pos - Tick ID
--
-- Returns:
-- 0/1 whether consumer has already registered.
-- ----------------------------------------------------------------------
declare
tmp text;
last_tick bigint;
x_queue_id integer;
x_consumer_id integer;
queue integer;
sub record;
begin
select queue_id into x_queue_id from pgq.queue
where queue_name = x_queue_name;
if not found then
raise exception 'Event queue not created yet';
end if;
-- get consumer and create if new
select co_id into x_consumer_id from pgq.consumer
where co_name = x_consumer_name;
if not found then
insert into pgq.consumer (co_name) values (x_consumer_name);
x_consumer_id := currval('pgq.consumer_co_id_seq');
end if;
-- if particular tick was requested, check if it exists
if x_tick_pos is not null then
perform 1 from pgq.tick
where tick_queue = x_queue_id
and tick_id = x_tick_pos;
if not found then
raise exception 'cannot reposition, tick not found: %', x_tick_pos;
end if;
end if;
-- check if already registered
select sub_last_tick, sub_batch into sub
from pgq.subscription
where sub_consumer = x_consumer_id
and sub_queue = x_queue_id;
if found then
if x_tick_pos is not null then
if sub.sub_batch is not null then
raise exception 'reposition while active not allowed';
end if;
-- update tick pos if requested
update pgq.subscription
set sub_last_tick = x_tick_pos
where sub_consumer = x_consumer_id
and sub_queue = x_queue_id;
end if;
-- already registered
return 0;
end if;
-- new registration
if x_tick_pos is null then
-- start from current tick
select tick_id into last_tick from pgq.tick
where tick_queue = x_queue_id
order by tick_queue desc, tick_id desc
limit 1;
if not found then
raise exception 'No ticks for this queue. Please run ticker on database.';
end if;
else
last_tick := x_tick_pos;
end if;
-- register
insert into pgq.subscription (sub_queue, sub_consumer, sub_last_tick)
values (x_queue_id, x_consumer_id, last_tick);
return 1;
end;
$$ language plpgsql security definer;
|
ALTER TABLE `character_pet`
ADD COLUMN `modelid` int(11) unsigned default '0' after `owner`;
UPDATE `character_pet`,`creature_template`
SET `character_pet`.`modelid` = `creature_template`.`modelid_m`
WHERE `character_pet`.`modelid` = 0 AND `character_pet`.`entry` = `creature_template`.`entry`;
UPDATE `character_pet`,`creature_template`
SET `character_pet`.`modelid` = `creature_template`.`modelid_f`
WHERE `character_pet`.`modelid` = 0 AND `character_pet`.`entry` = `creature_template`.`entry`;
|
<reponame>uk-gov-mirror/defra.water-abstraction-tactical-crm
alter table crm.entity_roles
add column permissions jsonb;
|
<reponame>Fin3-Technologies-Inc/digital-currency-consortium
ALTER TABLE coin_mint ADD COLUMN address TEXT;
UPDATE coin_mint
SET address = (SELECT address FROM address_registration WHERE address_registration.uuid = coin_mint.address_registration_uuid);
ALTER TABLE coin_mint ALTER COLUMN address SET NOT NULL;
ALTER TABLE coin_mint ALTER COLUMN address_registration_uuid DROP NOT NULL;
|
<filename>src/gateway/sql/static/postgres/v7/create_indexes.sql
-- apis
CREATE INDEX idx_apis_account_id ON apis USING btree(account_id);
-- endpoint_groups
CREATE INDEX idx_endpoint_groups_api_id ON endpoint_groups USING btree(api_id);
-- environments
CREATE INDEX idx_environments_api_id ON environments USING btree(api_id);
-- hosts
CREATE INDEX idx_hosts_api_id ON hosts USING btree(api_id);
-- libraries
CREATE INDEX idx_libraries_api_id ON libraries USING btree(api_id);
-- proxy_endpoints
CREATE INDEX idx_proxy_endpoints_api_id ON proxy_endpoints USING btree(api_id);
CREATE INDEX idx_proxy_endpoints_endpoint_group_id ON proxy_endpoints USING btree(endpoint_group_id);
CREATE INDEX idx_proxy_endpoints_environment_id ON proxy_endpoints USING btree(environment_id);
-- proxy_endpoint_calls
CREATE INDEX idx_proxy_endpoint_calls_component_id ON proxy_endpoint_calls USING btree(component_id);
CREATE INDEX idx_proxy_endpoint_calls_remote_endpoint_id ON proxy_endpoint_calls USING btree(remote_endpoint_id);
-- proxy_endpoint_components
CREATE INDEX idx_proxy_endpoint_components_endpoint_id ON proxy_endpoint_components USING btree(endpoint_id);
-- proxy_endpoint_transformations
CREATE INDEX idx_proxy_endpoint_transformations_component_id ON proxy_endpoint_transformations USING btree(component_id);
CREATE INDEX idx_proxy_endpoint_transformations_call_id ON proxy_endpoint_transformations USING btree(call_id);
-- remote_endpoints
CREATE INDEX idx_remote_endpoints_api_id ON remote_endpoints USING btree(api_id);
-- proxy_endpoint_schemas
CREATE INDEX idx_proxy_endpoint_schemas_endpoint_id ON proxy_endpoint_schemas USING btree(endpoint_id);
CREATE INDEX idx_proxy_endpoint_schemas_request_schema_id ON proxy_endpoint_schemas USING btree(request_schema_id);
CREATE INDEX idx_proxy_endpoint_schemas_response_schema_id ON proxy_endpoint_schemas USING btree(response_schema_id);
-- proxy_endpoint_test_pairs
CREATE INDEX idx_proxy_endpoint_test_pairs_test_id ON proxy_endpoint_test_pairs USING btree(test_id);
-- proxy_endpoints_tests
CREATE INDEX idx_proxy_endpoint_tests_endpoint_id ON proxy_endpoint_tests USING btree(endpoint_id);
-- schemas
CREATE INDEX idx_schemas_api_id ON schemas USING btree(api_id);
-- soap_remote_endpoints
CREATE INDEX idx_soap_remote_endpoints_remote_endpoint_id ON soap_remote_endpoints USING btree(remote_endpoint_id);
-- users
CREATE INDEX idx_users_account_id ON users USING btree(account_id);
CREATE INDEX idx_users_token ON users USING btree(token);
CREATE INDEX idx_users_email ON users USING btree(email);
ANALYZE;
|
<filename>scripts/migration/migrate_datasets.sql
--copy studyversion fields to datasetversion
update datasetversion
set createtime = sv.createtime,
lastupdatetime = sv.lastupdatetime,
archivetime= sv.archivetime,
archivenote = sv.archivenote,
deaccessionlink = sv.deaccessionlink,
versionnote = sv.versionnote
from _dvn3_studyversion sv, dataset d, _dvn3_study s
where d.authority = s.authority
and d.protocol = s.protocol
and d.identifier = s.studyid
and datasetversion.dataset_id = d.id
and datasetversion.versionnumber = sv.versionnumber
and sv.study_id = s.id;
-- set dataset.publication date to the releasetime of the earliest released studyversion
update dvobject
set publicationdate = m.releasetime
from (select dvobject.id, sv.study_id, min(sv.releasetime) as releasetime
from _dvn3_studyversion sv, dataset d, _dvn3_study s, dvobject
where d.authority = s.authority
and d.protocol = s.protocol
and d.identifier = s.studyid
and dvobject.id = d.id
and sv.study_id = s.id
and sv.versionstate!='DRAFT' group by sv.study_id, dvobject.id) m where m.id = dvobject.id;
-- set dvobject creator_id for each dataset to study.creator_id
update dvobject
set creator_id = s.creator_id, createdate = s.createtime
from _dvn3_study s, dataset d
where d.authority = s.authority
and d.protocol = s.protocol
and d.identifier = s.studyid
and dvobject.id = d.id;
-- migrate data from _dvn3_versioncontributor to datasetversionuser
insert into datasetversionuser ( lastupdatedate, authenticateduser_id, datasetversion_id ) (
select vc.lastupdatetime, vc.contributor_id, dv.id
from _dvn3_versioncontributor vc,
_dvn3_studyversion sv,
_dvn3_study s,
dataset d,
datasetversion dv,
authenticateduser au
where vc.studyversion_id = sv.id
and sv.study_id = s.id
and d.authority = s.authority
and d.protocol = s.protocol
and d.identifier = s.studyid
and dv.dataset_id = d.id
and dv.versionnumber = sv.versionnumber
and au.id = vc.contributor_id);
-- modify versionstate for older versions of deaccessioned studies
update datasetversion
set versionstate = 'DEACCESSIONED'
where id in (
select dv1.id from datasetversion dv1, datasetversion dv2
where dv1.dataset_id = dv2.dataset_id
and dv1.versionnumber < dv2.versionnumber
and dv2.versionstate = 'DEACCESSIONED');
-- update the globalidcreatetime to be equal to the publicationdate
update dataset set globalidcreatetime = publicationdate
from dvobject dvo
where dataset.id = dvo.id;
|
/*
PT-889
*/
alter table import_event add column import_expected_count integer;
|
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `attachment`;
CREATE TABLE `attachment` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`rid` bigint(20) unsigned NOT NULL COMMENT '资源id',
`name` varchar(50) DEFAULT NULL COMMENT '名称',
`desc` varchar(255) DEFAULT NULL COMMENT '资源描述',
`suffix` varchar(8) DEFAULT NULL COMMENT '文件后缀',
`size` int(5) DEFAULT NULL COMMENT '文件大小(kb)',
`url` varchar(255) DEFAULT NULL COMMENT '文件路径',
`created_at` int(11) DEFAULT NULL COMMENT '创建时间',
`creator_id` int(11) DEFAULT NULL COMMENT '创建者',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='附件表';
-- 2018-11-25 07:12:24 |
<reponame>Zhaojia2019/cubrid-testcases<filename>sql/_04_operator_function/_03_string_op/_004_position/cases/1010.sql
--test position with two nchar type
select position(n'ch' in n'nchar') from db_root order by 1; |
DROP TABLE IF EXISTS
auto_chat,
auto_chat_text; |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50626
Source Host : localhost:3306
Source Database : pims02
Target Server Type : MYSQL
Target Server Version : 50626
File Encoding : 65001
Date: 2016-07-12 09:28:44
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `tbl_access_lists`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_access_lists`;
CREATE TABLE `tbl_access_lists` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) DEFAULT NULL,
`class` varchar(50) DEFAULT NULL,
`method` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_access_lists
-- ----------------------------
INSERT INTO `tbl_access_lists` VALUES ('1', '1', 'procurement_plan', null);
INSERT INTO `tbl_access_lists` VALUES ('2', '1', 'purchased_request', null);
INSERT INTO `tbl_access_lists` VALUES ('3', '1', 'purchased_order', null);
INSERT INTO `tbl_access_lists` VALUES ('4', '1', 'groups', null);
INSERT INTO `tbl_access_lists` VALUES ('5', '1', 'categories', null);
INSERT INTO `tbl_access_lists` VALUES ('6', '1', 'suppliers', null);
INSERT INTO `tbl_access_lists` VALUES ('7', '1', 'offices', null);
INSERT INTO `tbl_access_lists` VALUES ('8', '1', 'units', null);
INSERT INTO `tbl_access_lists` VALUES ('9', '1', 'users', null);
INSERT INTO `tbl_access_lists` VALUES ('10', '1', 'inventory', null);
INSERT INTO `tbl_access_lists` VALUES ('11', '1', 'funds', null);
-- ----------------------------
-- Table structure for `tbl_categories`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_categories`;
CREATE TABLE `tbl_categories` (
`cat_id` int(11) NOT NULL AUTO_INCREMENT,
`cat_code` varchar(20) DEFAULT NULL,
`cat_description` text,
PRIMARY KEY (`cat_id`),
UNIQUE KEY `code` (`cat_code`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_categories
-- ----------------------------
INSERT INTO `tbl_categories` VALUES ('1', 'AV-A', 'Audio-Video Equipment - A');
INSERT INTO `tbl_categories` VALUES ('2', 'AV-B', 'Audio-Video Equipment - B');
INSERT INTO `tbl_categories` VALUES ('3', 'AV-C', 'Auido-Video Equipment - C');
-- ----------------------------
-- Table structure for `tbl_groups`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_groups`;
CREATE TABLE `tbl_groups` (
`grp_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`grp_name` varchar(20) NOT NULL,
`grp_description` varchar(100) NOT NULL,
PRIMARY KEY (`grp_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of tbl_groups
-- ----------------------------
INSERT INTO `tbl_groups` VALUES ('1', 'admin', 'Administrator');
INSERT INTO `tbl_groups` VALUES ('2', 'members', 'General User');
INSERT INTO `tbl_groups` VALUES ('3', 'Test', 'teststsets');
INSERT INTO `tbl_groups` VALUES ('4', 'asdfasd', ' fasdf asfa');
INSERT INTO `tbl_groups` VALUES ('5', 'asdfasdf', 'ASSSSSCEXXXXXXXX ');
INSERT INTO `tbl_groups` VALUES ('6', 'rtutiters', 'asdfasd fasdfasdfasd fasda');
INSERT INTO `tbl_groups` VALUES ('7', 'adsfa', 'sdfasdfasdfa');
INSERT INTO `tbl_groups` VALUES ('8', 'asdfasd', 'fasdfasdaf');
INSERT INTO `tbl_groups` VALUES ('9', 'adfas', 'dfasdfa');
INSERT INTO `tbl_groups` VALUES ('10', 'asdfa', 'sdfasdfa');
INSERT INTO `tbl_groups` VALUES ('11', 'asdfa', 'sdfadfasa');
INSERT INTO `tbl_groups` VALUES ('12', 'adsfas', 'fasdf asdfa sdfasa');
-- ----------------------------
-- Table structure for `tbl_inventories`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_inventories`;
CREATE TABLE `tbl_inventories` (
`inv_id` int(11) NOT NULL AUTO_INCREMENT,
`inv_qty` decimal(11,2) DEFAULT NULL,
`inv_unit` int(11) DEFAULT NULL,
`inv_date_acquired` date DEFAULT NULL,
`inv_description` text,
`inv_unit_cost` decimal(11,2) DEFAULT NULL,
`inv_class_no` varchar(100) DEFAULT NULL,
`inv_property_no` varchar(100) DEFAULT NULL,
`inv_remarks` text,
`inv_received_from` int(11) DEFAULT NULL,
`inv_received_from_date` date DEFAULT NULL,
`inv_received_by` int(11) DEFAULT NULL,
`inv_received_by_date` date DEFAULT NULL,
PRIMARY KEY (`inv_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_inventories
-- ----------------------------
-- ----------------------------
-- Table structure for `tbl_login_attempts`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_login_attempts`;
CREATE TABLE `tbl_login_attempts` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ip_address` varchar(15) NOT NULL,
`login` varchar(100) NOT NULL,
`time` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of tbl_login_attempts
-- ----------------------------
-- ----------------------------
-- Table structure for `tbl_offices`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_offices`;
CREATE TABLE `tbl_offices` (
`ofc_id` int(11) NOT NULL AUTO_INCREMENT,
`ofc_initial` varchar(10) DEFAULT NULL,
`ofc_code` varchar(10) DEFAULT NULL,
`ofc_name` varchar(100) DEFAULT NULL,
`ofc_parent_id` int(11) DEFAULT NULL,
`ofc_created_by` int(11) DEFAULT NULL,
`ofc_created_date` date DEFAULT NULL,
`ofc_modified_by` int(11) DEFAULT NULL,
`ofc_modified_date` date DEFAULT NULL,
`ofc_deleted_by` int(11) DEFAULT NULL,
`ofc_deleted_date` date DEFAULT NULL,
`ofc_status` tinyint(1) DEFAULT '0',
PRIMARY KEY (`ofc_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_offices
-- ----------------------------
INSERT INTO `tbl_offices` VALUES ('1', 'CMO', '1011', 'City Mayor\'s Office', null, '1', '2016-06-14', null, null, null, null, '0');
INSERT INTO `tbl_offices` VALUES ('2', 'SP', '3392', 'Sangguniang Panlungsod Office - Executive Services', null, '1', '2016-06-14', null, null, null, null, '0');
-- ----------------------------
-- Table structure for `tbl_procurement_plans`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_procurement_plans`;
CREATE TABLE `tbl_procurement_plans` (
`ppmp_id` int(11) NOT NULL AUTO_INCREMENT,
`ppmp_code` int(11) DEFAULT NULL,
`ppmp_description` text,
`ppmp_qty` decimal(11,4) DEFAULT NULL,
`ppmp_unit` int(11) DEFAULT NULL,
`ppmp_budget` decimal(11,2) DEFAULT NULL,
`ppmp_category_id` int(11) DEFAULT NULL,
`ppmp_office_id` int(11) DEFAULT NULL,
`ppmp_source_fund` int(11) DEFAULT NULL,
`ppmp_created_date` datetime DEFAULT NULL,
`ppmp_created_by` int(11) DEFAULT NULL,
`ppmp_modified_date` datetime DEFAULT NULL,
`ppmp_modified_by` int(11) DEFAULT NULL,
`ppmp_deleted_date` date DEFAULT NULL,
`ppmp_deleted_by` int(11) DEFAULT NULL,
PRIMARY KEY (`ppmp_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_procurement_plans
-- ----------------------------
INSERT INTO `tbl_procurement_plans` VALUES ('1', '321', 'Testing', null, '4', '12000.00', '1', '1', '2', '2016-07-05 00:00:00', '1', null, null, null, null);
-- ----------------------------
-- Table structure for `tbl_procurement_plan_schedules`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_procurement_plan_schedules`;
CREATE TABLE `tbl_procurement_plan_schedules` (
`pps_id` int(11) NOT NULL AUTO_INCREMENT,
`pps_ppmp_id` int(11) DEFAULT NULL,
`pps_month` int(11) DEFAULT NULL,
`pps_value` double DEFAULT NULL,
`pps_pr_id` int(11) DEFAULT NULL,
PRIMARY KEY (`pps_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_procurement_plan_schedules
-- ----------------------------
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('1', '1', '1', '5', '1');
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('2', '1', '2', '0', '1');
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('3', '1', '3', '0', '1');
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('4', '1', '4', '5', null);
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('5', '1', '5', '0', null);
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('6', '1', '6', '0', null);
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('7', '1', '7', '5', null);
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('8', '1', '8', '0', null);
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('9', '1', '9', '0', null);
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('10', '1', '10', '5', '2');
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('11', '1', '11', '0', '2');
INSERT INTO `tbl_procurement_plan_schedules` VALUES ('12', '1', '12', '0', '2');
-- ----------------------------
-- Table structure for `tbl_purchased_orders`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_purchased_orders`;
CREATE TABLE `tbl_purchased_orders` (
`po_id` int(11) NOT NULL AUTO_INCREMENT,
`po_supplier_id` int(11) DEFAULT NULL,
`po_department_id` int(11) DEFAULT NULL,
`po_gentlemen` text,
`po_mode_of_procurment` int(11) DEFAULT NULL,
`po_place_of_delivery` text,
`po_date_of_delivery` text,
`po_delivery_term` varchar(50) DEFAULT NULL,
`po_payment_term` varchar(100) DEFAULT NULL,
`po_created_by` int(11) DEFAULT NULL,
`po_created_date` date DEFAULT NULL,
`po_modified_by` int(11) DEFAULT NULL,
`po_modified_date` datetime DEFAULT NULL,
`po_status` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`po_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_purchased_orders
-- ----------------------------
-- ----------------------------
-- Table structure for `tbl_purchased_order_items`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_purchased_order_items`;
CREATE TABLE `tbl_purchased_order_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`qty` int(11) DEFAULT NULL,
`unit` int(11) DEFAULT NULL,
`description` text,
`unit_cost` decimal(11,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_purchased_order_items
-- ----------------------------
-- ----------------------------
-- Table structure for `tbl_purchase_requests`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_purchase_requests`;
CREATE TABLE `tbl_purchase_requests` (
`pr_id` int(11) NOT NULL AUTO_INCREMENT,
`pr_department_id` int(11) DEFAULT NULL,
`pr_sai_no` varchar(50) DEFAULT NULL,
`pr_sai_date` date DEFAULT NULL,
`pr_alobs_no` varchar(50) DEFAULT NULL,
`pr_alobs_date` date DEFAULT NULL,
`pr_quarter` int(11) DEFAULT NULL,
`pr_section` varchar(100) DEFAULT NULL,
`pr_requested_by` int(11) DEFAULT NULL,
`pr_cash_availability_by` int(11) DEFAULT NULL,
`pr_approved_by` int(11) DEFAULT NULL,
`pr_purpose` text,
`pr_created_by` int(11) DEFAULT NULL,
`pr_created_date` date DEFAULT NULL,
`pr_modified_by` int(11) DEFAULT NULL,
`pr_modified_date` date DEFAULT NULL,
PRIMARY KEY (`pr_id`),
UNIQUE KEY `pr_id` (`pr_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_purchase_requests
-- ----------------------------
INSERT INTO `tbl_purchase_requests` VALUES ('1', '1', '', '0000-00-00', '', '0000-00-00', '1', '', '1', null, null, '', '1', '2016-07-06', '1', '2016-07-06');
INSERT INTO `tbl_purchase_requests` VALUES ('2', '1', '', '0000-00-00', '', '0000-00-00', '4', '', '1', null, null, '', '1', '2016-07-06', '1', '2016-07-06');
-- ----------------------------
-- Table structure for `tbl_purchase_request_items`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_purchase_request_items`;
CREATE TABLE `tbl_purchase_request_items` (
`pri_id` int(11) NOT NULL AUTO_INCREMENT,
`pri_pr_id` int(11) DEFAULT NULL,
`pri_ppmp_id` int(11) DEFAULT NULL,
`pri_qty` decimal(11,2) DEFAULT NULL,
`pri_description` text,
`pri_cost` decimal(11,2) DEFAULT NULL,
PRIMARY KEY (`pri_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_purchase_request_items
-- ----------------------------
INSERT INTO `tbl_purchase_request_items` VALUES ('1', '1', '1', '5.00', 'quarter one', '3000.00');
INSERT INTO `tbl_purchase_request_items` VALUES ('3', '2', '1', '5.00', 'quarter four', '3000.00');
-- ----------------------------
-- Table structure for `tbl_purchase_request_item_details`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_purchase_request_item_details`;
CREATE TABLE `tbl_purchase_request_item_details` (
`prid_id` int(11) NOT NULL AUTO_INCREMENT,
`prid_pri_id` int(11) DEFAULT NULL,
`prid_title` varchar(50) DEFAULT NULL,
`prid_description` text,
`prid_cost` decimal(11,2) DEFAULT NULL,
`prid_po_description` text,
`prid_po_cost` decimal(11,2) DEFAULT NULL,
PRIMARY KEY (`prid_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_purchase_request_item_details
-- ----------------------------
-- ----------------------------
-- Table structure for `tbl_purchase_request_item_detail_specs`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_purchase_request_item_detail_specs`;
CREATE TABLE `tbl_purchase_request_item_detail_specs` (
`prs_id` int(11) NOT NULL AUTO_INCREMENT,
`prs_prid_id` int(11) DEFAULT NULL,
`prs_name` varchar(50) DEFAULT NULL,
`prs_qty` decimal(11,4) DEFAULT NULL,
`prs_unit` int(11) DEFAULT NULL,
`prs_cost` decimal(11,2) DEFAULT NULL,
`prc_po_cost` decimal(11,2) DEFAULT NULL,
PRIMARY KEY (`prs_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_purchase_request_item_detail_specs
-- ----------------------------
-- ----------------------------
-- Table structure for `tbl_source_funds`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_source_funds`;
CREATE TABLE `tbl_source_funds` (
`fund_id` int(11) NOT NULL AUTO_INCREMENT,
`fund_name` varchar(100) DEFAULT NULL,
PRIMARY KEY (`fund_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_source_funds
-- ----------------------------
INSERT INTO `tbl_source_funds` VALUES ('1', 'General Funds');
INSERT INTO `tbl_source_funds` VALUES ('2', 'Trust Funds');
-- ----------------------------
-- Table structure for `tbl_sub_categories`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_sub_categories`;
CREATE TABLE `tbl_sub_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) DEFAULT NULL,
`unit` varchar(50) DEFAULT NULL,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_sub_categories
-- ----------------------------
INSERT INTO `tbl_sub_categories` VALUES ('1', '1', '1', 'Sample Category');
-- ----------------------------
-- Table structure for `tbl_suppliers`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_suppliers`;
CREATE TABLE `tbl_suppliers` (
`s_id` int(11) NOT NULL AUTO_INCREMENT,
`s_business_name` varchar(100) DEFAULT NULL,
`s_first_name` varchar(50) DEFAULT NULL,
`s_middle_name` varchar(50) DEFAULT NULL,
`s_last_name` varchar(50) DEFAULT NULL,
`s_ext_name` varchar(5) DEFAULT NULL,
`s_address` text,
`s_created_by` int(11) DEFAULT NULL,
`s_created_date` datetime DEFAULT NULL,
`s_modified_by` int(11) DEFAULT NULL,
`s_modified_date` datetime DEFAULT NULL,
`s_deleted_by` int(11) DEFAULT NULL,
`s_deleted_date` datetime DEFAULT NULL,
`s_status` tinyint(1) DEFAULT '0',
PRIMARY KEY (`s_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_suppliers
-- ----------------------------
INSERT INTO `tbl_suppliers` VALUES ('1', 'Mocks', 'Allan', 'S', 'Cabusora', '', 'SIR Matina, Sandawa Pogi St', null, null, null, null, null, null, '0');
-- ----------------------------
-- Table structure for `tbl_units`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_units`;
CREATE TABLE `tbl_units` (
`unit_id` int(11) NOT NULL AUTO_INCREMENT,
`unit_name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`unit_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_units
-- ----------------------------
INSERT INTO `tbl_units` VALUES ('1', 'set');
INSERT INTO `tbl_units` VALUES ('2', 'lot');
INSERT INTO `tbl_units` VALUES ('3', 'pcs');
INSERT INTO `tbl_units` VALUES ('4', 'units');
INSERT INTO `tbl_units` VALUES ('5', 'asdfasdfa');
INSERT INTO `tbl_units` VALUES ('6', 'asdf asdf asdfaa4444');
-- ----------------------------
-- Table structure for `tbl_users`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_users`;
CREATE TABLE `tbl_users` (
`u_id` int(11) NOT NULL AUTO_INCREMENT,
`u_username` varchar(100) DEFAULT NULL,
`u_password` varchar(255) DEFAULT NULL,
`u_email` varchar(255) DEFAULT NULL,
`u_firstname` varchar(50) DEFAULT NULL,
`u_middlename` varchar(50) DEFAULT NULL,
`u_lastname` varchar(50) DEFAULT NULL,
`u_extname` varchar(10) DEFAULT NULL,
`u_department_id` int(11) DEFAULT NULL,
`u_grp_id` int(11) DEFAULT NULL,
`u_created_on` datetime DEFAULT NULL,
`u_created_by` int(11) DEFAULT NULL,
`u_status` tinyint(1) DEFAULT '0',
PRIMARY KEY (`u_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of tbl_users
-- ----------------------------
INSERT INTO `tbl_users` VALUES ('1', 'admin', '21232f297a57a5a743894a0e4a801fc3', '<EMAIL>', 'Allan', 'S', 'Cabusora', null, '1', '1', '2016-06-29 16:21:47', null, '0');
-- ----------------------------
-- Table structure for `tbl_users_groups`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_users_groups`;
CREATE TABLE `tbl_users_groups` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL,
`group_id` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
KEY `fk_users_groups_users1_idx` (`user_id`),
KEY `fk_users_groups_groups1_idx` (`group_id`),
CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `tbl_groups` (`grp_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of tbl_users_groups
-- ----------------------------
INSERT INTO `tbl_users_groups` VALUES ('5', '1', '1');
INSERT INTO `tbl_users_groups` VALUES ('6', '1', '2');
INSERT INTO `tbl_users_groups` VALUES ('7', '2', '2');
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ip_address` varchar(45) NOT NULL,
`username` varchar(100) DEFAULT NULL,
`password` varchar(255) NOT NULL,
`salt` varchar(255) DEFAULT NULL,
`email` varchar(100) NOT NULL,
`activation_code` varchar(40) DEFAULT NULL,
`forgotten_password_code` varchar(40) DEFAULT NULL,
`forgotten_password_time` int(11) unsigned DEFAULT NULL,
`remember_code` varchar(40) 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,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1', '127.0.0.1', 'administrator', '$2a$07$SeBknntpZror9uyftVopmu61qg0ms8Qv1yV6FG.kQOSM.9QhmTo36', '', '<EMAIL>', '', null, null, null, '1268889823', '1468283974', '1', 'Admin', 'istrator', '1', '0');
INSERT INTO `users` VALUES ('2', '::1', 'ascex', '$2y$08$hvLIMzOZX9Wc4xwawfpgkugIfP3w/6ajgCHlTzMc8x4WUnz6QwjIK', null, '<EMAIL>', null, null, null, null, '1465946298', '1465946765', '1', 'Allan', 'Cabusora', '1', '9285487265');
|
--
-- The MIT License (MIT)
--
-- Copyright (c) 2020 <NAME>
--
-- 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.
--
-- ****************************************
-- This SQL script populates the initial data.
-- ****************************************
INSERT INTO example_entities (name) VALUES
('entity_01'),
('entity_02'),
('entity_03'),
('entity_04'),
('entity_05'),
('entity_06'),
('entity_07'),
('entity_08'),
('entity_09'),
('entity_10'),
('entity_11'),
('entity_12'),
('entity_13'),
('entity_14'),
('entity_15'),
('entity_16'),
('entity_17'),
('entity_18'),
('entity_19'),
('entity_20'),
('entity_21'),
('entity_22'),
('entity_23'),
('entity_24'),
('entity_25'),
('entity_26'),
('entity_27'),
('entity_28'),
('entity_29'),
('entity_30');
|
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 07-06-2018 a las 09:58:44
-- Versión del servidor: 10.1.32-MariaDB
-- Versión de PHP: 5.6.36
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `dbventaslaravel`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `articulo`
--
CREATE TABLE `articulo` (
`idarticulo` int(11) NOT NULL,
`idcategoria` int(11) NOT NULL,
`codigo` varchar(50) DEFAULT NULL,
`nombre` varchar(100) NOT NULL,
`stock` int(11) NOT NULL,
`descripcion` varchar(512) DEFAULT NULL,
`imagen` varchar(45) DEFAULT NULL,
`estado` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `articulo`
--
INSERT INTO `articulo` (`idarticulo`, `idcategoria`, `codigo`, `nombre`, `stock`, `descripcion`, `imagen`, `estado`) VALUES
(1, 1, '123456', 'Impresora Desktop', 25, 'Impresora', '2000351773293_2.jpg', 'Activo'),
(4, 2, '12789', 'Cable de red', 75, 'Cable', 'cable.jpg', 'Activo');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categoria`
--
CREATE TABLE `categoria` (
`idcategoria` int(11) NOT NULL,
`nombre` varchar(50) NOT NULL,
`descripcion` varchar(256) DEFAULT NULL,
`condicion` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `categoria`
--
INSERT INTO `categoria` (`idcategoria`, `nombre`, `descripcion`, `condicion`) VALUES
(1, 'Equipos Cómputo', 'Equipos Cómputo', 1),
(2, 'Cables electrónicos', 'Cables electrónicos', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalle_ingreso`
--
CREATE TABLE `detalle_ingreso` (
`iddatalle_ingreso` int(11) NOT NULL,
`idingreso` int(11) NOT NULL,
`idarticulo` int(11) NOT NULL,
`cantidad` int(11) NOT NULL,
`precio_compra` decimal(11,2) NOT NULL,
`precio_venta` decimal(11,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `detalle_ingreso`
--
INSERT INTO `detalle_ingreso` (`iddatalle_ingreso`, `idingreso`, `idarticulo`, `cantidad`, `precio_compra`, `precio_venta`) VALUES
(1, 1, 1, 10, '10.00', '10.00'),
(2, 1, 1, 222, '20.00', '2.00'),
(3, 2, 4, 20, '20.00', '2.00');
--
-- Disparadores `detalle_ingreso`
--
DELIMITER $$
CREATE TRIGGER `tr_updStockIngreso` AFTER INSERT ON `detalle_ingreso` FOR EACH ROW BEGIN
UPDATE articulo SET stock = stock + NEW.cantidad
WHERE articulo.idarticulo = NEW.idarticulo;
END
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalle_venta`
--
CREATE TABLE `detalle_venta` (
`iddetalle_venta` int(11) NOT NULL,
`idventa` int(11) NOT NULL,
`idarticulo` int(11) NOT NULL,
`cantidad` int(11) NOT NULL,
`precio_venta` decimal(11,2) NOT NULL,
`descuento` decimal(11,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `detalle_venta`
--
INSERT INTO `detalle_venta` (`iddetalle_venta`, `idventa`, `idarticulo`, `cantidad`, `precio_venta`, `descuento`) VALUES
(1, 2, 1, 20, '6.00', '1.00'),
(2, 3, 1, 10, '6.00', '0.00');
--
-- Disparadores `detalle_venta`
--
DELIMITER $$
CREATE TRIGGER `tr_updStockVenta` AFTER INSERT ON `detalle_venta` FOR EACH ROW BEGIN
UPDATE articulo SET stock = stock - NEW.cantidad
WHERE articulo.idarticulo = NEW.idarticulo;
END
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ingreso`
--
CREATE TABLE `ingreso` (
`idingreso` int(11) NOT NULL,
`idproveedor` int(11) NOT NULL,
`tipo_comprobante` varchar(20) NOT NULL,
`serie_comprobante` varchar(7) DEFAULT NULL,
`num_comprobante` varchar(10) NOT NULL,
`fecha_hora` datetime NOT NULL,
`impuesto` decimal(4,2) NOT NULL,
`estado` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `ingreso`
--
INSERT INTO `ingreso` (`idingreso`, `idproveedor`, `tipo_comprobante`, `serie_comprobante`, `num_comprobante`, `fecha_hora`, `impuesto`, `estado`) VALUES
(1, 4, 'Boleta', '001', '01', '2018-06-06 22:32:24', '18.00', 'A'),
(2, 4, 'Boleta', '003', '002', '2018-06-06 22:56:07', '18.00', 'A');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `migrations`
--
CREATE TABLE `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `migrations`
--
INSERT INTO `migrations` (`migration`, `batch`) VALUES
('2014_10_12_000000_create_users_table', 1),
('2014_10_12_100000_create_password_resets_table', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `persona`
--
CREATE TABLE `persona` (
`idpersona` int(11) NOT NULL,
`tipo_persona` varchar(20) NOT NULL,
`nombre` varchar(100) NOT NULL,
`tipo_documento` varchar(20) DEFAULT NULL,
`num_documento` varchar(15) DEFAULT NULL,
`direccion` varchar(70) DEFAULT NULL,
`telefono` varchar(15) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `persona`
--
INSERT INTO `persona` (`idpersona`, `tipo_persona`, `nombre`, `tipo_documento`, `num_documento`, `direccion`, `telefono`, `email`) VALUES
(1, 'Cliente', '<NAME>', 'DNI', '745632145', 'Direccion Falsa', '1123456', '<EMAIL>'),
(2, 'Inactivo', '<NAME>', 'DNI', '123456789', 'Direccion Falsa 2', '123456', '<EMAIL>'),
(3, 'Cliente', '<NAME>', 'PAS', '17360708', 'Camilo Sotomayor 1234', '12345678', '<EMAIL>'),
(4, 'Proveedor', '<NAME>', 'DNI', '1234567897', '<NAME>', '45678998', '<EMAIL>'),
(5, 'Inactivo', 'a', 'DNI', '123', 'a', 'a', 'a');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'gabriel', '<EMAIL>', <PASSWORD>', NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `venta`
--
CREATE TABLE `venta` (
`idventa` int(11) NOT NULL,
`idcliente` int(11) NOT NULL,
`tipo_comprobante` varchar(20) NOT NULL,
`serie_comprobante` varchar(7) NOT NULL,
`num_comprobante` varchar(10) NOT NULL,
`fecha_hora` datetime NOT NULL,
`impuesto` decimal(4,2) NOT NULL,
`total_venta` decimal(11,2) NOT NULL,
`estado` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `venta`
--
INSERT INTO `venta` (`idventa`, `idcliente`, `tipo_comprobante`, `serie_comprobante`, `num_comprobante`, `fecha_hora`, `impuesto`, `total_venta`, `estado`) VALUES
(1, 1, 'boleta', '001', '001', '2018-06-14 00:00:00', '18.00', '20000.00', 'A'),
(2, 3, 'Factura', '001', '001', '2018-06-07 03:08:00', '18.00', '119.00', 'A'),
(3, 1, 'Boleta', '002', '002', '2018-06-07 03:10:04', '18.00', '60.00', 'A');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `articulo`
--
ALTER TABLE `articulo`
ADD PRIMARY KEY (`idarticulo`),
ADD KEY `fk_articulo_categoria_idx` (`idcategoria`);
--
-- Indices de la tabla `categoria`
--
ALTER TABLE `categoria`
ADD PRIMARY KEY (`idcategoria`);
--
-- Indices de la tabla `detalle_ingreso`
--
ALTER TABLE `detalle_ingreso`
ADD PRIMARY KEY (`iddatalle_ingreso`),
ADD KEY `fk_detalle_ingreso_idx` (`idingreso`),
ADD KEY `fk_detalle_ingreso_articulo_idx` (`idarticulo`);
--
-- Indices de la tabla `detalle_venta`
--
ALTER TABLE `detalle_venta`
ADD PRIMARY KEY (`iddetalle_venta`),
ADD KEY `fk_detalle_venta_articulo_idx` (`idarticulo`),
ADD KEY `fk_detalle_venta_idx` (`idventa`);
--
-- Indices de la tabla `ingreso`
--
ALTER TABLE `ingreso`
ADD PRIMARY KEY (`idingreso`),
ADD KEY `fk_ingreso_persona_idx` (`idproveedor`);
--
-- Indices de la tabla `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`),
ADD KEY `password_resets_token_index` (`token`);
--
-- Indices de la tabla `persona`
--
ALTER TABLE `persona`
ADD PRIMARY KEY (`idpersona`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- Indices de la tabla `venta`
--
ALTER TABLE `venta`
ADD PRIMARY KEY (`idventa`),
ADD KEY `fk_venta_cliente_idx` (`idcliente`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `articulo`
--
ALTER TABLE `articulo`
MODIFY `idarticulo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de la tabla `categoria`
--
ALTER TABLE `categoria`
MODIFY `idcategoria` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `detalle_ingreso`
--
ALTER TABLE `detalle_ingreso`
MODIFY `iddatalle_ingreso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT de la tabla `detalle_venta`
--
ALTER TABLE `detalle_venta`
MODIFY `iddetalle_venta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `ingreso`
--
ALTER TABLE `ingreso`
MODIFY `idingreso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `persona`
--
ALTER TABLE `persona`
MODIFY `idpersona` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `venta`
--
ALTER TABLE `venta`
MODIFY `idventa` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `articulo`
--
ALTER TABLE `articulo`
ADD CONSTRAINT `fk_articulo_categoria` FOREIGN KEY (`idcategoria`) REFERENCES `categoria` (`idcategoria`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `detalle_ingreso`
--
ALTER TABLE `detalle_ingreso`
ADD CONSTRAINT `fk_detalle_ingreso` FOREIGN KEY (`idingreso`) REFERENCES `ingreso` (`idingreso`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_detalle_ingreso_articulo` FOREIGN KEY (`idarticulo`) REFERENCES `articulo` (`idarticulo`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `detalle_venta`
--
ALTER TABLE `detalle_venta`
ADD CONSTRAINT `fk_detalle_venta` FOREIGN KEY (`idventa`) REFERENCES `venta` (`idventa`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_detalle_venta_articulo` FOREIGN KEY (`idarticulo`) REFERENCES `articulo` (`idarticulo`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `ingreso`
--
ALTER TABLE `ingreso`
ADD CONSTRAINT `fk_ingreso_persona` FOREIGN KEY (`idproveedor`) REFERENCES `persona` (`idpersona`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `venta`
--
ALTER TABLE `venta`
ADD CONSTRAINT `fk_venta_cliente` FOREIGN KEY (`idcliente`) REFERENCES `persona` (`idpersona`) ON DELETE NO ACTION 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 */;
|
<filename>postresql-database-scripts/01_schema-tables.sql
-- Schema: webimagegallery
-- DROP SCHEMA webimagegallery;
CREATE SCHEMA webimagegallery;
CREATE SEQUENCE webimagegallery."gallery_users_idUser_seq";
CREATE SEQUENCE webimagegallery."gallery_photosets_idPhotoset_seq";
CREATE SEQUENCE webimagegallery."gallery_photosets_idOwner_seq";
CREATE SEQUENCE webimagegallery."gallery_photos_idPhoto_seq";
CREATE SEQUENCE webimagegallery."gallery_photos_idUser_seq";
CREATE SEQUENCE webimagegallery."gallery_photos-photosets_idPhoto_seq";
CREATE SEQUENCE webimagegallery."gallery_photos-photosets_idPhotoset_seq";
-- Table: webimagegallery.gallery_users
-- DROP TABLE webimagegallery.gallery_users;
CREATE TABLE webimagegallery.gallery_users
(
"idUser" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_users_idUser_seq"'::regclass),
login character varying NOT NULL,
password character varying(128) NOT NULL,
email character varying NOT NULL,
name character varying,
surname character varying,
"secondName" character varying,
role character varying NOT NULL DEFAULT "current_user"(),
"enabled" boolean NOT NULL DEFAULT 'true',
CONSTRAINT "idUserPK" PRIMARY KEY ("idUser" ),
CONSTRAINT "emailUnique" UNIQUE (email ),
CONSTRAINT "loginUnique" UNIQUE (login )
)
WITH (
OIDS=FALSE
);
-- Table: webimagegallery.gallery_photosets
-- DROP TABLE webimagegallery.gallery_photosets;
CREATE TABLE webimagegallery.gallery_photosets
(
"idPhotoset" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_photosets_idPhotoset_seq"'::regclass),
"idOwner" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_photosets_idOwner_seq"'::regclass),
description text,
CONSTRAINT "idPhotosetPK" PRIMARY KEY ("idPhotoset" ),
CONSTRAINT "idOwnerFK" FOREIGN KEY ("idOwner")
REFERENCES webimagegallery.gallery_users ("idUser") MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
-- Table: webimagegallery.gallery_photos
-- DROP TABLE webimagegallery.gallery_photos;
CREATE TABLE webimagegallery.gallery_photos
(
"idPhoto" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_photos_idPhoto_seq"'::regclass),
"idUser" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_photos_idUser_seq"'::regclass),
data bytea NOT NULL,
description character varying,
CONSTRAINT "idPhotoPK" PRIMARY KEY ("idPhoto" ),
CONSTRAINT "idOwnerFK" FOREIGN KEY ("idUser")
REFERENCES webimagegallery.gallery_users ("idUser") MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
-- Table: webimagegallery.gallery_thumbnails
-- DROP TABLE webimagegallery.gallery_thumbnails;
CREATE TABLE webimagegallery.gallery_thumbnails
(
"idPhoto" integer NOT NULL,
data bytea NOT NULL,
CONSTRAINT "idThumbnailPK" PRIMARY KEY ("idPhoto" )
)
WITH (
OIDS=FALSE
);
-- Table: webimagegallery."gallery_photos-photosets"
-- DROP TABLE webimagegallery."gallery_photos-photosets";
CREATE TABLE webimagegallery."gallery_photos-photosets"
(
"idPhoto" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_photos-photosets_idPhoto_seq"'::regclass),
"idPhotoset" integer NOT NULL DEFAULT nextval('webimagegallery."gallery_photos-photosets_idPhotoset_seq"'::regclass),
CONSTRAINT "idPhotosetFK" FOREIGN KEY ("idPhotoset")
REFERENCES webimagegallery.gallery_photosets ("idPhotoset") MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT "idPhotoFK" FOREIGN KEY ("idPhoto")
REFERENCES webimagegallery.gallery_photos ("idPhoto") MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
|
function init_email_validator
(p_dynamic_action in apex_plugin.t_dynamic_action
,p_plugin in apex_plugin.t_plugin)
return apex_plugin.t_dynamic_action_render_result is
l_result apex_plugin.t_dynamic_action_render_result;
begin
apex_plugin_util.debug_dynamic_action
(p_plugin => p_plugin
,p_dynamic_action => p_dynamic_action);
l_result.javascript_function := 'mailgun.init';
l_result.attribute_01 := p_plugin.attribute_01; /*API Key*/
if l_result.attribute_01 is null then
raise_application_error(-20001, 'Mailgun Public API Key must be supplied');
end if;
l_result.attribute_02 := p_plugin.file_prefix;
l_result.attribute_03 := nvl(p_plugin.attribute_02, '30000'); /*Timeout*/
l_result.attribute_04 := nvl(p_dynamic_action.attribute_01,'Y'); /*Show result Y/N*/
l_result.attribute_05 := nvl(p_plugin.attribute_03, 'Email address is invalid.');
l_result.attribute_06 := nvl(p_plugin.attribute_04, 'Email address cannot have over 512 characters.');
l_result.attribute_07 := nvl(p_plugin.attribute_05, 'Email address must include @.');
l_result.attribute_08 := nvl(p_plugin.attribute_06, 'Email address must contain only one @.');
return l_result;
end init_email_validator; |
/*Please add ; after each select statement*/
CREATE PROCEDURE mostExpensive()
BEGIN
SELECT name from Products ORDER BY price*quantity DESC, name LIMIT 1;
END |
-- after "FROM purchases" add code to rows with a date of "2018-11-01" or earlier in the "purchased_at" column
SELECT *
FROM purchases
WHERE purchased_at<="2018-11-01"; |
<gh_stars>1-10
INSERT INTO Autores (nombre) VALUES ('<NAME>');
INSERT INTO Autores (nombre) VALUES ('<NAME>');
INSERT INTO Autores (nombre) VALUES ('Dijkstra');
|
-- file:lseg.sql ln:18 expect:true
INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]')
|
<filename>sqlite-ddl.sql
CREATE TABLE date (
d_datekey INT, -- identifier, unique id -- e.g. 19980327 (what we use)
d_date TEXT, -- varchar(18), --fixed text, size 18, longest: december 22, 1998
d_dayofweek TEXT, -- varchar(8), --fixed text, size 8, sunday, monday, ..., saturday)
d_month TEXT, -- varchar(9), --fixed text, size 9: january, ..., december
d_year INT, -- unique value 1992-1998
d_yearmonthnum INT, -- numeric (yyyymm) -- e.g. 199803
d_yearmonth TEXT, -- varchar(7), --fixed text, size 7: mar1998 for example
d_daynuminweek INT, -- numeric 1-7
d_daynuminmonth INT, -- numeric 1-31
d_daynuminyear INT, -- numeric 1-366
d_monthnuminyear INT, -- numeric 1-12
d_weeknuminyear INT, -- numeric 1-53
d_sellingseason TEXT, -- varchar(12), --text, size 12 (christmas, summer,...)
d_lastdayinweekfl INT, -- 1 bit
d_lastdayinmonthfl INT, -- 1 bit
d_holidayfl INT, -- 1 bit
d_weekdayfl INT, -- 1 bit
PRIMARY KEY (d_datekey)
);
CREATE TABLE supplier (
s_suppkey INT, -- identifier
s_name TEXT, -- varchar(25), --fixed text, size 25: 'supplier'||suppkey
s_address TEXT, -- varchar(25), --variable text, size 25 (city below)
s_city TEXT, -- varchar(10), --fixed text, size 10 (10/nation: nation_prefix||(0-9))
s_nation TEXT, -- varchar(15), --fixed text(15) (25 values, longest united kingdom)
s_region TEXT, -- varchar(12), --fixed text, size 12 (5 values: longest middle east)
s_phone TEXT, -- varchar(15) --fixed text, size 15 (many values, format: 43-617-354-1222)
PRIMARY KEY (s_suppkey)
);
CREATE TABLE customer (
c_custkey INT,--numeric identifier
c_name TEXT, -- varchar(25), --variable text, size 25 'customer'||custkey
c_address TEXT, -- varchar(25), --variable text, size 25 (city below)
c_city TEXT, -- varchar(10), --fixed text, size 10 (10/nation: nation_prefix||(0-9)
c_nation TEXT, -- varchar(15), --fixed text(15) (25 values, longest united kingdom)
c_region TEXT, -- varchar(12), --fixed text, size 12 (5 values: longest middle east)
c_phone TEXT, -- varchar(15), --fixed text, size 15 (many values, format: 43-617-354-1222)
c_mktsegment TEXT, -- varchar(10) --fixed text, size 10 (longest is automobile)
PRIMARY KEY (c_custkey)
);
CREATE TABLE part (
p_partkey INT, -- identifier
p_name TEXT, -- varchar(22), --variable text, size 22 (not unique per part but never was)
p_mfgr TEXT, -- varchar(6), --fixed text, size 6 (mfgr#1-5, card = 5)
p_category TEXT, -- varchar(7), --fixed text, size 7 ('mfgr#'||1-5||1-5: card = 25)
p_brand1 TEXT, -- varchar(9), --fixed text, size 9 (category||1-40: card = 1000)
p_color TEXT, -- varchar(11), --variable text, size 11 (card = 94)
p_type TEXT, -- varchar(25), --variable text, size 25 (card = 150)
p_size INT, -- numeric 1-50 (card = 50)
p_container TEXT, -- varchar(15) --fixed text(10) (card = 40)
PRIMARY KEY (p_partkey)
);
CREATE TABLE lineorder (
lo_orderkey INT, -- numeric (int up to sf 300) first 8 of each 32 keys used
lo_linenumber INT, -- numeric 1-7
lo_custkey INT, -- numeric identifier foreign key reference to c_custkey
lo_partkey INT, -- identifier foreign key reference to p_partkey
lo_suppkey INT, -- numeric identifier foreign key reference to s_suppkey
lo_orderdate INT, -- identifier foreign key reference to d_datekey
lo_orderpriority TEXT, -- varchar(15), --fixed text, size 15 (5 priorities: 1-urgent, etc.)
lo_shippriority TEXT, -- varchar(1), --fixed text, size 1
lo_quantity INT, -- numeric 1-50 (for part)
lo_extendedprice INT, -- numeric, max about 55,450 (for part)
lo_ordtotalprice INT, -- numeric, max about 388,000 (for order)
lo_discount INT, -- numeric 0-10 (for part) -- (represents percent)
lo_revenue INT, -- numeric (for part: (extendedprice*(100-discount))/100)
lo_supplycost INT, -- numeric (for part, cost from supplier, max = ?)
lo_tax INT, -- numeric 0-8 (for part)
lo_commitdate INT, -- foreign key reference to d_datekey
lo_shipmode TEXT, -- varchar(10) --fixed text, size 10 (modes: reg air, air, etc.)
PRIMARY KEY (lo_orderkey, lo_linenumber), --Compound Primary Key: ORDERKEY, LINENUMBER
FOREIGN KEY (lo_orderdate) REFERENCES date (d_datekey), --identifier foreign key reference to D_DATEKEY
FOREIGN KEY (lo_commitdate) REFERENCES date (d_datekey), --Foreign Key reference to D_DATEKEY
FOREIGN KEY (lo_suppkey) REFERENCES supplier (s_suppkey), --numeric identifier foreign key reference to S_SUPPKEY
FOREIGN KEY (lo_custkey) REFERENCES customer (c_custkey) --numeric identifier foreign key reference
);
|
<reponame>BenFuhrman/eCommerce-html5up-arcana<filename>CustomerData_Table_2.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 15, 2018 at 03:21 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.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: `CustomerData_2`
--
-- --------------------------------------------------------
--
-- Table structure for table `CustomerData_Table_2`
--
CREATE TABLE `customerdata_table_2` (
`First Name` varchar(50) COLLATE ascii_bin NOT NULL,
`Last Name` varchar(50) COLLATE ascii_bin NOT NULL,
`Email` varchar(100) COLLATE ascii_bin NOT NULL,
`Password` varchar(50) COLLATE ascii_bin NOT NULL,
`Address` varchar(100) COLLATE ascii_bin NOT NULL,
`City` varchar(30) COLLATE ascii_bin NOT NULL,
`State` varchar(30) COLLATE ascii_bin NOT NULL,
`Zip` varchar(5) COLLATE ascii_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>hungtin3/SQL4OracleEBS<filename>killsession.sql
set echo off
SET VERIFY off
SET feedback off
set heading off
spool killsniped.log
select 'alter system disconnect session '||''''||sid||','||serial#||''''||' immediate;'
from v$session where schemaname='KTEVNIT';
spool off
set echo on
SET VERIFY on
SET feedback on
set heading on
@@killsniped.log
|
<reponame>BilyachenkoOY/hack121
CREATE TABLE [dbo].[PaymentCategory]
(
[Id] INT NOT NULL PRIMARY KEY,
[Title] nvarchar(300) NOT NULL,
[Keywords] nvarchar(max)
)
|
CREATE TABLE T1 (
id integer NOT NULL,
well character varying(100),
name character varying(100),
);
CREATE TABLE T2 (
id integer NOT NULL,
well character varying(100),
name character varying(100),
);
CREATE TABLE T3 (
id integer NOT NULL,
well character varying(100),
name character varying(100),
);
CREATE TABLE T_can (
can_id integer,
can_prov INTEGER,
id INTEGER NOT NULL,
prov INTEGER NOT NULL
);
INSERT INTO T1 VALUES (1, 'GreenPeace', 'w11');
INSERT INTO T1 VALUES (3, 'BigBucks', 'w13');
INSERT INTO T1 VALUES (6, 'HealthyWell', 'w16');
INSERT INTO T1 VALUES (7, 'NoMore', 'w17');
INSERT INTO T2 VALUES (3, null, 'w23');
INSERT INTO T2 VALUES (4, 'BucksBig', 'w24');
INSERT INTO T2 VALUES (7, 'FilthyRich', 'w27');
INSERT INTO T3 VALUES (5, 'OtherWell', 'w35');
INSERT INTO T3 VALUES (6, 'TiredOne', 'w36');
INSERT INTO T3 VALUES (10, 'ColdBridge', 'w310');
INSERT INTO T3 VALUES (7, 'Heather', 'w37');
INSERT INTO T_can VALUES (1,1,1,1) ;
INSERT INTO T_can VALUES (1,1,3,2) ;
INSERT INTO T_can VALUES (1,1,5,4) ;
INSERT INTO T_can VALUES (4,2,4,2) ;
INSERT INTO T_can VALUES (4,2,6,3) ;
INSERT INTO T_can VALUES (6,1,6,1) ;
INSERT INTO T_can VALUES (6,1,10,3) ;
INSERT INTO T_can VALUES (7,1,7,1) ;
INSERT INTO T_can VALUES (7,1,7,2) ;
INSERT INTO T_can VALUES (7,1,7,3) ;
ALTER TABLE T1
ADD CONSTRAINT T1_pkey PRIMARY KEY (id);
ALTER TABLE T2
ADD CONSTRAINT T2_pkey PRIMARY KEY (id);
ALTER TABLE T3
ADD CONSTRAINT T3_pkey PRIMARY KEY (id);
ALTER TABLE T_can
ADD CONSTRAINT T_can_pkey PRIMARY KEY (id, prov);
ALTER TABLE T_can
ADD CONSTRAINT T_can_pkey_2 UNIQUE (can_id, can_prov, prov);
|
<reponame>ClaySheffler/dbt
-- insert v2 of the 11 - 21 records
insert into {database}.{schema}.archive_expected (
"id",
"first_name",
"last_name",
"email",
"gender",
"ip_address",
"updated_at",
"valid_from",
"valid_to",
"dbt_updated_at",
"scd_id"
)
select
"id",
"first_name",
"last_name",
"email",
"gender",
"ip_address",
"updated_at",
-- fields added by archival
"updated_at" as "valid_from",
null::timestamp as "valid_to",
"updated_at" as "dbt_updated_at",
md5("id" || '-' || "first_name" || '|' || "updated_at"::text) as "scd_id"
from {database}.{schema}.seed
where "id" >= 10 and "id" <= 20;
-- insert 10 new records
insert into {database}.{schema}.seed ("id", "first_name", "last_name", "email", "gender", "ip_address", "updated_at") values
(21, 'Judy', 'Robinson', '<EMAIL>', 'Female', '192.168.127.12', '2016-09-18 08:27:38'),
(22, 'Kevin', 'Alvarez', '<EMAIL>', 'Male', '192.168.3.11', '2016-07-29 03:07:37'),
(23, 'Barbara', 'Carr', '<EMAIL>', 'Female', '172.16.58.3', '2015-09-24 13:27:23'),
(24, 'William', 'Watkins', '<EMAIL>', 'Male', '78.155.84.6', '2016-03-08 19:13:08'),
(25, 'Judy', 'Cooper', '<EMAIL>', 'Female', '172.16.31.10', '2016-10-05 20:49:33'),
(26, 'Shirley', 'Castillo', '<EMAIL>', 'Female', '192.168.3.11', '2016-06-20 21:12:21'),
(27, 'Justin', 'Harper', '<EMAIL>', 'Male', '192.168.127.12', '2016-05-21 22:56:46'),
(28, 'Marie', 'Medina', '<EMAIL>', 'Female', '192.168.3.11', '2015-10-08 13:44:33'),
(29, 'Kelly', 'Edwards', '<EMAIL>', 'Female', '172.16.58.3', '2015-09-15 06:33:37'),
(30, 'Carl', 'Coleman', '<EMAIL>', 'Male', '192.168.3.11', '2016-05-26 16:46:40');
-- add these new records to the archive table
insert into {database}.{schema}.archive_expected (
"id",
"first_name",
"last_name",
"email",
"gender",
"ip_address",
"updated_at",
"valid_from",
"valid_to",
"dbt_updated_at",
"scd_id"
)
select
"id",
"first_name",
"last_name",
"email",
"gender",
"ip_address",
"updated_at",
-- fields added by archival
"updated_at" as "valid_from",
null::timestamp as "valid_to",
"updated_at" as "dbt_updated_at",
md5("id" || '-' || "first_name" || '|' || "updated_at"::text) as "scd_id"
from {database}.{schema}.seed
where "id" > 20;
|
<reponame>adrianmahjour/db2-samples
--# Copyright IBM Corp. All Rights Reserved.
--# SPDX-License-Identifier: Apache-2.0
/*
* For every ENFORCED PRIMARY KEY, DROP the PK and recreate it NOT ENFORCED
*/
BEGIN
FOR C AS cur CURSOR WITH HOLD FOR
SELECT
VARCHAR(
'ALTER TABLE "' || TABSCHEMA || '"."' || TABNAME || '" DROP PRIMARY KEY' , 4000) AS DROP_PK
, VARCHAR(
'ALTER TABLE "' || TABSCHEMA || '"."' || TABNAME || '" ADD'
|| CASE WHEN CONSTNAME NOT LIKE 'SQL%' THEN ' CONSTRAINT "' || CONSTNAME || '"' ELSE '' END
|| ' PRIMARY KEY (' || LISTAGG(COLNAME,', ') WITHIN GROUP (ORDER BY COLSEQ) || ') NOT ENFORCED' , 4000) AS ADD_PK
FROM
SYSCAT.TABCONST C
JOIN
SYSCAT.KEYCOLUSE U
USING
( TABSCHEMA , TABNAME, CONSTNAME )
WHERE
C.TYPE = 'P'
AND C.ENFORCED = 'Y'
AND SUBSTR(C.TABSCHEMA,1,3) NOT IN ('SYS','IBM','DB2')
GROUP BY
TABSCHEMA
, TABNAME
, CONSTNAME
WITH UR
DO
EXECUTE IMMEDIATE C.DROP_PK;
EXECUTE IMMEDIATE C.ADD_PK;
COMMIT;
END FOR;
END |
-- @Description Ensures that an vacuum while a vacuum operation is ok
--
DROP TABLE IF EXISTS ao;
CREATE TABLE ao (a INT, b INT) WITH (appendonly=true);
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i;
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i;
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i;
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i;
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i;
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i;
DELETE FROM ao WHERE a < 1200;
1: SELECT COUNT(*) FROM ao;
1>: VACUUM ao;
2: VACUUM ao;
1<:
1: SELECT COUNT(*) FROM ao;
3: INSERT INTO ao VALUES (0);
|
<filename>migrations/364-perm-collections-edit.sql
UPDATE groups SET rules=CONCAT(rules, ',Collections:Edit') WHERE groups.name='Staff' AND id >= 50000;
|
<filename>api/src/main/resources/db/migration/mysql/common/V1_0_6__DDL_increase_varchar_length_on_tables.sql<gh_stars>0
-- increase the size of varchar on several tables:
ALTER TABLE categories MODIFY COLUMN category_description TEXT;
ALTER TABLE products MODIFY COLUMN product_description TEXT;
ALTER TABLE products MODIFY COLUMN note TEXT;
ALTER TABLE product_variants MODIFY COLUMN note TEXT;
ALTER TABLE reviews MODIFY COLUMN review_title VARCHAR(500);
ALTER TABLE reviews MODIFY COLUMN review_description TEXT;
ALTER TABLE reviews MODIFY COLUMN note TEXT;
ALTER TABLE companies MODIFY COLUMN company_description TEXT;
ALTER TABLE order_events MODIFY COLUMN note VARCHAR(1000);
|
<filename>databases/createdb.sql<gh_stars>0
create table MOVIE (
MID varchar2(5) not null constraint movie_pk primary key,
NAME varchar2(50),
YEAR number,
DIRECTOR varchar2(50),
LANGUAGE varchar2(20),
COST number,
COUNTRY varchar2(25)
);
/
create table MOVIE_ACTOR_LIST (
MID varchar2(5),
ACTOR varchar2(5),
FOREIGN KEY (MID) REFERENCES MOVIE(MID) ON DELETE CASCADE
);
/
create table MOVIE_GENRE_LIST (
MID varchar2(5),
GENRE varchar2(15),
FOREIGN KEY (MID) REFERENCES MOVIE(MID) ON DELETE CASCADE
);
/
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M1', 'Scarface', 1988, 'P1');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M2', 'Scent of a women', 1995, 'P2');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M3', 'My big fat greek wedding', 2000, 'P4');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M4', 'The Devil''s Advocate', 1997, 'P1');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M5', 'Mr. and Mrs Smith', 1965, 'P1');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M6', 'Now You see me', 2013, 'P2');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M7', 'Barely Lethal', 2014, 'P4');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M8', 'The Man with one red shoe', 1984, 'P1');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M9', 'Polar Express', 2010, 'P2');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M10', 'Her', 2013, 'P2');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M11', 'Lucy', 2015, 'P4');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M12', 'The Da Vinci Code', 2005, 'P4');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M13', 'The God Father part II', 1975, 'P1');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M15', 'Angels and Daemons', 2009, 'P2');
INSERT INTO MOVIE(MID, NAME, YEAR, DIRECTOR) VALUES('M16', 'The Island', 2010, 'P4');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M1', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M1', 'P6');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M2', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M2', 'P6');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M3', 'P9');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M3', 'P7');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M4', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M4', 'P6');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M4', 'P8');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M5', 'P7');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M5', 'P8');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M5', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M6', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M6', 'P6');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M6', 'P7');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M7', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M7', 'P10');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M8', 'P9');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M8', 'P10');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M9', 'P9');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M9', 'P17');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M9', 'P19');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M10', 'P3');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M10', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M10', 'P6');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M11', 'P3');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M11', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M11', 'P8');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M11', 'P9');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M12', 'P9');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M12', 'P10');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M12', 'P3');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M13', 'P5');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M13', 'P6');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M13', 'P16');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M15', 'P12');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M15', 'P18');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M15', 'P9');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M16', 'P10');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M16', 'P15');
INSERT INTO MOVIE_ACTOR_LIST VALUES('M16', 'P16');
INSERT INTO MOVIE_GENRE_LIST VALUES('M1', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M2', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M2', 'Comedy');
INSERT INTO MOVIE_GENRE_LIST VALUES('M3', 'Comedy');
INSERT INTO MOVIE_GENRE_LIST VALUES('M4', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M5', 'Comedy');
INSERT INTO MOVIE_GENRE_LIST VALUES('M5', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M6', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M7', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M8', 'Comedy');
INSERT INTO MOVIE_GENRE_LIST VALUES('M9', 'Comedy');
INSERT INTO MOVIE_GENRE_LIST VALUES('M10', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M11', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M12', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M12', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M13', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M13', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M15', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M15', 'Thriller');
INSERT INTO MOVIE_GENRE_LIST VALUES('M16', 'Action');
INSERT INTO MOVIE_GENRE_LIST VALUES('M16', 'Comedy');
create table PERSON (
PID varchar2(5) not null constraint person_pk primary key,
Name varchar2(50),
Birthdate date,
Gender varchar2(1),
birthplace varchar2(25),
Attribute varchar2(15),
state varchar2(25),
nation varchar2(25)
);
/
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P1', '<NAME>', TO_DATE('9/11/40', 'mm/dd/yyyy'), 'M', 'New York', 'Director');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P2', '<NAME>', TO_DATE('8/8/51', 'mm/dd/yyyy'), 'M', 'San Jose', 'Director');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P3', '<NAME>', TO_DATE('11/22/84','mm/dd/yyyy'), 'F', 'Austin', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P4', '<NAME>', TO_DATE('5/30/75','mm/dd/yyyy'), 'F', 'Paris', 'Director');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P5', '<NAME>', TO_DATE('6/5/53','mm/dd/yyyy'), 'M', 'Canberra', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P6', '<NAME>', TO_DATE('11/12/26','mm/dd/yyyy'), 'M', 'Portland', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P7', '<NAME>', TO_DATE('3/3/70','mm/dd/yyyy'), 'F', 'Seattle', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P8', '<NAME>', TO_DATE('4/4/75','mm/dd/yyyy'), 'M', 'London', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P9', '<NAME>', TO_DATE('5/19/64','mm/dd/yyyy'), 'M', 'Perth', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P10', '<NAME>', TO_DATE('8/7/83','mm/dd/yyyy'), 'F', 'Seoul', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P12', '<NAME>', TO_DATE('7/9/77','mm/dd/yyyy'), 'F', 'San Jose', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P13', '<NAME>', TO_DATE('11/13/58','mm/dd/yyyy'), 'M', 'Austin', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P15', '<NAME>', TO_DATE('9/11/57','mm/dd/yyyy'), 'M', 'Canberra', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P16', '<NAME>', TO_DATE('1/1/67','mm/dd/yyyy'), 'F', 'Portland', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P17', '<NAME>', TO_DATE('1/7/71','mm/dd/yyyy'), 'M', 'Seattle', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P18', '<NAME>', TO_DATE('2/2/62','mm/dd/yyyy'), 'F', 'London', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P19', '<NAME>', TO_DATE('3/3/65','mm/dd/yyyy'), 'M', 'Perth', 'Actor');
INSERT INTO PERSON(PID, Name, Birthdate, Gender, birthplace, Attribute) VALUES('P20', '<NAME>', TO_DATE('4/4/68','mm/dd/yyyy'), 'F', 'Seoul', 'Actor');
create table IMDB_USER (
ID varchar2(5) PRIMARY KEY,
EMAIL varchar2(80),
FNAME varchar2(30),
LNAME varchar2(30),
DOB DATE,
BIRTHPLACE varchar2(50),
GENDER varchar2(1)
);
create table REVIEWS (
MOVIE varchar2(5),
AUTHOR varchar2(5),
RATING number,
VOTES number,
PUBLISH_DATE TIMESTAMP,
FOREIGN KEY (MOVIE) REFERENCES MOVIE(MID) ON DELETE CASCADE,
FOREIGN KEY (AUTHOR) REFERENCES IMDB_USER(ID) ON DELETE CASCADE
);
INSERT INTO IMDB_USER VALUES('ID1', '<EMAIL>', 'John', 'Smith', TO_DATE('10/5/95','mm/dd/yyyy'), 'FL', 'M');
INSERT INTO IMDB_USER VALUES('ID2', '<EMAIL>', 'Juan', 'Carlos', TO_DATE('4/12/94','mm/dd/yyyy'), 'AK', 'M');
INSERT INTO IMDB_USER VALUES('ID3', '<EMAIL>', 'Jane', 'Chapel', TO_DATE('11/2/93','mm/dd/yyyy'), 'IL', 'F');
INSERT INTO IMDB_USER VALUES('ID4', '<EMAIL>', 'Aditya', 'Awasthi', TO_DATE('12/12/92','mm/dd/yyyy'), 'CA', 'M');
INSERT INTO IMDB_USER VALUES('ID5', '<EMAIL>', 'James', 'Williams', TO_DATE('5/5/91','mm/dd/yyyy'), 'NY', 'M');
INSERT INTO IMDB_USER VALUES('ID6', '<EMAIL>', 'Mike', 'Brown', TO_DATE('3/1/88','mm/dd/yyyy'), 'NC', 'M');
INSERT INTO IMDB_USER VALUES('ID7', '<EMAIL>', 'Bob', 'Jones', TO_DATE('2/7/88','mm/dd/yyyy'), 'NY', 'M');
INSERT INTO IMDB_USER VALUES('ID8', '<EMAIL>', 'Wei', 'Zhang', TO_DATE('8/12/85','mm/dd/yyyy'), 'NV', 'F');
INSERT INTO IMDB_USER VALUES('ID9', '<EMAIL>', 'Mark', 'Davis', TO_DATE('5/10/84','mm/dd/yyyy'), 'CA', 'M');
INSERT INTO IMDB_USER VALUES('ID10', '<EMAIL>', 'Daniel', 'Garcia', TO_DATE('6/1/80','mm/dd/yyyy'), 'NJ', 'M');
INSERT INTO IMDB_USER VALUES('ID11', '<EMAIL>', 'Maria', 'Rodriguez', TO_DATE('3/18/75','mm/dd/yyyy'), 'CA', 'F');
INSERT INTO IMDB_USER VALUES('ID12', '<EMAIL>', 'Freya', 'Wilson', TO_DATE('2/19/70','mm/dd/yyyy'), 'NJ', 'F');
INSERT INTO REVIEWS VALUES('M1', 'ID1', 7, 25, TO_DATE('10/02/07 09:10:54','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M2', 'ID2', 8, 35, TO_DATE('09/29/07 13:45:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M2', 'ID3', 9, 24, TO_DATE('09/29/07 10:38:25','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M3', 'ID4', 10, 8, TO_DATE('10/02/13 13:05:56','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M3', 'ID5', 9, 11, TO_DATE('10/25/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M4', 'ID6', 8, 6, TO_DATE('09/26/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M4', 'ID7', 7, 23, TO_DATE('09/26/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M5', 'ID9', 9, 22, TO_DATE('09/28/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M6', 'ID10', 8, 26, TO_DATE('10/29/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M7', 'ID11', 8, 27, TO_DATE('09/30/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M7', 'ID12', 8, 18, TO_DATE('10/25/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M8', 'ID1', 7, 19, TO_DATE('09/25/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M9', 'ID2', 7, 16, TO_DATE('09/25/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M10', 'ID3', 8, 18, TO_DATE('09/29/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M11', 'ID4', 9, 22, TO_DATE('06/07/15 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M11', 'ID5', 10, 13, TO_DATE('05/05/15 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M12', 'ID6', 9, 50, TO_DATE('05/05/15 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M13', 'ID7', 5, 34, TO_DATE('10/25/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M13', 'ID1', 4, 34, TO_DATE('10/25/07 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M15', 'ID10', 8, 25, TO_DATE('05/05/15 17:15:00','mm/dd/yyyy hh24:mi:ss'));
INSERT INTO REVIEWS VALUES('M16', 'ID4', 7, 12, TO_DATE('05/05/15 17:15:00','mm/dd/yyyy hh24:mi:ss'));
create table ROLES (
MOVIE varchar2(5),
PERSON varchar2(5),
ROLE varchar(25),
FOREIGN KEY (MOVIE) REFERENCES MOVIE(MID) ON DELETE CASCADE,
FOREIGN KEY (PERSON) REFERENCES PERSON(PID) ON DELETE CASCADE
);
INSERT INTO ROLES VALUES('M1', 'P5', 'Jessica');
INSERT INTO ROLES VALUES('M1', 'P6', 'Robert');
INSERT INTO ROLES VALUES('M2', 'P5', 'John');
INSERT INTO ROLES VALUES('M2', 'P6', 'Mark');
INSERT INTO ROLES VALUES('M3', 'P9', 'Alex');
INSERT INTO ROLES VALUES('M3', 'P7', 'Julie');
INSERT INTO ROLES VALUES('M4', 'P5', 'Jessica');
INSERT INTO ROLES VALUES('M4', 'P6', 'Matt');
INSERT INTO ROLES VALUES('M4', 'P8', 'Jennifer');
INSERT INTO ROLES VALUES('M5', 'P7', 'Jennifer');
INSERT INTO ROLES VALUES('M5', 'P8', 'Tom');
INSERT INTO ROLES VALUES('M5', 'P5', 'Milo');
INSERT INTO ROLES VALUES('M6', 'P6', 'Chris');
INSERT INTO ROLES VALUES('M6', 'P7', 'Rose');
INSERT INTO ROLES VALUES('M6', 'P5', 'Bill');
INSERT INTO ROLES VALUES('M7', 'P10', 'Jane');
INSERT INTO ROLES VALUES('M7', 'P5', 'Brad');
INSERT INTO ROLES VALUES('M8', 'P9', 'Lucas');
INSERT INTO ROLES VALUES('M8', 'P10', 'Juanita');
INSERT INTO ROLES VALUES('M9', 'P9', 'Clayne');
INSERT INTO ROLES VALUES('M9', 'P9', 'Jane');
INSERT INTO ROLES VALUES('M9', 'P9', 'Brad');
INSERT INTO ROLES VALUES('M9', 'P9', 'Lucas');
INSERT INTO ROLES VALUES('M9', 'P9', 'Bradley');
INSERT INTO ROLES VALUES('M9', 'P9', 'Justin');
INSERT INTO ROLES VALUES('M9', 'P17', 'Martin');
INSERT INTO ROLES VALUES('M9', 'P19', 'Mike');
INSERT INTO ROLES VALUES('M10', 'P3', 'Travis');
INSERT INTO ROLES VALUES('M10', 'P5', 'Alexander');
INSERT INTO ROLES VALUES('M10', 'P6', 'Justin');
INSERT INTO ROLES VALUES('M11', 'P3', 'Jessica');
INSERT INTO ROLES VALUES('M11', 'P5', 'Johny');
INSERT INTO ROLES VALUES('M11', 'P8', 'Rami');
INSERT INTO ROLES VALUES('M11', 'P9', 'Sam');
INSERT INTO ROLES VALUES('M12', 'P9', 'Gatek');
INSERT INTO ROLES VALUES('M12', 'P10', 'Rose');
INSERT INTO ROLES VALUES('M12', 'P3', 'maria');
INSERT INTO ROLES VALUES('M13', 'P5', 'Travis');
INSERT INTO ROLES VALUES('M13', 'P6', 'Alexander');
INSERT INTO ROLES VALUES('M13', 'P16', 'Pearl');
INSERT INTO ROLES VALUES('M15', 'P12', 'Sofia');
INSERT INTO ROLES VALUES('M15', 'P18', 'chrissy');
INSERT INTO ROLES VALUES('M15', 'P9', 'Mike');
INSERT INTO ROLES VALUES('M16', 'P10', 'Martin');
INSERT INTO ROLES VALUES('M16', 'P15', 'Bill');
INSERT INTO ROLES VALUES('M16', 'P16', 'Emilia');
create table SHOW (
NAME varchar2(25),
NETWORK varchar2(25),
CATEGORY varchar2(10),
PRIMARY KEY (NAME, NETWORK)
);
create table TV_SHOW_TEAM (
NAME varchar2(25),
NETWORK varchar2(25),
ACTOR varchar2(5),
PRODUCER varchar2(5),
DIRECTOR varchar2(5),
FOREIGN KEY (NAME, NETWORK) REFERENCES SHOW(NAME, NETWORK) ON DELETE CASCADE,
FOREIGN KEY (ACTOR) REFERENCES PERSON(PID) ON DELETE CASCADE,
FOREIGN KEY (DIRECTOR) REFERENCES PERSON(PID) ON DELETE CASCADE
);
create table FAVORITE_MOVIE_LIST (
MID varchar2(5),
ID varchar2(5),
FOREIGN KEY (ID) REFERENCES IMDB_USER(ID) ON DELETE CASCADE,
FOREIGN KEY (MID) REFERENCES MOVIE(MID) ON DELETE CASCADE
);
create table FAVORITE_SHOW_LIST (
NAME varchar2(5),
NETWORK varchar2(25),
ID varchar2(5),
FOREIGN KEY (NAME, NETWORK) REFERENCES SHOW(NAME, NETWORK) ON DELETE CASCADE,
FOREIGN KEY (ID) REFERENCES IMDB_USER(ID) ON DELETE CASCADE
);
create table REVIEWED_MOVIE_LIST (
MID varchar2(5),
ID varchar2(5),
FOREIGN KEY (ID) REFERENCES IMDB_USER(ID) ON DELETE CASCADE,
FOREIGN KEY (MID) REFERENCES MOVIE(MID) ON DELETE CASCADE
);
create table TOWATCH_MOVIE_LIST (
MID varchar2(5),
ID varchar2(5),
FOREIGN KEY (ID) REFERENCES IMDB_USER(ID) ON DELETE CASCADE,
FOREIGN KEY (MID) REFERENCES MOVIE(MID) ON DELETE CASCADE
);
create table REVIEWED_SHOW_LIST (
NAME varchar2(5),
NETWORK varchar2(25),
ID varchar2(5),
FOREIGN KEY (NAME, NETWORK) REFERENCES SHOW(NAME, NETWORK) ON DELETE CASCADE,
FOREIGN KEY (ID) REFERENCES IMDB_USER(ID) ON DELETE CASCADE
);
create table TOWATCH_SHOW_LIST (
NAME varchar2(5),
NETWORK varchar2(25),
ID varchar2(5),
FOREIGN KEY (NAME, NETWORK) REFERENCES SHOW(NAME, NETWORK) ON DELETE CASCADE,
FOREIGN KEY (ID) REFERENCES IMDB_USER(ID) ON DELETE CASCADE
);
create table SEASONS (
NAME varchar2(5),
NETWORK varchar2(25),
SEASON_NUMBER NUMBER,
SDATE DATE,
EDATE DATE,
FOREIGN KEY (NAME, NETWORK) REFERENCES SHOW(NAME, NETWORK) ON DELETE CASCADE
);
create table EPISODES (
NAME varchar2(5),
NETWORK varchar2(25),
EP_NUMBER NUMBER,
TTILE varchar2(25),
SEASON_NUMBER NUMBER,
LENGTH varchar2(25),
FOREIGN KEY (NAME, NETWORK) REFERENCES SHOW(NAME, NETWORK) ON DELETE CASCADE
);
create table SCENES (
MID varchar2(5),
Location varchar2(25),
Scene_No number,
FOREIGN KEY (MID) REFERENCES MOVIE(MID) ON DELETE CASCADE
);
create table AWARDS (
INSTITUTION varchar2(50),
YEAR NUMBER(5),
CATEGORY varchar2(50),
PRIMARY KEY (INSTITUTION, YEAR, CATEGORY)
);
|
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 11, 2018 at 02:17 PM
-- 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: `quik_drivers`
--
-- --------------------------------------------------------
--
-- Table structure for table `driver_emergency`
--
CREATE TABLE `driver_emergency` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_emergency_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_emergency_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_emergency_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_emergency_landline` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `driver_emergency`
--
INSERT INTO `driver_emergency` (`reg_user_id`, `reg_driver_emergency_name`, `reg_driver_emergency_email`, `reg_driver_emergency_mobile`, `reg_driver_emergency_landline`, `reg_user_status`) VALUES
(1, 'ramanareddy', '<EMAIL>', '7893868050', '120-57848596', 1),
(2, 'Ayyappa', '<EMAIL>', '9701245410', '120-54784215', 1),
(3, 'subba', '<EMAIL>', '8745123012', '120-5479965', 1);
-- --------------------------------------------------------
--
-- Table structure for table `driver_reference`
--
CREATE TABLE `driver_reference` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_nominee1_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee1_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee1_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee1_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee2_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee2_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee2_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee2_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee3_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee3_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee3_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_nominee3_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `driver_reference`
--
INSERT INTO `driver_reference` (`reg_user_id`, `reg_driver_nominee1_name`, `reg_driver_nominee1_email`, `reg_driver_nominee1_mobile`, `reg_driver_nominee1_address`, `reg_driver_nominee2_name`, `reg_driver_nominee2_email`, `reg_driver_nominee2_mobile`, `reg_driver_nominee2_address`, `reg_driver_nominee3_name`, `reg_driver_nominee3_email`, `reg_driver_nominee3_mobile`, `reg_driver_nominee3_address`, `reg_user_status`) VALUES
(1, 'ayyappa', '<EMAIL>', '9701234789', 'Borabanda', 'krishna', '<EMAIL>', '9494599099', 'Ongole', 'sai', '<EMAIL>', '8745123568', 'Addanki', 1),
(2, 'ramakrishna', '<EMAIL>', '9493496595', 'Chimakurthy', 'venkat', '<EMAIL>', '9494599099', 'Vijayawada', 'sai', '<EMAIL>', '8745412568', 'Addanki', 1),
(3, 'ayyappa', '<EMAIL>', '9702457812', 'guntur', 'rajesh', '<EMAIL>', '8456243521', 'kanigiri', 'siva', '<EMAIL>', '9457841256', 'sn padu', 1);
-- --------------------------------------------------------
--
-- 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
(84, '2014_10_12_000000_create_users_table', 1),
(85, '2014_10_12_100000_create_password_resets_table', 1),
(86, '2018_08_08_105142_create_signups_table', 1),
(87, '2018_08_16_123547_create_qdm_drivers_info_table', 1),
(88, '2018_08_18_114015_create_qdm_customer_info_table', 1),
(89, '2018_08_29_111619_create_qdm_driver_idverify_table', 1),
(90, '2018_08_29_115638_create_qdm_driver_bank_details_table', 1),
(91, '2018_09_04_125359_create_qdm_vehicle_info_table', 1),
(92, '2018_09_05_113245_create_driver_reference_table', 1),
(93, '2018_09_05_113308_create_driver_emergency_table', 1),
(94, '2018_09_05_133738_create_qdm_driver_verify_table', 1),
(95, '2018_09_11_163356_create_qdm_driver_pool_table', 2);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `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 `qdm_customer_info`
--
CREATE TABLE `qdm_customer_info` (
`reg_user_id` int(11) NOT NULL,
`reg_customer_first_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_last_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_gender` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_street` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_city` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_state` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_pincode` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_emergency_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_emergency_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_emergency_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_customer_emergency_landline` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_customer_info`
--
INSERT INTO `qdm_customer_info` (`reg_user_id`, `reg_customer_first_name`, `reg_customer_last_name`, `reg_customer_gender`, `reg_customer_address`, `reg_customer_street`, `reg_customer_location`, `reg_customer_city`, `reg_customer_state`, `reg_customer_pincode`, `reg_customer_emergency_name`, `reg_customer_emergency_email`, `reg_customer_emergency_mobile`, `reg_customer_emergency_landline`, `reg_user_status`) VALUES
(4, 'Ravindra', 'Chinnapureddy', 'Male', '6-64 Velugu vari palem', 'main road', 'boddikura padu', 'ongole', '1', '523253', 'subbareddy', 'chinnapureddy', '9652513602', '120-547895', 1),
(5, 'Kumar', 'Gujjula', 'Male', '1-52 nagar', 'school side line', 'guntur', 'guntur', '244', '523014', 'nagireddy', '<EMAIL>', '874512458', '202-54789544', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_drivers_info`
--
CREATE TABLE `qdm_drivers_info` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_firstname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_lastname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_gender` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_street` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_city` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_state` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_pincode` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_drivers_info`
--
INSERT INTO `qdm_drivers_info` (`reg_user_id`, `reg_driver_firstname`, `reg_driver_lastname`, `reg_driver_gender`, `reg_driver_address`, `reg_driver_street`, `reg_driver_location`, `reg_driver_city`, `reg_driver_state`, `reg_driver_pincode`, `reg_driver_status`) VALUES
(1, 'Ramakrishna', 'Chinnapureddy', 'Male', 'sr nagar', 'Andhra Bank Sr nagar', 'hyderabad', 'hyderabad', 'Hyderabad', '500038', 1),
(2, 'Ramanareddy', 'Bogasamudram', 'Male', '6-64 Ongole', 'sathyam theater line', 'Ongole', 'Ongole', 'Secundarabad', '523002', 1),
(3, 'Krishna', 'Kadava', 'Male', '2-54 ramalayam temple', 'ramalayam line', 'chimakurthy', 'ongole', 'Secundarabad', '523012', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_driver_bank_details`
--
CREATE TABLE `qdm_driver_bank_details` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_bank_account_holder` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_bank_account_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_bank_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_bank_branch` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_bank_location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_bank_ifsc_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_driver_bank_details`
--
INSERT INTO `qdm_driver_bank_details` (`reg_user_id`, `reg_driver_bank_account_holder`, `reg_driver_bank_account_no`, `reg_driver_bank_name`, `reg_driver_bank_branch`, `reg_driver_bank_location`, `reg_driver_bank_ifsc_code`, `reg_driver_status`) VALUES
(1, 'ramakrishna', '50100182686189', 'HDFC', 'Addanki', 'Addanki', 'HDFC003297', 1),
(2, 'ramanareddy', '50124578954124', 'SBI', 'Gangavaram', 'Gangavaram', 'SBIN0011116', 1),
(3, 'krishna', '010100245480155', 'Andhra Bank', 'Ongole', 'Ongole', 'ABN001525', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_driver_idverify`
--
CREATE TABLE `qdm_driver_idverify` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_experience` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_aadhar_card` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_pancard` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_license` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_driver_idverify`
--
INSERT INTO `qdm_driver_idverify` (`reg_user_id`, `reg_driver_experience`, `reg_driver_aadhar_card`, `reg_driver_pancard`, `reg_driver_license`, `reg_driver_status`) VALUES
(1, '2', '874596547412', 'ASXD457458', '2457896587', 1),
(2, '5', '145789658547', 'RBCSD451247', '4578214578', 1),
(3, '7', '457856457854', 'SCD45123548', '4512478965', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_driver_pool`
--
CREATE TABLE `qdm_driver_pool` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_carlist` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_payment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_updated_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_driver_pool`
--
INSERT INTO `qdm_driver_pool` (`reg_user_id`, `reg_driver_name`, `reg_driver_time`, `reg_driver_carlist`, `reg_driver_payment`, `reg_driver_updated_date`, `reg_driver_status`) VALUES
(1, 'Ongole', 'on', 'on', 'on', '11-09-2018 16:51:59', 1),
(1, 'HYderabad', 'on', 'on', 'on', '11-09-2018 16:52:53', 1),
(1, 'Hyd', '12HR', 'Chevrolet', 'Credit Card', '11-09-2018 17:04:41', 1),
(1, 'Fgdfg', '12HR', 'Chevrolet', 'Debit Card', '11-09-2018 17:42:34', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_driver_verify`
--
CREATE TABLE `qdm_driver_verify` (
`reg_user_id` int(11) NOT NULL,
`reg_driver_verification_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_verification_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_verification_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_driver_verification_landline` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_driver_verify`
--
INSERT INTO `qdm_driver_verify` (`reg_user_id`, `reg_driver_verification_name`, `reg_driver_verification_email`, `reg_driver_verification_mobile`, `reg_driver_verification_landline`, `reg_user_status`) VALUES
(1, 'Ramakrishna', '<EMAIL>', '9493496595', '102-5478965', 1),
(2, 'Ramanareddy', '<EMAIL>', '7893868050', '120-547854685', 1),
(3, 'Krishna', '<EMAIL>', '9494599099', '142-2154569', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_users`
--
CREATE TABLE `qdm_users` (
`reg_user_id` int(10) UNSIGNED NOT NULL,
`reg_user_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_pwd` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_mobile_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_account_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_otp` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_ip_address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_created_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_updated_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_users`
--
INSERT INTO `qdm_users` (`reg_user_id`, `reg_user_name`, `reg_user_pwd`, `reg_user_email`, `reg_mobile_number`, `reg_user_account_type`, `reg_user_otp`, `reg_user_ip_address`, `reg_user_created_date`, `reg_user_updated_date`, `reg_user_status`) VALUES
(1, 'Ramakrishna', '$2y$10$94F3MBlt9Y/3ffWNEMshzOVilk2Mscpi0x24xK6X/47Zw389joRg6', '<EMAIL>', '9493496595', 'driver', '8743', '127.0.0.1', '11-09-2018 15:22:37', '11-09-2018 15:22:37', 1),
(2, 'Ramanareddy', '$2y$10$gtp0w1pSc0waQv4vPmJRneFZeVdgtq7PHfA2v88UzDhaacE641yg.', '<EMAIL>', '7893868050', 'driver', '2804', '127.0.0.1', '11-09-2018 15:34:53', '11-09-2018 15:34:53', 1),
(3, 'Krishna', '$2y$10$nqpe8WHsTwECqGKIyA4JGO85LoXtp0cBS0jLs8MktHgOpM2af0rxS', '<EMAIL>', '9494599099', 'driver', '2722', '127.0.0.1', '11-09-2018 15:44:31', '11-09-2018 15:44:31', 1),
(4, 'Ravindra', '$2y$10$dY9rOTOmUAsA7d7kt52oc.AG3MGi1rx1fttUJcF6ujz5JmVKoLQ9C', '<EMAIL>', '8499904799', 'user', '2069', '127.0.0.1', '11-09-2018 15:57:12', '11-09-2018 15:57:12', 1),
(5, 'Kumar', '$2y$10$iToOix0Cop6vgtwu/IiuwOi3RazpJCOIq7kbraMhGBWX3QuIdC8qC', '<EMAIL>', '7799399676', 'user', '2810', '127.0.0.1', '11-09-2018 16:03:54', '11-09-2018 16:03:54', 1);
-- --------------------------------------------------------
--
-- Table structure for table `qdm_vehicle_info`
--
CREATE TABLE `qdm_vehicle_info` (
`reg_user_id` int(11) NOT NULL,
`reg_vehicle_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_make` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_model` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_year` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_rent_details` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_agency_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_agency_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_owner_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_owner_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_owner_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_owner_landline` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_contact_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_contact_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_contact_mobile` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_vehicle_contact_landline` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`reg_user_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `qdm_vehicle_info`
--
INSERT INTO `qdm_vehicle_info` (`reg_user_id`, `reg_vehicle_type`, `reg_vehicle_make`, `reg_vehicle_model`, `reg_vehicle_year`, `reg_vehicle_rent_details`, `reg_vehicle_agency_name`, `reg_vehicle_agency_address`, `reg_vehicle_owner_name`, `reg_vehicle_owner_email`, `reg_vehicle_owner_mobile`, `reg_vehicle_owner_landline`, `reg_vehicle_contact_name`, `reg_vehicle_contact_email`, `reg_vehicle_contact_mobile`, `reg_vehicle_contact_landline`, `reg_user_status`) VALUES
(4, 'Audi', 'Some', '200', '2015', 'good condition', 'kumar', '5-52lalagooda', 'ravi', '<EMAIL>', '8499904799', '102-245799688', 'ravi', '<EMAIL>', '8499904799', '120-542248558', 1),
(5, 'bmw', 'source', 'y245', '2017', 'good condtion', 'prathap', 'lalbangla', 'kumar', '<EMAIL>', '8745896458', '104-542478596', 'kumar', '<EMAIL>', '7548596585', '420-5745855', 1);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `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,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `qdm_users`
--
ALTER TABLE `qdm_users`
ADD PRIMARY KEY (`reg_user_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 `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=96;
--
-- AUTO_INCREMENT for table `qdm_users`
--
ALTER TABLE `qdm_users`
MODIFY `reg_user_id` int(10) 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;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>jamesfulford/tutoring-database-scripts
@@0createAccountants.sql
@@0createAdministrators.sql
@@0createMarketers.sql
@@0createResearchers.sql
@@0createTutors.sql |
USE TelerikAcademy
SELECT e.FirstName + ' ' + e.LastName AS EmployeeName,
em.FirstName + ' ' + em.LastName AS ManagerName,
a.AddressText AS EmployeeAdress
FROM Employees e
INNER JOIN Employees em
ON e.ManagerID = em.EmployeeID
INNER JOIN Addresses a
ON e.AddressID = a.AddressID |
insert into `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) values ('LP', 'Limpieza Publica', 'Barrido de calles y avenidas, tambien a la recoleccion y transporte y disposcion final.', '1255', 'Servicios', current_date(), current_date());
insert into `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) values ('MAP', 'Mantenimiento de Areas publicas', 'Mantener en condiciones optimas de limpieza de las calles, plazas, etc.', '2566', 'Servicios', current_date(), current_date());
insert into `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) values ('SC', 'Servicios y Control', 'Se binda el servici de emitir partidas de nacimiento, acta de defunciones,etc, tambien las licencias de conducir, autorizacion de ruta y la administracion del los mercado.', '5144', 'Servicios', current_date(), current_date());
insert into `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) values ('SeG', 'Seguridad Ciudadana', 'Se realizan patrullajes motorizados, esto se desarrolla con la coordinacion junto a la PNP garantizando la seguridad ciudadana', '4666', 'Sevicios', current_date(), current_date());
insert into `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) values ('AP', 'Alumbrado Publico', 'Promoveer la iluminacion necesaria en los espacios publicos, con el fin de garantizar la seguridad de peatones y vehiculos.', '2313', 'Servicio', current_date(), current_date());
insert into `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) values ('AC', 'Administracion del Cementerio', 'Contruimos, habilitamos, conservamos y administramos los cementerios.', '7899', 'Servicio', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`servicio` (`abreviatura`, `nombre`, `descripcion`, `tarifa`, `rubro`, `created_at`, `updated_at`) VALUES ('OP', 'Obras publicas', 'Programa el mantenimiento de los espacios públicos y el mobiliario urbano. Programa y supervisa los diversos proyectos y obras públicas municipales.', '5999', 'Servicios', current_date(), current_date());
insert into `bd_impuestos_municipales`.`oficina` (`cod`, `nombre`, `created_at`, `updated_at`) values ('001', 'Oficina de secretaria general', current_date(), current_date());
insert into `bd_impuestos_municipales`.`oficina` (`cod`, `nombre`, `created_at`, `updated_at`) values ('101', 'Oficina de administracion y finanazas', current_date(), current_date());
insert into `bd_impuestos_municipales`.`oficina` (`cod`, `nombre`, `created_at`, `updated_at`) values ('102', 'Oficina de asesoria juridica', current_date(), current_date());
insert into `bd_impuestos_municipales`.`oficina` (`cod`, `nombre`, `created_at`, `updated_at`) values ('103', 'Oficina de planeamiento y presupuesto', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('32541878', '<NAME> ', '<NAME> ', 'Jefe de logistica', '2', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('96589632', 'Francisco', '<NAME> ', 'Jefe de comunicaciones', '4', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('36584756', '<NAME>', '<NAME> ', 'Administrador Comercial', '4', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('68547269', '<NAME> ', '<NAME> ', 'Marketing', '4', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('78946231', 'Ciro ', 'Carrera Santiago ', 'Recursos Humanos', '2', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('65498784', 'Alejandro ', 'Casas Bastida ', 'Administrador de Operaciones', '3', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('32167954', '<NAME> ', '<NAME> ', 'Administrador Comercial', '2', current_date(), current_date());
insert into `bd_impuestos_municipales`.`empleado` (`dni`, `nombre`, `apellido`, `cargo`, `id_oficina`, `created_at`, `updated_at`) values ('32148974', '<NAME> ', '<NAME> ', 'Marketing', '3', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('1', '78454578', '<NAME>', 'Ledesma', 'García', '1978-02-14', 'm', 'Medico', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('2', '54789154', '<NAME>', 'García', 'García', '1988-05-31', 'm', 'Actor', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('3', '63528974', '<NAME>', 'Verdías', 'Gallegos', '1954-12-12', 'f', 'Ganadero', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('4', '98412147', '<NAME>', 'Sánchez', 'Galindo', '2001-01-01', 'm', 'Maestro', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('5', '65412330', 'Erik', 'Altamirano', 'Fuentes', '1947-05-30', 'm', 'Arquitecto', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('6', '32178998', '<NAME>', 'Hernández', 'Forment', '1968-11-18', 'f', 'Bombero', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('7', '98154121', '<NAME>', 'Sánchez', 'Flores', '1988-03-20', 'm', 'Dentista', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('8', '74489879', 'Ernesto', 'Mota', 'Franco', '1999-03-26', 'm', 'Cheff', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('9', '65474157', '<NAME>', 'Estrada', 'Esquivel', '1938-02-16', 'm', 'Diseñador', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('10', '92654124', '<NAME>', 'Bernal', 'Erazo', '1968-08-25', 'm', 'Medico', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('11', '87941145', '<NAME>', 'Guajardo', 'Delgado', '1968-06-26', 'm', 'Actor', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_natural` (`ID_PERSONA_NATURAL`, `DNI`, `NOMBRE`, `APELLIDO_PA`, `APELLIDO_MA`, `FECHA_NACIMIENTO`, `SEXO`, `PROFESION`, `created_at`, `updated_at`) VALUES ('12', '98712313', '<NAME>', 'Razo', 'Loto', '1985-05-27', 'm', 'Maestro', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('1', '2053885667', '<NAME>', 'ARTROSCOPICTRAUMA S.A.C.', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('2', '2054950055', '<NAME>, Soledad', 'ASERCO EB EMPRESA ', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('3', '2055159793', '<NAME>', 'ASOCIACION COMUNIDAD CRISTIANA EVANGELICA', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('4', '2055385645', '<NAME>', 'BI GRAND CONFECCIONES S.A.C.', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('5', '2052542677', '<NAME>, <NAME>', 'CONCEPTOS & CONSTRUCCIONES V.G EIRL', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('6', '2060115518', '<NAME>', 'CORPORACION CARMINA SAC', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('7', '2055562954', '<NAME>', 'CORPORACION INDUSTRIAL ALPA`C S.A.C.', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('8', '2051863992', '<NAME>', 'H & J E HIJOS E.I.R.L', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('9', '2054897111', '<NAME>', 'METEORO RACING SOCIEDAD ANONIMA CERRADA', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('10', '2054324898', '<NAME>', 'MODAS LOREN EIRL', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('11', '2055347646', '<NAME>', 'REPRESENTACIONES DIERA S.A.C.', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`persona_juridico` (`ID_PERSONA_JURIDICO`, `RUC`, `PROPIETARIO`, `RAZON_SOCIAL`, `DESCRIPCION`, `FECHA`, `created_at`, `updated_at`) VALUES ('12', '2055374112', '<NAME>', 'SERVICIOS TECNICOS EL CHALANCITO', 'sin descripcción', '2015-05-27', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('966875412', 'Av. Los Jorges 567', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('963214784', 'Calle flor de mayo 092', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('932154789', 'Av. Brasil 144', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('915487896', 'Av. Morales Duarez 888', 'ninguna', '0', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('999654789', 'Calle Heroes de Cenepa 01', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('996547811', 'Urb. Los Capos de Puno 044', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('936478512', 'Av. 28 de Julio 444', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('936124789', 'Asociacion Mollepata 101', 'ninguna', '1', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('911447892', 'Av. Garzón 234', 'cerca del Areopuerto', '0', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contribuyente` (`NUMERO_TELEFONICO`, `DIRECCION`, `REFERENCIA`, `ESTADO`, `created_at`, `updated_at`) VALUES ('978999451', 'Avenida Túpac Amaru 741', 'ninguna', '0', current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contrato` (`ID_CONTRATO`, `COD`, `NOMBRE`, `FECHA`, `DESCRIPCION`, `IMPUESTO`, `ID_SERVICIO`, `ID_ESTADO_CONTRATO`, `ID_CONTRIBUYENTE`, `created_at`, `updated_at`) VALUES ('1', 'A100', 'Gaseoducto Huamanguilla-Lima', "2021-02-14", 'Un gran proyecto de gaseoducto que llevara desde Huamanguilla a Lima.', '190799', '7', '1', 1, current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contrato` (`ID_CONTRATO`, `COD`, `NOMBRE`, `FECHA`, `DESCRIPCION`, `IMPUESTO`, `ID_SERVICIO`, `ID_ESTADO_CONTRATO`, `ID_CONTRIBUYENTE`,`created_at`, `updated_at`) VALUES ('2', 'B002', 'Alcantarillado en la Av. Los Linces', "2021-03-24", 'Se tiene que crear el alcantarillado faltate en esa avenida.', '56999', '2', '2', 2, current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contrato` (`ID_CONTRATO`, `COD`, `NOMBRE`, `FECHA`, `DESCRIPCION`, `IMPUESTO`, `ID_SERVICIO`, `ID_ESTADO_CONTRATO`, `ID_CONTRIBUYENTE`, `created_at`, `updated_at`) VALUES ('3', 'C001', 'Plataforma virtual', "2021-01-10", 'Se mando a realizar una plataforma para nuestra munincipalidad.', '219', '3', '2', 3, current_date(), current_date());
INSERT INTO `bd_impuestos_municipales`.`contrato` (`ID_CONTRATO`, `COD`, `NOMBRE`, `FECHA`, `DESCRIPCION`, `IMPUESTO`, `ID_SERVICIO`, `ID_ESTADO_CONTRATO`, `ID_CONTRIBUYENTE`, `created_at`, `updated_at`) VALUES ('4', '5011', 'Construccion de señales de transito faltantes', "2021-05-11", 'Las señales de transito se debe construir antes de que suceda un acccidente.', '3999', '2', '3', 4, current_date(), current_date());
use bd_impuestos_municipales;
insert into contribuyente_dni
values
(1, 1, 1, current_date(), current_date()),
(2, 2, 2, current_date(), current_date()),
(3, 3, 3, current_date(), current_date()),
(4, 4, 4, current_date(), current_date()),
(5, 5, 5, current_date(), current_date());
insert into contribuyente_ruc
values
(1, 1, 6, current_date(), current_date()),
(2, 2, 7, current_date(), current_date()),
(3, 3, 8, current_date(), current_date()),
(4, 4, 9, current_date(), current_date()),
(5, 5, 10, current_date(), current_date());
|
SELECT
ClassID,
ClassName,
ClassDisplayName,
ClassTableName,
ClassXmlSchema
FROM
CMS_Class
WHERE
ClassXmlSchema != '' |
<filename>doc/db.sql
DROP TABLE IF EXISTS `cron_job`;
CREATE TABLE `cron_job` (
`id` bigint(32) NOT NULL AUTO_INCREMENT,
`job_cn_name` varchar(128) DEFAULT NULL COMMENT 'job的中文名称',
`job_name` varchar(128) DEFAULT NULL COMMENT 'job的英文名称',
`job_class` varchar(256) DEFAULT NULL COMMENT 'job执行的类',
`cron` varchar(64) DEFAULT NULL COMMENT 'cron 执行表达式',
`parameter` varchar(256) DEFAULT NULL COMMENT '参数',
`comment` varchar(256) DEFAULT NULL COMMENT '备注',
`success_mail` varchar(128) DEFAULT NULL COMMENT 'job执行成功发送的邮件',
`fail_mail` varchar(128) DEFAULT NULL COMMENT 'job执行失败发送的邮件',
`job_status` tinyint(2) DEFAULT 0 COMMENT '任务状态 0-禁用 1-启用',
`create_time` timestamp not null DEFAULT current_timestamp comment '创建时间',
`update_time` timestamp not null DEFAULT current_timestamp on update current_timestamp COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='定时任务配置表';
INSERT INTO `cron_job` VALUES (1, '周报报表', 'report', 'xyz.gabear.quartz.job.impl.DemoJob001', '0/20 * * * * ? ',
'{\r\n \"id\": 84861,\r\n \"node_type\": 1,\r\n \"service_id\": 0,\r\n \"option\": \"update\"\r\n}',
'周报报表', '<EMAIL>', '<EMAIL>', 1, '2018-10-28 17:58:19', '2018-10-28 19:59:41');
INSERT INTO `cron_job` VALUES (2, NULL, 'compute', 'xyz.gabear.quartz.job.back.DemoMutexJob002', '0/8 * * * * ? ',
'{ \"code\": 0, \"data\": \"string\", \"success\": true }',
'前端添加定时任务', '<EMAIL>', '<EMAIL>', 1, '2018-10-28 21:04:16', '2018-10-28 21:04:16');
|
CREATE TABLE `info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`call` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`whatsapp` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`facebook` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`instagram` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`pdf` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `info` (`id`, `call`, `whatsapp`, `facebook`, `instagram`, `pdf`, `created_at`, `updated_at`) VALUES (1,'3024136600','3024136600','carmonamuseo','museocarmona','uploads/1/2020-08/test.pdf','2020-08-20 01:56:35','2020-10-13 19:43:59'); |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sp_GetSubDeptMasterData]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[Sp_GetSubDeptMasterData]
GO
--EXEC Sp_GetSubDeptMasterData '<EMAIL>'
CREATE PROCEDURE [dbo].[Sp_GetSubDeptMasterData]
@distId VARCHAR(2)
AS
BEGIN
SET NOCOUNT ON;
--Product_SubDept_Master 11
SELECT
Product_SubDept_Master_Identity,
Product_Dept_Master_Id,
Product_SubDept_Master_Desc
FROM Product_SubDept_Master WHERE Dist_Id = @distId
END |
/*CREAR BASE DE DATOS*/
CREATE DATABASE IF NOT EXISTS sweetmoment;
USE sweetmoment;
/* INICIO TABLA DE USUARIOS */
CREATE TABLE usuarios(
id INT(255) auto_increment not null,
nombre VARCHAR (50) NOT NULL,
telefono INT (10) NOT NULL,
contrasena VARCHAR (50) NOT NULL,
email VARCHAR (50) NOT NULL,
verificacion VARCHAR (50) DEFAULT NULL,
created_at datetime DEFAULT NULL,
updated_at datetime DEFAULT NULL,
CONSTRAINT pk_usuario PRIMARY KEY(id)
/* CONSTRAIN fk_tabla1_tabla2 FOREIGN KEY(campo tabla1) REFERENCES tabla2(campo tabla2) */
)ENGINE=InnoDb;
/* FIN TABLA DE USUARIOS */
/* INICIO TABLA DE PRODUCTOS */
CREATE TABLE productos(
id INT(255) auto_increment not null,
nombre VARCHAR (50) NOT NULL,
cantidad INT (10) NOT NULL,
precio VARCHAR (50) NOT NULL,
created_at datetime DEFAULT NULL,
updated_at datetime DEFAULT NULL,
CONSTRAINT pk_usuario PRIMARY KEY(id)
/* CONSTRAIN fk_tabla1_tabla2 FOREIGN KEY(campo tabla1) REFERENCES tabla2(campo tabla2) */
)ENGINE=InnoDb;
/* FIN TABLA DE PRODUCTOS */
|
/*
Navicat Premium Data Transfer
Source Server : 172.16.31.10
Source Server Type : MySQL
Source Server Version : 50721
Source Host : 172.16.31.10
Source Database : tfkz
Target Server Type : MySQL
Target Server Version : 50721
File Encoding : utf-8
Date: 05/21/2018 11:56:13 AM
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `JOB_EXECUTION_LOG`
-- ----------------------------
DROP TABLE IF EXISTS `JOB_EXECUTION_LOG`;
CREATE TABLE `JOB_EXECUTION_LOG` (
`id` varchar(40) NOT NULL,
`job_name` varchar(100) NOT NULL,
`task_id` varchar(255) NOT NULL,
`hostname` varchar(255) NOT NULL,
`ip` varchar(50) NOT NULL,
`sharding_item` int(11) NOT NULL,
`execution_source` varchar(20) NOT NULL,
`failure_cause` varchar(4000) DEFAULT NULL,
`is_success` int(11) NOT NULL,
`start_time` timestamp NULL DEFAULT NULL,
`complete_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for `JOB_STATUS_TRACE_LOG`
-- ----------------------------
DROP TABLE IF EXISTS `JOB_STATUS_TRACE_LOG`;
CREATE TABLE `JOB_STATUS_TRACE_LOG` (
`id` varchar(40) NOT NULL,
`job_name` varchar(100) NOT NULL,
`original_task_id` varchar(255) NOT NULL,
`task_id` varchar(255) NOT NULL,
`slave_id` varchar(50) NOT NULL,
`source` varchar(50) NOT NULL,
`execution_type` varchar(20) NOT NULL,
`sharding_item` varchar(100) NOT NULL,
`state` varchar(20) NOT NULL,
`message` varchar(4000) DEFAULT NULL,
`creation_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `TASK_ID_STATE_INDEX` (`task_id`,`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for `sys_dept`
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
`dept_id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL COMMENT '部门名称',
`order_num` int(11) DEFAULT NULL COMMENT '排序',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`del_flag` char(1) DEFAULT '0' COMMENT '是否删除 -1:已删除 0:正常',
`parent_id` int(11) DEFAULT NULL,
PRIMARY KEY (`dept_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='部门管理';
-- ----------------------------
-- Records of `sys_dept`
-- ----------------------------
BEGIN;
INSERT INTO `sys_dept` VALUES ('1', '山东农信', null, '2018-01-22 19:00:23', '2018-01-23 12:40:46', '0', '0'), ('2', '沙县国际', null, '2018-01-22 19:00:38', '2018-01-23 12:42:04', '0', '0'), ('3', '潍坊农信', null, '2018-01-22 19:00:44', '2018-01-23 12:40:56', '0', '1'), ('4', '高新农信', null, '2018-01-22 19:00:52', '2018-01-23 12:41:11', '0', '3'), ('5', '院校农信', null, '2018-01-22 19:00:57', '2018-01-23 12:41:22', '0', '4'), ('6', '潍坊学院农信', '115', '2018-01-22 19:01:06', '2018-03-07 16:22:04', '0', '5'), ('7', '山东沙县', null, '2018-01-22 19:01:57', '2018-01-23 12:42:15', '0', '2'), ('8', '潍坊沙县', null, '2018-01-22 19:02:03', '2018-01-23 12:42:23', '0', '7'), ('9', '高新沙县', null, '2018-01-22 19:02:14', '2018-03-07 16:28:14', '0', '8');
COMMIT;
-- ----------------------------
-- Table structure for `sys_dept_relation`
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept_relation`;
CREATE TABLE `sys_dept_relation` (
`ancestor` int(11) NOT NULL COMMENT '祖先节点',
`descendant` int(11) NOT NULL COMMENT '后代节点',
PRIMARY KEY (`ancestor`,`descendant`),
KEY `idx1` (`ancestor`),
KEY `idx2` (`descendant`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Records of `sys_dept_relation`
-- ----------------------------
BEGIN;
INSERT INTO `sys_dept_relation` VALUES ('1', '1'), ('1', '3'), ('1', '4'), ('1', '5'), ('1', '6'), ('2', '2'), ('2', '7'), ('2', '8'), ('2', '9'), ('3', '3'), ('3', '4'), ('3', '5'), ('3', '6'), ('4', '4'), ('4', '5'), ('4', '6'), ('5', '5'), ('5', '6'), ('6', '6'), ('7', '7'), ('7', '8'), ('7', '9'), ('8', '8'), ('8', '9'), ('9', '9');
COMMIT;
-- ----------------------------
-- Table structure for `sys_dict`
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`id` int(64) NOT NULL AUTO_INCREMENT COMMENT '编号',
`value` varchar(100) NOT NULL COMMENT '数据值',
`label` varchar(100) NOT NULL COMMENT '标签名',
`type` varchar(100) NOT NULL COMMENT '类型',
`description` varchar(100) NOT NULL COMMENT '描述',
`sort` decimal(10,0) NOT NULL COMMENT '排序(升序)',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
`del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
PRIMARY KEY (`id`),
KEY `sys_dict_value` (`value`),
KEY `sys_dict_label` (`label`),
KEY `sys_dict_del_flag` (`del_flag`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='字典表';
-- ----------------------------
-- Records of `sys_dict`
-- ----------------------------
BEGIN;
INSERT INTO `sys_dict` VALUES ('2', '9', '异常', 'log_type', '日志异常', '1', '2017-12-28 13:06:39', '2018-01-06 10:54:41', null, '0'), ('3', '0', '正常', 'log_type', '正常', '1', '2018-05-11 23:52:57', '2018-05-11 23:52:57', '123', '0');
COMMIT;
-- ----------------------------
-- Table structure for `sys_log_0`
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_0`;
CREATE TABLE `sys_log_0` (
`id` bigint(64) NOT NULL COMMENT '编号',
`type` char(1) DEFAULT '1' COMMENT '日志类型',
`title` varchar(255) DEFAULT '' COMMENT '日志标题',
`service_id` varchar(32) DEFAULT NULL COMMENT '服务ID',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`remote_addr` varchar(255) DEFAULT NULL COMMENT '操作IP地址',
`user_agent` varchar(1000) DEFAULT NULL COMMENT '用户代理',
`request_uri` varchar(255) DEFAULT NULL COMMENT '请求URI',
`method` varchar(10) DEFAULT NULL COMMENT '操作方式',
`params` text COMMENT '操作提交的数据',
`time` mediumtext COMMENT '执行时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标记',
`exception` text COMMENT '异常信息',
PRIMARY KEY (`id`),
KEY `sys_log_create_by` (`create_by`),
KEY `sys_log_request_uri` (`request_uri`),
KEY `sys_log_type` (`type`),
KEY `sys_log_create_date` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='日志表';
-- ----------------------------
-- Table structure for `sys_log_1`
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_1`;
CREATE TABLE `sys_log_1` (
`id` bigint(64) NOT NULL COMMENT '编号',
`type` char(1) DEFAULT '1' COMMENT '日志类型',
`title` varchar(255) DEFAULT '' COMMENT '日志标题',
`service_id` varchar(32) DEFAULT NULL COMMENT '服务ID',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`remote_addr` varchar(255) DEFAULT NULL COMMENT '操作IP地址',
`user_agent` varchar(1000) DEFAULT NULL COMMENT '用户代理',
`request_uri` varchar(255) DEFAULT NULL COMMENT '请求URI',
`method` varchar(10) DEFAULT NULL COMMENT '操作方式',
`params` text COMMENT '操作提交的数据',
`time` mediumtext COMMENT '执行时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标记',
`exception` text COMMENT '异常信息',
PRIMARY KEY (`id`),
KEY `sys_log_create_by` (`create_by`),
KEY `sys_log_request_uri` (`request_uri`),
KEY `sys_log_type` (`type`),
KEY `sys_log_create_date` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='日志表';
-- ----------------------------
-- Table structure for `sys_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`menu_id` int(11) NOT NULL COMMENT '菜单ID',
`name` varchar(32) NOT NULL COMMENT '菜单名称',
`permission` varchar(32) DEFAULT NULL COMMENT '菜单权限标识',
`path` varchar(128) DEFAULT NULL COMMENT '前端URL',
`url` varchar(128) DEFAULT NULL COMMENT '请求链接',
`method` varchar(32) DEFAULT NULL COMMENT '请求方法',
`parent_id` int(11) DEFAULT NULL COMMENT '父菜单ID',
`icon` varchar(32) DEFAULT NULL COMMENT '图标',
`component` varchar(64) DEFAULT NULL COMMENT 'VUE页面',
`sort` int(11) DEFAULT '1' COMMENT '排序值',
`type` char(1) DEFAULT NULL COMMENT '菜单类型 (0菜单 1按钮)',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '0--正常 1--删除',
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单权限表';
-- ----------------------------
-- Records of `sys_menu`
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES ('1', '系统管理', null, '/admin', null, null, '-1', 'icon-xitongguanli', 'Layout', '1', '0', '2017-11-07 20:56:00', '2018-05-14 21:53:22', '0'), ('2', '用户管理', null, 'user', '', null, '1', 'icon-yonghuguanli', 'views/admin/user/index', '2', '0', '2017-11-02 22:24:37', '2018-05-14 22:11:35', '0'), ('3', '菜单管理', null, 'menu', '', null, '1', 'icon-caidanguanli', 'views/admin/menu/index', '3', '0', '2017-11-08 09:57:27', '2018-05-14 22:11:21', '0'), ('4', '角色管理', null, 'role', null, null, '1', 'icon-jiaoseguanli', 'views/admin/role/index', '4', '0', '2017-11-08 10:13:37', '2018-05-14 22:11:19', '0'), ('5', '日志管理', null, 'log', null, null, '1', 'icon-rizhiguanli', 'views/admin/log/index', '5', '0', '2017-11-20 14:06:22', '2018-05-14 22:11:18', '0'), ('6', '字典管理', null, 'dict', null, null, '1', 'icon-zygl', 'views/admin/dict/index', '6', '0', '2017-11-29 11:30:52', '2018-05-14 22:12:48', '0'), ('7', '部门管理', null, 'dept', null, null, '1', 'icon-iconbmgl', 'views/admin/dept/index', '7', '0', '2018-01-20 13:17:19', '2018-05-14 22:11:16', '0'), ('8', '系统监控', null, '', null, null, '-1', 'icon-iconbmgl', null, '8', '0', '2018-01-22 12:30:41', '2018-05-14 20:41:16', '0'), ('9', '服务监控', null, 'http://172.16.31.10:5001', null, null, '8', 'icon-jiankong', null, '9', '0', '2018-01-23 10:53:33', '2018-04-21 03:51:56', '0'), ('10', 'zipkin监控', null, 'http://172.16.31.10:5002', null, null, '8', 'icon-jiankong', null, '11', '0', '2018-01-23 10:55:18', '2018-04-22 07:02:34', '0'), ('11', 'pinpoint监控', null, 'https://pinpoint.tfkz4cloud.com', null, null, '8', 'icon-xiazaihuancun', null, '10', '0', '2018-01-25 11:08:52', '2018-04-22 07:02:38', '0'), ('12', '缓存状态', null, 'http://172.16.31.10:8585', null, null, '8', 'icon-ecs-status', null, '12', '0', '2018-01-23 10:56:11', '2018-04-21 03:51:47', '0'), ('13', 'ELK状态', null, 'http://172.16.31.10:5601', null, null, '8', 'icon-ecs-status', null, '13', '0', '2018-01-23 10:55:47', '2018-04-21 03:51:40', '0'), ('14', '接口文档', null, 'http://139.224.200.249:9999/swagger-ui.html', null, null, '8', 'icon-wendangdocument72', null, '14', '0', '2018-01-23 10:56:43', '2018-04-21 03:50:47', '0'), ('15', '任务监控', null, 'http://172.16.31.10:8899', null, null, '8', 'icon-jiankong', null, '15', '0', '2018-01-23 10:55:18', '2018-04-21 03:51:34', '0'), ('21', '用户查看', '', null, '/admin/user/**', 'GET', '2', null, null, null, '1', '2017-11-07 20:58:05', '2018-02-04 14:28:49', '0'), ('22', '用户新增', 'sys_user_add', null, '/admin/user/*', 'POST', '2', null, null, null, '1', '2017-11-08 09:52:09', '2017-12-04 16:31:10', '0'), ('23', '用户修改', 'sys_user_upd', null, '/admin/user/**', 'PUT', '2', null, null, null, '1', '2017-11-08 09:52:48', '2018-01-17 17:40:01', '0'), ('24', '用户删除', 'sys_user_del', null, '/admin/user/*', 'DELETE', '2', null, null, null, '1', '2017-11-08 09:54:01', '2017-12-04 16:31:18', '0'), ('31', '菜单查看', null, null, '/admin/menu/**', 'GET', '3', null, null, null, '1', '2017-11-08 09:57:56', '2017-11-14 17:29:17', '0'), ('32', '菜单新增', 'sys_menu_add', null, '/admin/menu/*', 'POST', '3', null, null, null, '1', '2017-11-08 10:15:53', '2018-01-20 14:37:50', '0'), ('33', '菜单修改', 'sys_menu_edit', null, '/admin/menu/*', 'PUT', '3', null, null, null, '1', '2017-11-08 10:16:23', '2018-01-20 14:37:56', '0'), ('34', '菜单删除', 'sys_menu_del', null, '/admin/menu/*', 'DELETE', '3', null, null, null, '1', '2017-11-08 10:16:43', '2018-01-20 14:38:03', '0'), ('41', '角色查看', null, null, '/admin/role/**', 'GET', '4', null, null, null, '1', '2017-11-08 10:14:01', '2018-02-04 13:55:06', '0'), ('42', '角色新增', 'sys_role_add', null, '/admin/role/*', 'POST', '4', null, null, null, '1', '2017-11-08 10:14:18', '2018-04-20 07:21:38', '0'), ('43', '角色修改', 'sys_role_edit', null, '/admin/role/*', 'PUT', '4', null, null, null, '1', '2017-11-08 10:14:41', '2018-04-20 07:21:50', '0'), ('44', '角色删除', 'sys_role_del', null, '/admin/role/*', 'DELETE', '4', null, null, null, '1', '2017-11-08 10:14:59', '2018-04-20 07:22:00', '0'), ('45', '分配权限', 'sys_role_perm', null, '/admin/role/*', 'PUT', '4', null, null, null, '1', '2018-04-20 07:22:55', '2018-04-20 07:24:40', '0'), ('51', '日志查看', null, null, '/admin/log/**', 'GET', '5', null, null, null, '1', '2017-11-20 14:07:25', '2018-02-04 14:28:53', '0'), ('52', '日志删除', 'sys_log_del', null, '/admin/log/*', 'DELETE', '5', null, null, null, '1', '2017-11-20 20:37:37', '2017-11-28 17:36:52', '0'), ('61', '字典查看', null, null, '/admin/dict/**', 'GET', '6', null, null, null, '1', '2017-11-19 22:04:24', '2017-11-29 11:31:24', '0'), ('62', '字典删除', 'sys_dict_del', null, '/admin/dict/**', 'DELETE', '6', null, null, null, '1', '2017-11-29 11:30:11', '2018-01-07 15:40:51', '0'), ('63', '字典新增', 'sys_dict_add', null, '/admin/dict/**', 'POST', '6', null, null, null, '1', '2018-05-11 22:34:55', null, '0'), ('64', '字典修改', 'sys_dict_upd', null, '/admin/dict/**', 'PUT', '6', null, null, null, '1', '2018-05-11 22:36:03', null, '0'), ('71', '部门查看', '', null, '/admin/dept/**', 'GET', '7', null, '', null, '1', '2018-01-20 13:17:19', '2018-01-20 14:55:24', '0'), ('72', '部门新增', 'sys_dept_add', null, '/admin/dept/**', 'POST', '7', null, null, null, '1', '2018-01-20 14:56:16', '2018-01-20 21:17:57', '0'), ('73', '部门修改', 'sys_dept_edit', null, '/admin/dept/**', 'PUT', '7', null, null, null, '1', '2018-01-20 14:56:59', '2018-01-20 21:17:59', '0'), ('74', '部门删除', 'sys_dept_del', null, '/admin/dept/**', 'DELETE', '7', null, null, null, '1', '2018-01-20 14:57:28', '2018-01-20 21:18:05', '0'), ('100', '客户端管理', '', 'client', '', '', '1', 'icon-bangzhushouji', 'views/admin/client/index', '9', '0', '2018-01-20 13:17:19', '2018-05-15 21:28:10', '0'), ('101', '客户端新增', 'sys_client_add', null, '/admin/client/**', 'POST', '100', '1', null, null, '1', '2018-05-15 21:35:18', '2018-05-16 10:35:26', '0'), ('102', '客户端修改', 'sys_client_upd', null, '/admin/client/**', 'PUT', '100', null, null, null, '1', '2018-05-15 21:37:06', '2018-05-15 21:52:30', '0'), ('103', '客户端删除', 'sys_client_del', null, '/admin/client/**', 'DELETE', '100', null, null, null, '1', '2018-05-15 21:39:16', '2018-05-15 21:52:34', '0'), ('104', '客户端查看', null, null, '/admin/client/**', 'GET', '100', null, null, null, '1', '2018-05-15 21:39:57', '2018-05-15 21:52:40', '0'), ('110', '路由管理', null, 'route', null, null, '1', 'icon-luyou', 'views/admin/route/index', '8', '0', '2018-05-15 21:44:51', '2018-05-16 06:58:20', '0'), ('111', '路由查看', null, null, '/admin/route/**', 'GET', '110', null, null, null, '1', '2018-05-15 21:45:59', '2018-05-16 07:23:04', '0'), ('112', '路由新增', 'sys_route_add', null, '/admin/route/**', 'POST', '110', null, null, null, '1', '2018-05-15 21:52:22', '2018-05-15 21:53:46', '0'), ('113', '路由修改', 'sys_route_upd', null, '/admin/route/**', 'PUT', '110', null, null, null, '1', '2018-05-15 21:55:38', null, '0'), ('114', '路由删除', 'sys_route_del', null, '/admin/route/**', 'DELETE', '110', null, null, null, '1', '2018-05-15 21:56:45', null, '0');
COMMIT;
-- ----------------------------
-- Table structure for `sys_oauth_client_details`
-- ----------------------------
DROP TABLE IF EXISTS `sys_oauth_client_details`;
CREATE TABLE `sys_oauth_client_details` (
`client_id` varchar(40) NOT NULL,
`resource_ids` varchar(256) DEFAULT NULL,
`client_secret` varchar(256) DEFAULT NULL,
`scope` varchar(256) DEFAULT NULL,
`authorized_grant_types` varchar(256) DEFAULT NULL,
`web_server_redirect_uri` varchar(256) DEFAULT NULL,
`authorities` varchar(256) DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additional_information` varchar(4096) DEFAULT NULL,
`autoapprove` varchar(256) DEFAULT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of `sys_oauth_client_details`
-- ----------------------------
BEGIN;
INSERT INTO `sys_oauth_client_details` VALUES ('app', null, 'app', 'server', 'password,refresh_token', null, null, null, null, null, 'true'), ('tfkz', null, 'tfkz', 'server', 'password,refresh_token,authorization_code', null, null, null, null, null, 'false');
COMMIT;
-- ----------------------------
-- Table structure for `sys_role`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`role_id` int(11) NOT NULL AUTO_INCREMENT,
`role_name` varchar(64) COLLATE utf8mb4_bin NOT NULL,
`role_code` varchar(64) COLLATE utf8mb4_bin NOT NULL,
`role_desc` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '删除标识(0-正常,1-删除)',
PRIMARY KEY (`role_id`),
UNIQUE KEY `role_idx1_role_code` (`role_code`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Records of `sys_role`
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('1', 'admin', 'ROLE_ADMIN', '超级管理员', '2017-10-29 15:45:51', '2018-04-22 11:40:29', '0'), ('14', 'demo', 'demo', 'demo用户', '2018-04-20 07:14:32', '2018-04-21 23:35:22', '0');
COMMIT;
-- ----------------------------
-- Table structure for `sys_role_dept`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_dept`;
CREATE TABLE `sys_role_dept` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`role_id` int(20) DEFAULT NULL COMMENT '角色ID',
`dept_id` int(20) DEFAULT NULL COMMENT '部门ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色与部门对应关系';
-- ----------------------------
-- Records of `sys_role_dept`
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_dept` VALUES ('11', '1', '1'), ('14', '14', '1');
COMMIT;
-- ----------------------------
-- Table structure for `sys_role_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`role_id` int(11) NOT NULL COMMENT '角色ID',
`menu_id` int(11) NOT NULL COMMENT '菜单ID',
PRIMARY KEY (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色菜单表';
-- ----------------------------
-- Records of `sys_role_menu`
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` VALUES ('1', '1'), ('1', '2'), ('1', '3'), ('1', '4'), ('1', '5'), ('1', '6'), ('1', '7'), ('1', '8'), ('1', '9'), ('1', '10'), ('1', '11'), ('1', '12'), ('1', '13'), ('1', '14'), ('1', '15'), ('1', '21'), ('1', '22'), ('1', '23'), ('1', '24'), ('1', '31'), ('1', '32'), ('1', '33'), ('1', '34'), ('1', '41'), ('1', '42'), ('1', '43'), ('1', '44'), ('1', '45'), ('1', '51'), ('1', '52'), ('1', '61'), ('1', '62'), ('1', '63'), ('1', '64'), ('1', '71'), ('1', '72'), ('1', '73'), ('1', '74'), ('1', '100'), ('1', '101'), ('1', '102'), ('1', '103'), ('1', '104'), ('1', '110'), ('1', '111'), ('1', '112'), ('1', '113'), ('1', '114'), ('14', '1'), ('14', '2'), ('14', '3'), ('14', '4'), ('14', '5'), ('14', '6'), ('14', '7'), ('14', '8'), ('14', '9'), ('14', '10'), ('14', '11'), ('14', '12'), ('14', '13'), ('14', '14'), ('14', '15'), ('14', '21'), ('14', '31'), ('14', '41'), ('14', '51'), ('14', '61'), ('14', '71');
COMMIT;
-- ----------------------------
-- Table structure for `sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`username` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',
`password` varchar(255) COLLATE utf8mb4_bin NOT NULL,
`salt` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '随机盐',
`phone` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '简介',
`avatar` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '头像',
`dept_id` int(11) DEFAULT NULL COMMENT '部门ID',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '0-正常,1-删除',
PRIMARY KEY (`user_id`),
UNIQUE KEY `user_idx1_username` (`username`),
UNIQUE KEY `user_idx2_phone` (`phone`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='用户表';
-- ----------------------------
-- Records of `sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('1', 'admin', '$2a$10$vg5QNHhCknAqevx9vM2s5esllJEzF/pa8VZXtFYHhhOhUcCw/GWyS', null, '17034642111', null, '1', '2018-04-20 07:15:18', '2018-05-11 17:12:00', '0'), ('4', 'tfkz', '$2a$10$vg5QNHhCknAqevx9vM2s5esllJEzF/pa8VZXtFYHhhOhUcCw/GWyS', null, '17034642118', null, '1', '2018-04-22 11:39:07', '2018-05-10 18:01:11', '0');
COMMIT;
-- ----------------------------
-- Table structure for `sys_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`user_id` int(11) NOT NULL COMMENT '用户ID',
`role_id` int(11) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户角色表';
-- ----------------------------
-- Records of `sys_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES ('1', '1'), ('4', '14');
COMMIT;
-- ----------------------------
-- Table structure for `sys_zuul_route`
-- ----------------------------
DROP TABLE IF EXISTS `sys_zuul_route`;
CREATE TABLE `sys_zuul_route` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'router Id',
`path` varchar(255) NOT NULL COMMENT '路由路径',
`service_id` varchar(255) NOT NULL COMMENT '服务名称',
`url` varchar(255) DEFAULT NULL COMMENT 'url代理',
`strip_prefix` char(1) DEFAULT '1' COMMENT '转发去掉前缀',
`retryable` char(1) DEFAULT '1' COMMENT '是否重试',
`enabled` char(1) DEFAULT '1' COMMENT '是否启用',
`sensitiveHeaders_list` varchar(255) DEFAULT NULL COMMENT '敏感请求头',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标识(0-正常,1-删除)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='动态路由配置表';
-- ----------------------------
-- Records of `sys_zuul_route`
-- ----------------------------
BEGIN;
INSERT INTO `sys_zuul_route` VALUES ('1', 'test', 'test', 'tsest', '1', '1', '1', '0', '2018-05-16 07:28:43', '2018-05-16 07:35:08', '1'), ('2', 'sdfg', 'we', 'jjj', '1', '1', '1', 'jj', '2018-05-16 07:35:43', '2018-05-17 13:56:14', '1'), ('3', '/demo/**', 'tfkz-demo-service', '', '1', '1', '1', '', '2018-05-17 14:09:06', '2018-05-17 14:32:36', '0'), ('4', '/admin/**', 'tfkz-upms-service', '', '1', '1', '1', '', '2018-05-21 11:40:38', null, '0'), ('5', '/auth/**', 'tfkz-auth', '', '1', '1', '1', '', '2018-05-21 11:41:08', null, '0');
COMMIT;
-- ----------------------------
-- Table structure for `zipkin_annotations`
-- ----------------------------
DROP TABLE IF EXISTS `zipkin_annotations`;
CREATE TABLE `zipkin_annotations` (
`trace_id_high` bigint(20) NOT NULL DEFAULT '0' COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
`trace_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.trace_id',
`span_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.id',
`a_key` varchar(255) NOT NULL COMMENT 'BinaryAnnotation.key or Annotation.value if type == -1',
`a_value` blob COMMENT 'BinaryAnnotation.value(), which must be smaller than 64KB',
`a_type` int(11) NOT NULL COMMENT 'BinaryAnnotation.type() or -1 if Annotation',
`a_timestamp` bigint(20) DEFAULT NULL COMMENT 'Used to implement TTL; Annotation.timestamp or zipkin_spans.timestamp',
`endpoint_ipv4` int(11) DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
`endpoint_ipv6` binary(16) DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null, or no IPv6 address',
`endpoint_port` smallint(6) DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
`endpoint_service_name` varchar(255) DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
UNIQUE KEY `trace_id_high` (`trace_id_high`,`trace_id`,`span_id`,`a_key`,`a_timestamp`) COMMENT 'Ignore insert on duplicate',
UNIQUE KEY `trace_id_high_4` (`trace_id_high`,`trace_id`,`span_id`,`a_key`,`a_timestamp`) COMMENT 'Ignore insert on duplicate',
KEY `trace_id_high_2` (`trace_id_high`,`trace_id`,`span_id`) COMMENT 'for joining with zipkin_spans',
KEY `trace_id_high_3` (`trace_id_high`,`trace_id`) COMMENT 'for getTraces/ByIds',
KEY `endpoint_service_name` (`endpoint_service_name`) COMMENT 'for getTraces and getServiceNames',
KEY `a_type` (`a_type`) COMMENT 'for getTraces',
KEY `a_key` (`a_key`) COMMENT 'for getTraces',
KEY `trace_id` (`trace_id`,`span_id`,`a_key`) COMMENT 'for dependencies job',
KEY `trace_id_high_5` (`trace_id_high`,`trace_id`,`span_id`) COMMENT 'for joining with zipkin_spans',
KEY `trace_id_high_6` (`trace_id_high`,`trace_id`) COMMENT 'for getTraces/ByIds',
KEY `endpoint_service_name_2` (`endpoint_service_name`) COMMENT 'for getTraces and getServiceNames',
KEY `a_type_2` (`a_type`) COMMENT 'for getTraces',
KEY `a_key_2` (`a_key`) COMMENT 'for getTraces',
KEY `trace_id_2` (`trace_id`,`span_id`,`a_key`) COMMENT 'for dependencies job'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;
-- ----------------------------
-- Table structure for `zipkin_dependencies`
-- ----------------------------
DROP TABLE IF EXISTS `zipkin_dependencies`;
CREATE TABLE `zipkin_dependencies` (
`day` date NOT NULL,
`parent` varchar(255) NOT NULL,
`child` varchar(255) NOT NULL,
`call_count` bigint(20) DEFAULT NULL,
UNIQUE KEY `day` (`day`,`parent`,`child`),
UNIQUE KEY `day_2` (`day`,`parent`,`child`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;
-- ----------------------------
-- Table structure for `zipkin_spans`
-- ----------------------------
DROP TABLE IF EXISTS `zipkin_spans`;
CREATE TABLE `zipkin_spans` (
`trace_id_high` bigint(20) NOT NULL DEFAULT '0' COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
`trace_id` bigint(20) NOT NULL,
`id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
`parent_id` bigint(20) DEFAULT NULL,
`debug` bit(1) DEFAULT NULL,
`start_ts` bigint(20) DEFAULT NULL COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL',
`duration` bigint(20) DEFAULT NULL COMMENT 'Span.duration(): micros used for minDuration and maxDuration query',
UNIQUE KEY `trace_id_high` (`trace_id_high`,`trace_id`,`id`) COMMENT 'ignore insert on duplicate',
UNIQUE KEY `trace_id_high_4` (`trace_id_high`,`trace_id`,`id`) COMMENT 'ignore insert on duplicate',
KEY `trace_id_high_2` (`trace_id_high`,`trace_id`,`id`) COMMENT 'for joining with zipkin_annotations',
KEY `trace_id_high_3` (`trace_id_high`,`trace_id`) COMMENT 'for getTracesByIds',
KEY `name` (`name`) COMMENT 'for getTraces and getSpanNames',
KEY `start_ts` (`start_ts`) COMMENT 'for getTraces ordering and range',
KEY `trace_id_high_5` (`trace_id_high`,`trace_id`,`id`) COMMENT 'for joining with zipkin_annotations',
KEY `trace_id_high_6` (`trace_id_high`,`trace_id`) COMMENT 'for getTracesByIds',
KEY `name_2` (`name`) COMMENT 'for getTraces and getSpanNames',
KEY `start_ts_2` (`start_ts`) COMMENT 'for getTraces ordering and range'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;
SET FOREIGN_KEY_CHECKS = 1;
|
update users
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and (email like <EMAIL>' or email like <EMAIL>');
update organizations
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and (key like 'a-public-%'
or key like 'z-test-%');
update memberships
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and organization_guid in (select guid from organizations where deleted_at is not null);
update membership_requests
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and organization_guid in (select guid from organizations where deleted_at is not null);
update organization_domains
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and organization_guid in (select guid from organizations where deleted_at is not null);
update subscriptions
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and organization_guid in (select guid from organizations where deleted_at is not null);
update applications
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and organization_guid in (select guid from organizations where deleted_at is not null);
update application_moves
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and application_guid in (select guid from applications where deleted_at is not null);
update attributes
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and name like 'z-test%';
update organization_attribute_values
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and value like 'z-test%';
update changes
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and application_guid in (select guid from applications where deleted_at is not null);
delete from search.items
where application_guid in (select guid from applications where deleted_at is not null);
update versions
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and application_guid in (select guid from applications where deleted_at is not null);
update watches
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and application_guid in (select guid from applications where deleted_at is not null);
update generators.services
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and uri like 'http://test.generator.%';
update generators.generators
set deleted_at=now(), deleted_by_guid = created_by_guid
where deleted_at is null
and service_guid in (select guid from generators.services where deleted_at is not null);
|
<filename>00 - BD/7 new_version_tree_manager.sql
-- MariaDB dump 10.17 Distrib 10.4.13-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: tm
-- ------------------------------------------------------
-- Server version 10.4.13-MariaDB
/*!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 */;
/*!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 `adm`
--
DROP TABLE IF EXISTS `adm`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adm` (
`idAdm` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(60) NOT NULL,
`email` varchar(80) NOT NULL,
`senha` varchar(50) NOT NULL,
PRIMARY KEY (`idAdm`),
UNIQUE KEY `unico` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `adm`
--
LOCK TABLES `adm` WRITE;
/*!40000 ALTER TABLE `adm` DISABLE KEYS */;
INSERT INTO `adm` VALUES (1,'adm','<EMAIL>','adm'),(2,'<NAME>','<EMAIL>','breno');
/*!40000 ALTER TABLE `adm` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `arvore`
--
DROP TABLE IF EXISTS `arvore`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `arvore` (
`IdArvore` int(11) NOT NULL AUTO_INCREMENT,
`idAdm` int(11) DEFAULT NULL,
`Situacao` varchar(60) NOT NULL,
`localizacao` varchar(300) NOT NULL,
`NomeCientifico` varchar(40) NOT NULL,
`DistanciaLotes` float unsigned NOT NULL,
`DistanciaEsquinas` float unsigned NOT NULL,
`CondicaoFisicoSanitaria` varchar(7) NOT NULL,
`AlturaPrimeiraBifurcacao` float unsigned NOT NULL,
`CondicaoSistemaRadicular` varchar(17) NOT NULL,
`LarguraCalcada` float unsigned NOT NULL,
`NumImovelProx` varchar(11) NOT NULL,
`Poda` varchar(13) NOT NULL,
`LocalPlantio` varchar(20) NOT NULL,
`conflitos` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`latitude` float DEFAULT NULL,
`longitude` float DEFAULT NULL,
`Altura` float unsigned NOT NULL,
`Toxidez` varchar(10) NOT NULL,
`DistanciaOutraArvore` float unsigned NOT NULL,
`AcaoRecomendada` varchar(20) NOT NULL,
`PavimentacaoCalcada` varchar(20) NOT NULL,
`DistanciaGaragens` float unsigned NOT NULL,
`Rua` char(50) NOT NULL,
`Habito` varchar(30) NOT NULL,
`Familia` varchar(30) NOT NULL,
`DistanciaPostes` float NOT NULL,
`NomePopular` char(40) NOT NULL,
`Origem` varchar(30) NOT NULL,
`Observacao` varchar(300) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`IdArvore`),
KEY `admValida` (`idAdm`),
CONSTRAINT `admValida` FOREIGN KEY (`idAdm`) REFERENCES `adm` (`idAdm`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `arvore`
--
LOCK TABLES `arvore` WRITE;
/*!40000 ALTER TABLE `arvore` DISABLE KEYS */;
INSERT INTO `arvore` VALUES (18,NULL,'cadastrada','','Pingo de ouro',0,0,'aval1',0,'avalradicular1',0,'18A','podaLeve','calcada','redeDeEnergia',NULL,NULL,0,'Sim',3,'podaLeve1','comPavimento',0,'Rua Vitoria','arvore','rutaceae',1.23,'murta de cheiro','nativa',''),(39,NULL,'pendente','','Akak',1.2,12,'aval2',1.2,'avalradicular3',1.2,'918373j','podaLeve','ViaPublica','redeDeEnergia',NULL,NULL,2.1,'Nao',4.2,'','comPavimento',2.3,'91838291','arbusto','Hsja',12,'Jakw','exótica',''),(41,NULL,'pendente','','murraya ',3,421,'aval1',3,'avalradicular1',9,'720B','podaLeve','calcada','redeDeEnergia',NULL,NULL,6.78,'sim',320,'','comPavimento',25,'Rua Mônica','arvore','rutaceae',6.2,'murta de cheiro','nativa',''),(42,NULL,'pendente','','Pingo de ouro',3,2,'aval1',3.64,'avalradicular1',65,'560A','podaLeve','calcada','redeDeEnergia',NULL,NULL,6.78,'sim',3,'','semPavimento',2,'Rua Mônica','arvore','Eucalipto',2,'murta de cheiro','nativa',''),(43,NULL,'pendente','','murraya ',2,2,'aval1',3,'avalradicular1',5,'87879a','podaLeve','calcada','redeDeEnergia',NULL,NULL,2,'sim',3,'','comPavimento',3,'Rua Vitoria','arvore','rutaceae',6.2,'3','nativa',''),(44,NULL,'pendente','','ekj',3,3,'aval1',3,'avalradicular1',2,'720B','podaLeve','calcada','redeDeEnergia',NULL,NULL,2,'sim',3,'','comPavimento',3,'Rua Mônica','arvore','rutaceae',6,'kjioj','nativa',''),(45,NULL,'pendente','','3',3,2,'aval1',3,'avalradicular1',5,'230','podaLeve','calcada','redeDeEnergia',NULL,NULL,2,'sim',3,'','comPavimento',3,'1','arvore','5',65,'3','nativa','');
/*!40000 ALTER TABLE `arvore` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `atendimento`
--
DROP TABLE IF EXISTS `atendimento`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `atendimento` (
`idAtendimento` int(11) NOT NULL AUTO_INCREMENT,
`codServico` int(11) NOT NULL,
`usuAtendente` int(11) NOT NULL,
`descricao` varchar(100) NOT NULL,
`data` date NOT NULL,
PRIMARY KEY (`idAtendimento`),
KEY `usuarioatendente` (`usuAtendente`),
KEY `codServico` (`codServico`),
CONSTRAINT `codServico` FOREIGN KEY (`codServico`) REFERENCES `servico` (`codServico`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `usuarioatendente` FOREIGN KEY (`usuAtendente`) REFERENCES `adm` (`idAdm`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `atendimento`
--
LOCK TABLES `atendimento` WRITE;
/*!40000 ALTER TABLE `atendimento` DISABLE KEYS */;
/*!40000 ALTER TABLE `atendimento` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `servico`
--
DROP TABLE IF EXISTS `servico`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `servico` (
`codServico` int(11) NOT NULL AUTO_INCREMENT,
`descricao` varchar(400) NOT NULL,
`codArvore` int(11) NOT NULL,
`tipoServico` int(11) NOT NULL,
`dataServico` date NOT NULL,
`usuSolicitante` int(11) NOT NULL,
`statusSer` varchar(60) NOT NULL,
PRIMARY KEY (`codServico`),
KEY `usuSolicitante` (`usuSolicitante`),
KEY `codArvore` (`codArvore`),
KEY `tipoServico` (`tipoServico`),
CONSTRAINT `codArvore` FOREIGN KEY (`codArvore`) REFERENCES `arvore` (`IdArvore`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tipoServico` FOREIGN KEY (`tipoServico`) REFERENCES `tiposervico` (`idTipoServico`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `usuSolicitante` FOREIGN KEY (`usuSolicitante`) REFERENCES `usuario` (`idUsuario`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `servico`
--
LOCK TABLES `servico` WRITE;
/*!40000 ALTER TABLE `servico` DISABLE KEYS */;
INSERT INTO `servico` VALUES (51,'klsdjflks',41,1,'2020-05-09',6,'pendente');
/*!40000 ALTER TABLE `servico` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tiposervico`
--
DROP TABLE IF EXISTS `tiposervico`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tiposervico` (
`idTipoServico` int(11) NOT NULL AUTO_INCREMENT,
`NomeServico` varchar(80) NOT NULL,
PRIMARY KEY (`idTipoServico`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tiposervico`
--
LOCK TABLES `tiposervico` WRITE;
/*!40000 ALTER TABLE `tiposervico` DISABLE KEYS */;
INSERT INTO `tiposervico` VALUES (1,'Poda leve'),(4,'Poda pesada'),(5,'Reparo de Danos'),(6,'Substituição'),(7,'Outro'),(8,'Editar dados');
/*!40000 ALTER TABLE `tiposervico` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario`
--
DROP TABLE IF EXISTS `usuario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuario` (
`idUsuario` int(11) NOT NULL AUTO_INCREMENT,
`status` varchar(60) NOT NULL DEFAULT 'ativo',
`tipo` varchar(15) NOT NULL,
`nome` varchar(100) NOT NULL,
`email` varchar(60) NOT NULL,
`fone` varchar(20) NOT NULL,
`senha` varchar(60) NOT NULL,
`foto` varchar(300) NOT NULL DEFAULT 'perfil.jpg',
PRIMARY KEY (`idUsuario`),
UNIQUE KEY `unica` (`email`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `usuario`
--
LOCK TABLES `usuario` WRITE;
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
INSERT INTO `usuario` VALUES (4,'desativo','colaborador','<NAME>','<EMAIL>','123884','1234','perfil.png'),(5,'ativo','colaborador','pedrinho','<EMAIL>','123884','1234','perfil.png'),(6,'ativo','colaborador','Pedrinho','<EMAIL>','798794654','1234','perfil.png'),(7,'ativo','colaborador','<NAME>','<EMAIL>','12341','123','perfil.png');
/*!40000 ALTER TABLE `usuario` 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-06-12 15:18:28
|