sql
stringlengths
6
1.05M
-- -- PostgreSQL database dump -- -- Dumped from database version 11.1 -- Dumped by pg_dump version 11.1 -- Started on 2019-04-30 09:58:40 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 client_min_messages = warning; SET row_security = off; DROP DATABASE ci4_test; -- -- TOC entry 2830 (class 1262 OID 16400) -- Name: ci4_test; Type: DATABASE; Schema: -; Owner: postgres -- CREATE DATABASE ci4_test WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Chinese (Simplified)_China.936' LC_CTYPE = 'Chinese (Simplified)_China.936' TABLESPACE = ci4_demo; ALTER DATABASE ci4_test OWNER TO postgres; \connect ci4_test 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 client_min_messages = warning; SET row_security = off; -- -- TOC entry 2831 (class 0 OID 0) -- Dependencies: 2830 -- Name: DATABASE ci4_test; Type: COMMENT; Schema: -; Owner: postgres -- COMMENT ON DATABASE ci4_test IS 'ci4框架练习'; SET default_tablespace = ''; SET default_with_oids = false; -- -- TOC entry 197 (class 1259 OID 16404) -- Name: ci_admin; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.ci_admin ( id integer NOT NULL, name character varying(15), status smallint DEFAULT 1, addtime integer NOT NULL, uptime integer NOT NULL, group_id smallint DEFAULT 0 NOT NULL, pass character(40) ); ALTER TABLE public.ci_admin OWNER TO postgres; -- -- TOC entry 2832 (class 0 OID 0) -- Dependencies: 197 -- Name: TABLE ci_admin; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON TABLE public.ci_admin IS '系统管理员'; -- -- TOC entry 2833 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.id; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.id IS '自增id(管理员id)'; -- -- TOC entry 2834 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.name; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.name IS '管理员名称'; -- -- TOC entry 2835 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.status; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.status IS '管理员是否启用,1是,2否'; -- -- TOC entry 2836 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.addtime; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.addtime IS '添加时间'; -- -- TOC entry 2837 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.uptime; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.uptime IS '修改时间'; -- -- TOC entry 2838 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.group_id; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.group_id IS '分组id,默认不属于任何分组'; -- -- TOC entry 2839 (class 0 OID 0) -- Dependencies: 197 -- Name: COLUMN ci_admin.pass; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin.pass IS '密码'; -- -- TOC entry 196 (class 1259 OID 16402) -- Name: ci_admin_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.ci_admin_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.ci_admin_id_seq OWNER TO postgres; -- -- TOC entry 2840 (class 0 OID 0) -- Dependencies: 196 -- Name: ci_admin_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.ci_admin_id_seq OWNED BY public.ci_admin.id; -- -- TOC entry 199 (class 1259 OID 24594) -- Name: ci_admin_log; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.ci_admin_log ( id integer NOT NULL, describe character varying(200) NOT NULL, opera_id smallint NOT NULL, addtime integer NOT NULL, opera_ip inet NOT NULL ); ALTER TABLE public.ci_admin_log OWNER TO postgres; -- -- TOC entry 2841 (class 0 OID 0) -- Dependencies: 199 -- Name: TABLE ci_admin_log; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON TABLE public.ci_admin_log IS '管理员日志'; -- -- TOC entry 2842 (class 0 OID 0) -- Dependencies: 199 -- Name: COLUMN ci_admin_log.id; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin_log.id IS '自增id'; -- -- TOC entry 2843 (class 0 OID 0) -- Dependencies: 199 -- Name: COLUMN ci_admin_log.describe; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin_log.describe IS '操作描述'; -- -- TOC entry 2844 (class 0 OID 0) -- Dependencies: 199 -- Name: COLUMN ci_admin_log.opera_id; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin_log.opera_id IS '操作id(1增——a,2删——d,3查——s,4改——u)'; -- -- TOC entry 2845 (class 0 OID 0) -- Dependencies: 199 -- Name: COLUMN ci_admin_log.opera_ip; Type: COMMENT; Schema: public; Owner: postgres -- COMMENT ON COLUMN public.ci_admin_log.opera_ip IS '当前客户端IP'; -- -- TOC entry 198 (class 1259 OID 24592) -- Name: ci_admin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.ci_admin_log_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.ci_admin_log_id_seq OWNER TO postgres; -- -- TOC entry 2846 (class 0 OID 0) -- Dependencies: 198 -- Name: ci_admin_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.ci_admin_log_id_seq OWNED BY public.ci_admin_log.id; -- -- TOC entry 2692 (class 2604 OID 16407) -- Name: ci_admin id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.ci_admin ALTER COLUMN id SET DEFAULT nextval('public.ci_admin_id_seq'::regclass); -- -- TOC entry 2695 (class 2604 OID 24597) -- Name: ci_admin_log id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.ci_admin_log ALTER COLUMN id SET DEFAULT nextval('public.ci_admin_log_id_seq'::regclass); -- -- TOC entry 2822 (class 0 OID 16404) -- Dependencies: 197 -- Data for Name: ci_admin; Type: TABLE DATA; Schema: public; Owner: postgres -- INSERT INTO public.ci_admin (id, name, status, addtime, uptime, group_id, pass) VALUES (1, 'admin', 1, 1556423252, 1556529512, 0, '3582a9e8367e2cd386f6b01eff352562f9cf875d'); -- -- TOC entry 2824 (class 0 OID 24594) -- Dependencies: 199 -- Data for Name: ci_admin_log; Type: TABLE DATA; Schema: public; Owner: postgres -- INSERT INTO public.ci_admin_log (id, describe, opera_id, addtime, opera_ip) VALUES (1, 'admin 管理员登陆,时间:2019-04-29 17:08:09', 3, 1556528889, '127.0.0.1'); INSERT INTO public.ci_admin_log (id, describe, opera_id, addtime, opera_ip) VALUES (2, 'admin 管理员登陆,时间:2019-04-29 17:10:31', 3, 1556529031, '127.0.0.1'); INSERT INTO public.ci_admin_log (id, describe, opera_id, addtime, opera_ip) VALUES (3, 'admin 管理员登陆,时间:2019-04-29 17:12:05', 3, 1556529125, '127.0.0.1'); INSERT INTO public.ci_admin_log (id, describe, opera_id, addtime, opera_ip) VALUES (4, 'admin 管理员登陆,时间:2019-04-29 17:12:28', 3, 1556529148, '127.0.0.1'); INSERT INTO public.ci_admin_log (id, describe, opera_id, addtime, opera_ip) VALUES (5, 'admin 管理员登陆,时间:2019-04-29 17:18:32', 3, 1556529512, '127.0.0.1'); -- -- TOC entry 2847 (class 0 OID 0) -- Dependencies: 196 -- Name: ci_admin_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.ci_admin_id_seq', 1, false); -- -- TOC entry 2848 (class 0 OID 0) -- Dependencies: 198 -- Name: ci_admin_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.ci_admin_log_id_seq', 5, true); -- -- TOC entry 2699 (class 2606 OID 24602) -- Name: ci_admin_log ci_admin_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.ci_admin_log ADD CONSTRAINT ci_admin_log_pkey PRIMARY KEY (id); -- -- TOC entry 2697 (class 2606 OID 16409) -- Name: ci_admin ci_admin_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.ci_admin ADD CONSTRAINT ci_admin_pkey PRIMARY KEY (id); -- Completed on 2019-04-30 09:58:41 -- -- PostgreSQL database dump complete --
<reponame>jasoncable/medicalreference CREATE TABLE [dbo].[Drug] ( [Id] INT NOT NULL IDENTITY, [Ingredient] VARCHAR(MAX) NOT NULL, [DosageFormId] INT NOT NULL, [RouteOfAdminId] INT NOT NULL, [DrugTypeId] INT NOT NULL, [DrugScheduleId] INT NULL, [StartMarketingDate] DATETIME NULL, [EndMarketingDate] DATETIME NULL, [MarketingCategoryId] INT NOT NULL, CONSTRAINT [FK_Drug_MarketingCategory] FOREIGN KEY (MarketingCategoryId) REFERENCES MarketingCategory(Id), CONSTRAINT [FK_Drug_DosageForm] FOREIGN KEY (DosageFormId) REFERENCES DosageForm(Id), CONSTRAINT [FK_Drug_RouteOfAdministration] FOREIGN KEY (RouteOfAdminId) REFERENCES RouteOfAdministration(Id), CONSTRAINT [FK_Drug_DrugType] FOREIGN KEY (DrugTypeId) REFERENCES DrugType(Id), CONSTRAINT [FK_Drug_DrugSchedule] FOREIGN KEY (DrugScheduleId) REFERENCES DrugSchedule(Id), CONSTRAINT [PK_Drug] PRIMARY KEY CLUSTERED (Id) ) GO
GRANT ALL PRIVILEGES ON ninja.* TO 'ninja'@'%' IDENTIFIED BY 'ninja'; GRANT ALL PRIVILEGES ON douitsu.* TO 'douitsu'@'%' IDENTIFIED BY 'douitsu'; FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS `douitsu`; USE `douitsu` CREATE TABLE sys_entity ( id varchar(255) NOT NULL, zone varchar(255) DEFAULT NULL, base varchar(255) DEFAULT NULL, name varchar(255) DEFAULT NULL, fields varchar(4000) DEFAULT NULL, seneca varchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE sys_settings ( id varchar(255) NOT NULL, kind varchar(255) DEFAULT NULL, spec varchar(255) DEFAULT NULL, ref varchar(255) DEFAULT NULL, settings varchar(255) DEFAULT NULL, data varchar(4000) DEFAULT NULL, seneca varchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE sys_user ( id varchar(255) NOT NULL, nick varchar(255) DEFAULT NULL, name varchar(255) DEFAULT NULL, email varchar(255) DEFAULT NULL, active tinyint(1) DEFAULT NULL, created datetime DEFAULT NULL, updated datetime DEFAULT NULL, confirmed tinyint(1) DEFAULT NULL, confirmcode varchar(255) DEFAULT NULL, admin tinyint(1) DEFAULT NULL, salt varchar(255) DEFAULT NULL, pass varchar(255) DEFAULT NULL, image varchar(255) DEFAULT NULL, accounts varchar(4000) DEFAULT NULL, seneca varchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE sys_reset ( id varchar(255) NOT NULL, active tinyint(1) DEFAULT NULL, nick varchar(255) DEFAULT NULL, user varchar(255) DEFAULT NULL, `when` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE sys_login ( id varchar(255) NOT NULL, nick varchar(255) DEFAULT NULL, email varchar(255) DEFAULT NULL, user varchar(255) DEFAULT NULL, active tinyint(1) DEFAULT NULL, auto tinyint(1) DEFAULT NULL, `when` datetime DEFAULT NULL, why varchar(255) DEFAULT NULL, token varchar(255) DEFAULT NULL, context varchar(255) DEFAULT NULL, ended timestamp NOT NULL, seneca varchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE sys_account ( id varchar(255) NOT NULL, name varchar(255) DEFAULT NULL, orignick varchar(255) DEFAULT NULL, origuser varchar(255) DEFAULT NULL, active tinyint(1) DEFAULT NULL, users varchar(4000) DEFAULT NULL, projects varchar(4000) DEFAULT NULL, seneca varchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE application ( id varchar(255) NOT NULL, account varchar(255) DEFAULT NULL, name varchar(255) DEFAULT NULL, appid varchar(255) DEFAULT NULL, secret varchar(255) DEFAULT NULL, homeurl varchar(255) DEFAULT NULL, callback varchar(255) DEFAULT NULL, `desc` varchar(255) DEFAULT NULL, image varchar(255) DEFAULT NULL, active tinyint(1) DEFAULT NULL, is_ninja_official tinyint(1) NOT NULL DEFAULT 0, client_type enum('confidential', 'public') NOT NULL DEFAULT 'confidential', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE authcode ( id varchar(255) NOT NULL, code varchar(255) NOT NULL, clientID varchar(255) NOT NULL, redirectURI varchar(255) NOT NULL, userID varchar(255) NOT NULL, scope varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE accesstoken ( id varchar(255) NOT NULL, userID varchar(255) NOT NULL, clientID varchar(255) NOT NULL, clientName varchar(255) NOT NULL, type varchar(255) NOT NULL DEFAULT 'application', `mqtt_client_id` int(20) NOT NULL AUTO_INCREMENT UNIQUE, `node_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE accesstoken_scope ( id varchar(255) NOT NULL, accesstoken varchar(255) NOT NULL, scope_domain varchar(255) NOT NULL, scope_item varchar(255) NOT NULL, PRIMARY KEY (id), UNIQUE KEY `scope_specific` (accesstoken, scope_domain, scope_item), FOREIGN KEY (accesstoken) REFERENCES accesstoken (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE DATABASE IF NOT EXISTS `ninja`; USE `ninja`; CREATE TABLE `nodes` ( -- `mqtt_client_id` int(20) NOT NULL AUTO_INCREMENT UNIQUE, `user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `node_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `site_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `hardware_type` varchar(64) NOT NULL, -- `token` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `mqtt_client_id` int(20) not null auto_increment, PRIMARY KEY (`user_id`, `node_id`), UNIQUE KEY `mqtt_client_id_key` (`mqtt_client_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `users` ( `user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `name` varchar(128) NOT NULL, `email` varchar(128) NOT NULL, `lastAccessToken` varchar(128) NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `sphere_network_key` varchar(64) NOT NULL, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `sites` ( `user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `site_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `master_node_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`user_id`, `site_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
<filename>Assessment/Scripts/Netezza/_v_sys_object_data_V1.sql select * from admin._v_sys_object_data;
-- file:tsrf.sql ln:161 expect:true select generate_series(1,3) as x, generate_series(1,3) + 1 as xp1
ALTER TABLE COI_DISCL_PROJECTS ADD CONSTRAINT FK_COI_ISCLOSURE_PROJECTS FOREIGN KEY (COI_DISCLOSURE_ID) REFERENCES COI_DISCLOSURE (COI_DISCLOSURE_ID) /
<gh_stars>0 ALTER TABLE samples ADD parent_id INT; COMMENT ON COLUMN samples.parent_id IS 'In cases where sampling data is gathered in a hierarchical fashion, this allows samples to be linked to a parent sample. For example, a sample linear transect may have several quadrat samples taken along it''s length.';
# standardSQL # Count Open Graph types CREATE TEMP FUNCTION getOpenGraphTypes(rendered STRING) RETURNS ARRAY<STRING> LANGUAGE js AS """ try { rendered = JSON.parse(rendered); return rendered.opengraph.map(opengraph => opengraph.property.toLowerCase()); } catch (e) { return []; } """; WITH rendered_data AS ( SELECT getOpenGraphTypes(rendered) AS open_graph_types, client FROM ( SELECT JSON_EXTRACT(JSON_VALUE(JSON_EXTRACT(payload, '$._structured-data')), '$.structured_data.rendered') AS rendered, _TABLE_SUFFIX AS client FROM `httparchive.pages.2021_07_01_*`) ) SELECT open_graph_type, COUNT(open_graph_type) AS count, SUM(COUNT(open_graph_type)) OVER (PARTITION BY client) AS total, COUNT(open_graph_type) / SUM(COUNT(open_graph_type)) OVER (PARTITION BY client) AS pct, client FROM rendered_data, UNNEST(open_graph_types) AS open_graph_type GROUP BY open_graph_type, client ORDER BY count DESC
<reponame>Ed-Fi-Alliance-OSS/Ed-Fi-MigrationUtility -- 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. PRINT N'Creating primary key [DiplomaType_PK] on [edfi].[DiplomaType]' GO ALTER TABLE [edfi].[DiplomaType] ADD CONSTRAINT [DiplomaType_PK] PRIMARY KEY CLUSTERED ([DiplomaTypeId]) GO PRINT N'Creating index [UX_DiplomaType_Id] on [edfi].[DiplomaType]' GO CREATE UNIQUE NONCLUSTERED INDEX [UX_DiplomaType_Id] ON [edfi].[DiplomaType] ([Id]) WITH (FILLFACTOR=100, PAD_INDEX=ON) GO PRINT N'Adding constraints to [edfi].[DiplomaType]' GO ALTER TABLE [edfi].[DiplomaType] ADD CONSTRAINT [DiplomaType_DF_CreateDate] DEFAULT (getdate()) FOR [CreateDate] GO ALTER TABLE [edfi].[DiplomaType] ADD CONSTRAINT [DiplomaType_DF_LastModifiedDate] DEFAULT (getdate()) FOR [LastModifiedDate] GO ALTER TABLE [edfi].[DiplomaType] ADD CONSTRAINT [DiplomaType_DF_Id] DEFAULT (newid()) FOR [Id] GO
-- Drop table Friends DROP TABLE Friends;
<filename>TestDatabases/SQLServer/EfrpgTest (manually created).sql -- This database will contain all the horrible edge cases this generator has to cope with /*CREATE DATABASE [EfrpgTest] ON PRIMARY ( NAME = N'EfrpgTest', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\EfrpgTest.mdf' , SIZE = 5Mb , FILEGROWTH = 1024KB ) LOG ON ( NAME = N'EfrpgTest_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\EfrpgTest.ldf' , SIZE = 1024KB , FILEGROWTH = 10%); GO ALTER DATABASE [EfrpgTest] SET COMPATIBILITY_LEVEL = 100 ALTER DATABASE [EfrpgTest] SET ANSI_NULL_DEFAULT OFF ALTER DATABASE [EfrpgTest] SET ANSI_NULLS OFF ALTER DATABASE [EfrpgTest] SET ANSI_PADDING OFF ALTER DATABASE [EfrpgTest] SET ANSI_WARNINGS OFF ALTER DATABASE [EfrpgTest] SET ARITHABORT OFF ALTER DATABASE [EfrpgTest] SET AUTO_CLOSE OFF ALTER DATABASE [EfrpgTest] SET AUTO_CREATE_STATISTICS ON ALTER DATABASE [EfrpgTest] SET AUTO_SHRINK OFF ALTER DATABASE [EfrpgTest] SET AUTO_UPDATE_STATISTICS ON ALTER DATABASE [EfrpgTest] SET CURSOR_CLOSE_ON_COMMIT OFF ALTER DATABASE [EfrpgTest] SET CURSOR_DEFAULT GLOBAL ALTER DATABASE [EfrpgTest] SET CONCAT_NULL_YIELDS_NULL OFF ALTER DATABASE [EfrpgTest] SET NUMERIC_ROUNDABORT OFF ALTER DATABASE [EfrpgTest] SET QUOTED_IDENTIFIER OFF ALTER DATABASE [EfrpgTest] SET RECURSIVE_TRIGGERS OFF ALTER DATABASE [EfrpgTest] SET DISABLE_BROKER ALTER DATABASE [EfrpgTest] SET AUTO_UPDATE_STATISTICS_ASYNC OFF ALTER DATABASE [EfrpgTest] SET DATE_CORRELATION_OPTIMIZATION OFF ALTER DATABASE [EfrpgTest] SET PARAMETERIZATION SIMPLE ALTER DATABASE [EfrpgTest] SET READ_WRITE ALTER DATABASE [EfrpgTest] SET RECOVERY SIMPLE ALTER DATABASE [EfrpgTest] SET MULTI_USER ALTER DATABASE [EfrpgTest] SET PAGE_VERIFY CHECKSUM GO USE [EfrpgTest] GO IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [EfrpgTest] MODIFY FILEGROUP [PRIMARY] DEFAULT GO */ /* CREATE DATABASE [EfrpgTest_Synonyms] ON PRIMARY ( NAME = N'EfrpgTest_Synonyms', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\EfrpgTest_Synonyms.mdf' , SIZE = 5Mb , FILEGROWTH = 1024KB ) LOG ON ( NAME = N'EfrpgTest_Synonyms_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\EfrpgTest_Synonyms.ldf' , SIZE = 1024KB , FILEGROWTH = 10%); GO ALTER DATABASE [EfrpgTest_Synonyms] SET COMPATIBILITY_LEVEL = 100 ALTER DATABASE [EfrpgTest_Synonyms] SET ANSI_NULL_DEFAULT OFF ALTER DATABASE [EfrpgTest_Synonyms] SET ANSI_NULLS OFF ALTER DATABASE [EfrpgTest_Synonyms] SET ANSI_PADDING OFF ALTER DATABASE [EfrpgTest_Synonyms] SET ANSI_WARNINGS OFF ALTER DATABASE [EfrpgTest_Synonyms] SET ARITHABORT OFF ALTER DATABASE [EfrpgTest_Synonyms] SET AUTO_CLOSE OFF ALTER DATABASE [EfrpgTest_Synonyms] SET AUTO_CREATE_STATISTICS ON ALTER DATABASE [EfrpgTest_Synonyms] SET AUTO_SHRINK OFF ALTER DATABASE [EfrpgTest_Synonyms] SET AUTO_UPDATE_STATISTICS ON ALTER DATABASE [EfrpgTest_Synonyms] SET CURSOR_CLOSE_ON_COMMIT OFF ALTER DATABASE [EfrpgTest_Synonyms] SET CURSOR_DEFAULT GLOBAL ALTER DATABASE [EfrpgTest_Synonyms] SET CONCAT_NULL_YIELDS_NULL OFF ALTER DATABASE [EfrpgTest_Synonyms] SET NUMERIC_ROUNDABORT OFF ALTER DATABASE [EfrpgTest_Synonyms] SET QUOTED_IDENTIFIER OFF ALTER DATABASE [EfrpgTest_Synonyms] SET RECURSIVE_TRIGGERS OFF ALTER DATABASE [EfrpgTest_Synonyms] SET DISABLE_BROKER ALTER DATABASE [EfrpgTest_Synonyms] SET AUTO_UPDATE_STATISTICS_ASYNC OFF ALTER DATABASE [EfrpgTest_Synonyms] SET DATE_CORRELATION_OPTIMIZATION OFF ALTER DATABASE [EfrpgTest_Synonyms] SET PARAMETERIZATION SIMPLE ALTER DATABASE [EfrpgTest_Synonyms] SET READ_WRITE ALTER DATABASE [EfrpgTest_Synonyms] SET RECOVERY SIMPLE ALTER DATABASE [EfrpgTest_Synonyms] SET MULTI_USER ALTER DATABASE [EfrpgTest_Synonyms] SET PAGE_VERIFY CHECKSUM GO USE [EfrpgTest_Synonyms] GO IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [EfrpgTest_Synonyms] MODIFY FILEGROUP [PRIMARY] DEFAULT GO */ /* CREATE DATABASE [EfrpgTest_Settings] ON PRIMARY ( NAME = N'EfrpgTest_Settings', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\EfrpgTest_Settings.mdf' , SIZE = 5Mb , FILEGROWTH = 1024KB ) LOG ON ( NAME = N'EfrpgTest_Settings_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\EfrpgTest_Settings.ldf' , SIZE = 1024KB , FILEGROWTH = 10%); GO ALTER DATABASE [EfrpgTest_Settings] SET COMPATIBILITY_LEVEL = 100 ALTER DATABASE [EfrpgTest_Settings] SET ANSI_NULL_DEFAULT OFF ALTER DATABASE [EfrpgTest_Settings] SET ANSI_NULLS OFF ALTER DATABASE [EfrpgTest_Settings] SET ANSI_PADDING OFF ALTER DATABASE [EfrpgTest_Settings] SET ANSI_WARNINGS OFF ALTER DATABASE [EfrpgTest_Settings] SET ARITHABORT OFF ALTER DATABASE [EfrpgTest_Settings] SET AUTO_CLOSE OFF ALTER DATABASE [EfrpgTest_Settings] SET AUTO_CREATE_STATISTICS ON ALTER DATABASE [EfrpgTest_Settings] SET AUTO_SHRINK OFF ALTER DATABASE [EfrpgTest_Settings] SET AUTO_UPDATE_STATISTICS ON ALTER DATABASE [EfrpgTest_Settings] SET CURSOR_CLOSE_ON_COMMIT OFF ALTER DATABASE [EfrpgTest_Settings] SET CURSOR_DEFAULT GLOBAL ALTER DATABASE [EfrpgTest_Settings] SET CONCAT_NULL_YIELDS_NULL OFF ALTER DATABASE [EfrpgTest_Settings] SET NUMERIC_ROUNDABORT OFF ALTER DATABASE [EfrpgTest_Settings] SET QUOTED_IDENTIFIER OFF ALTER DATABASE [EfrpgTest_Settings] SET RECURSIVE_TRIGGERS OFF ALTER DATABASE [EfrpgTest_Settings] SET DISABLE_BROKER ALTER DATABASE [EfrpgTest_Settings] SET AUTO_UPDATE_STATISTICS_ASYNC OFF ALTER DATABASE [EfrpgTest_Settings] SET DATE_CORRELATION_OPTIMIZATION OFF ALTER DATABASE [EfrpgTest_Settings] SET PARAMETERIZATION SIMPLE ALTER DATABASE [EfrpgTest_Settings] SET READ_WRITE ALTER DATABASE [EfrpgTest_Settings] SET RECOVERY SIMPLE ALTER DATABASE [EfrpgTest_Settings] SET MULTI_USER ALTER DATABASE [EfrpgTest_Settings] SET PAGE_VERIFY CHECKSUM GO USE [EfrpgTest_Settings] GO IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [EfrpgTest_Settings] MODIFY FILEGROUP [PRIMARY] DEFAULT GO */ USE [EfrpgTest_Settings] GO -- This will create the tables necessary for multi-context generation IF SCHEMA_ID(N'MultiContext') IS NULL EXEC (N'CREATE SCHEMA [MultiContext];'); GO SET ANSI_NULLS ON; SET QUOTED_IDENTIFIER ON; GO -- You can add extra fields to this table. All columns will be read in and stored in a Dictionary<string,object>() for you to access and process. CREATE TABLE MultiContext.Context ( Id INT NOT NULL IDENTITY(1, 1), Name NVARCHAR(255) NOT NULL, Namespace NVARCHAR(128) NULL, Description NVARCHAR(255) NULL, BaseSchema NVARCHAR(255) NULL, -- Default to use if not specified for an object TemplatePath NVARCHAR(500) NULL, Filename NVARCHAR(128) NULL, -- If Filename == NULL, then use Name, else use Filename as the name of the file CONSTRAINT PK_Context PRIMARY KEY CLUSTERED (Id) ); GO /* Create enumeration from database table public enum Name { NameField = ValueField, etc } */ -- You can add extra fields to this table. All columns will be read in and stored in a Dictionary<string,object>() for you to access and process. CREATE TABLE MultiContext.Enumeration ( Id INT NOT NULL IDENTITY(1, 1), Name NVARCHAR(255) NOT NULL, -- Enum to generate. e.g. "DaysOfWeek" would result in "public enum DaysOfWeek {...}" [Table] NVARCHAR(255) NOT NULL, -- Database table containing enum values. e.g. "DaysOfWeek" NameField NVARCHAR(255) NOT NULL, -- Column containing the name for the enum. e.g. "TypeName" ValueField NVARCHAR(255) NOT NULL, -- Column containing the values for the enum. e.g. "TypeId" ContextId INT NOT NULL, CONSTRAINT PK_Enumeration PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_Enumeration_Context_ContextId FOREIGN KEY (ContextId) REFERENCES MultiContext.Context (Id) ON DELETE NO ACTION ); GO -- You can add extra fields to this table. All columns will be read in and stored in a Dictionary<string,object>() for you to access and process. CREATE TABLE MultiContext.[Function] ( Id INT NOT NULL IDENTITY(1, 1), Name NVARCHAR(255) NOT NULL, DbName NVARCHAR(255) NULL, -- [optional] Name of function in database. Specify only if the db function name is different from the "Name" property. ContextId INT NOT NULL, CONSTRAINT PK_Function PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_Function_Context_ContextId FOREIGN KEY (ContextId) REFERENCES MultiContext.Context (Id) ON DELETE NO ACTION ); GO -- You can add extra fields to this table. All columns will be read in and stored in a Dictionary<string,object>() for you to access and process. CREATE TABLE MultiContext.StoredProcedure ( Id INT NOT NULL IDENTITY(1, 1), Name NVARCHAR(255) NOT NULL, DbName NVARCHAR(255) NULL, -- [optional] Name of stored proc in database. Specify only if the db stored proc name is different from the "Name" property. ReturnModel NVARCHAR(255) NULL, -- [optional] Specify a return model for stored proc ContextId INT NOT NULL, CONSTRAINT PK_StoredProcedure PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_StoredProcedure_Context_ContextId FOREIGN KEY (ContextId) REFERENCES MultiContext.Context (Id) ON DELETE NO ACTION ); GO -- You can add extra fields to this table. All columns will be read in and stored in a Dictionary<string,object>() for you to access and process. CREATE TABLE MultiContext.[Table] ( Id INT NOT NULL IDENTITY(1, 1), Name NVARCHAR(255) NOT NULL, Description NVARCHAR(255) NULL, -- [optional] Comment added to table class PluralName NVARCHAR(255) NULL, -- [optional] Override auto-plural name DbName NVARCHAR(255) NULL, -- [optional] Name of table in database. Specify only if the db table name is different from the "Name" property. ContextId INT NOT NULL, Attributes NVARCHAR(500) NULL, -- [optional] Use a tilda ~ delimited list of attributes to add to this table property. e.g. [CustomSecurity(Security.ReadOnly)]~[AnotherAttribute]~[Etc] -- The tilda ~ delimiter used in Attributes can be changed if you set Settings.MultiContextAttributeDelimiter = '~'; to something else. DbSetModifier NVARCHAR(128) NULL, -- [optional] Will override setting of table.DbSetModifier. Default is "public". CONSTRAINT PK_Table PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_Table_Context_ContextId FOREIGN KEY (ContextId) REFERENCES MultiContext.Context (Id) ON DELETE NO ACTION ); GO -- You can add extra fields to this table. All columns will be read in and stored in a Dictionary<string,object>() for you to access and process. CREATE TABLE MultiContext.[Column] ( Id INT NOT NULL IDENTITY(1, 1), Name NVARCHAR(255) NOT NULL, DbName NVARCHAR(255) NULL, -- [optional] Name of column in database. Specify only if the db column name is different from the "Name" property. IsPrimaryKey BIT NULL, -- [optional] Useful for views as views don't have primary keys. OverrideModifier BIT NULL, -- [optional] Adds "override" modifier. EnumType NVARCHAR(255) NULL, -- [optional] Use enum type instead of data type TableId INT NOT NULL, Attributes NVARCHAR(500) NULL, -- [optional] Use a tilda ~ delimited list of attributes to add to a poco property. e.g. [CustomSecurity(Security.ReadOnly)]~[Required] -- The tilda ~ delimiter used in Attributes can be changed if you set Settings.MultiContextAttributeDelimiter = '~'; to something else. PropertyType NVARCHAR(128) NULL, -- [optional] Will override setting of column.PropertyType IsNullable BIT NULL, -- [optional] Will override setting of column.IsNullable CONSTRAINT PK_Column PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_Column_Table_TableId FOREIGN KEY (TableId) REFERENCES MultiContext.[Table] (Id) ON DELETE NO ACTION ); GO -- Existing foreign keys will be read and used as normal from the source database, however you can specify extra foreign keys here. -- Define extra navigation relationships, such as views, since views don’t have relationships. -- Specify names as defined in the database, not how they will be named in C# CREATE TABLE MultiContext.ForeignKey ( Id INT NOT NULL IDENTITY(1, 1), ContextId INT NOT NULL, ConstraintName NVARCHAR(128) NOT NULL, -- The contstraint name appears in the comments of the foreign key ParentName NVARCHAR(128) NULL, -- [optional] Name of the parent foreign key property. If NULL it will be generated. ChildName NVARCHAR(128) NULL, -- [optional] Name of the child foreign key property. If NULL it will be generated. PkSchema NVARCHAR(128) NULL, -- [optional] Will default to MultiContext.Context.BaseSchema PkTableName NVARCHAR(128) NOT NULL, PkColumn NVARCHAR(128) NOT NULL, FkSchema NVARCHAR(128) NULL, -- [optional] Will default to MultiContext.Context.BaseSchema FkTableName NVARCHAR(128) NOT NULL, FkColumn NVARCHAR(128) NOT NULL, Ordinal INT NOT NULL, -- Order of this item CascadeOnDelete BIT NOT NULL, -- If false will add .WillCascadeOnDelete(false) IsNotEnforced BIT NOT NULL, -- If not enforced, it means foreign key is optional. .HasOptional(...) or .HasRequired(...) HasUniqueConstraint BIT NOT NULL, -- True if this FK points to columns that have a unique constraint against them CONSTRAINT PK_ForeignKey PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_ForeignKey_Context_ContextId FOREIGN KEY (ContextId) REFERENCES MultiContext.Context (Id) ON DELETE NO ACTION ); GO CREATE NONCLUSTERED INDEX IX_Table_ContextId ON MultiContext.[Table] (ContextId); CREATE NONCLUSTERED INDEX IX_Column_TableId ON MultiContext.[Column] (TableId); CREATE NONCLUSTERED INDEX IX_Enumeration_ContextId ON MultiContext.Enumeration (ContextId); CREATE NONCLUSTERED INDEX IX_Function_ContextId ON MultiContext.[Function] (ContextId); CREATE NONCLUSTERED INDEX IX_StoredProcedure_ContextId ON MultiContext.StoredProcedure (ContextId); CREATE NONCLUSTERED INDEX IX_ForeignKey_ContextId ON MultiContext.ForeignKey (ContextId); GO CREATE UNIQUE NONCLUSTERED INDEX UX_Context_Name ON MultiContext.Context ([Name]); CREATE UNIQUE NONCLUSTERED INDEX UX_Enumeration_Name ON MultiContext.Enumeration (ContextId, [Name]); CREATE UNIQUE NONCLUSTERED INDEX UX_Function_Name ON MultiContext.[Function] (ContextId, [Name]); CREATE UNIQUE NONCLUSTERED INDEX UX_StoredProcedure_Name ON MultiContext.StoredProcedure (ContextId, [Name]); CREATE UNIQUE NONCLUSTERED INDEX UX_Table_Name ON MultiContext.[Table] (ContextId, [Name]); CREATE UNIQUE NONCLUSTERED INDEX UX_Column_Name ON MultiContext.[Column] (TableId, [Name]); GO /* If you need to reset the data TRUNCATE TABLE MultiContext.ForeignKey TRUNCATE TABLE MultiContext.Enumeration TRUNCATE TABLE MultiContext.[Column] TRUNCATE TABLE MultiContext.StoredProcedure TRUNCATE TABLE MultiContext.[Function] DELETE FROM MultiContext.[Table] DELETE FROM MultiContext.Context */ -- Example for inserting data INSERT INTO MultiContext.Context ([Name], [Description], BaseSchema, [Namespace]) VALUES (N'EnumerationDbContext',N'This module is used to extract the enumerations', 'dbo', NULL), (N'AppleDbContext', N'Testing apples', NULL, NULL), (N'BananaDbContext', N'Testing bananas', N'dbo', NULL), (N'CherryDbContext', N'Testing cherries', N'dbo', 'Cherry'), (N'DamsonDbContext', N'Testing Damson plums', NULL, 'Plum'); GO UPDATE MultiContext.Context SET filename='CherryDatabaseContext' WHERE Name='CherryDbContext' --UPDATE MultiContext.Context SET TemplatePath='C:\path_to_templates\' WHERE [Name]='DamsonDbContext' GO DECLARE @id INT; SELECT @id = Id FROM MultiContext.Context WHERE [Name]='EnumerationDbContext'; INSERT INTO MultiContext.Enumeration ([Name], [Table], NameField, ValueField, ContextId) VALUES (N'DaysOfWeek',N'EnumTest.DaysOfWeek',N'TypeName',N'TypeId', @id), (N'CarOptions',N'EnumsWithStringAsValue',N'enum_name',N'value', @id); GO DECLARE @id INT; SELECT @id = Id FROM MultiContext.Context WHERE [Name]='AppleDbContext'; INSERT INTO MultiContext.[Table] ([Name], [Description], PluralName, DbName, ContextId) VALUES (N'Boo', NULL, NULL, N'Stafford.Boo', @id), (N'Foo', NULL, NULL, N'Stafford.Foo', @id); INSERT INTO MultiContext.[Column] (Name, DbName, IsPrimaryKey, OverrideModifier, EnumType, TableId) VALUES (N'id', NULL, NULL, 0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'Boo')), (N'Name', NULL, NULL, 0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'Boo')), (N'id', NULL, NULL, 0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'Foo')); GO DECLARE @id INT; SELECT @id = Id FROM MultiContext.Context WHERE [Name]=N'BananaDbContext'; INSERT INTO MultiContext.[Table] ([Name], [Description], PluralName, DbName, ContextId) VALUES (N'ComputedColumns', NULL, NULL, N'Stafford.ComputedColumns', @id); INSERT INTO MultiContext.[Column] (Name, DbName, IsPrimaryKey, OverrideModifier, EnumType, TableId) VALUES (N'id', NULL, NULL, 0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'ComputedColumns')), (N'MyColumn', NULL, NULL, 0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'ComputedColumns')); GO DECLARE @id INT; SELECT @id = Id FROM MultiContext.Context WHERE [Name]='CherryDbContext'; INSERT INTO MultiContext.[Table] ([Name], [Description], PluralName, DbName, ContextId) VALUES (N'ColumnNameAndTypes', NULL, NULL, NULL, @id); INSERT INTO MultiContext.[Column] (Name, DbName, IsPrimaryKey, OverrideModifier, EnumType, TableId) VALUES (N'Dollar', N'$' ,NULL,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'ColumnNameAndTypes')), (N'Pound', N'[£]',NULL,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'ColumnNameAndTypes')), (N'StaticField', N'static',NULL,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'ColumnNameAndTypes')), (N'Day', N'readonly',NULL,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'ColumnNameAndTypes')); GO DECLARE @id INT; SELECT @id = Id FROM MultiContext.Context WHERE [Name]='DamsonDbContext'; INSERT INTO MultiContext.[Table] ([Name], [Description], PluralName, DbName, ContextId) VALUES (N'NoPrimaryKeys', NULL, NULL, NULL, @id), (N'Parent', NULL, NULL, N'[Synonyms].[Parent]', @id); INSERT INTO MultiContext.[Column] (Name, DbName, IsPrimaryKey, OverrideModifier, EnumType, TableId) VALUES (N'Description', NULL ,1,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'NoPrimaryKeys')), (N'ParentId', NULL,NULL,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'Parent')), (N'ParentName', N'ParentName',NULL,0, NULL, (SELECT id FROM MultiContext.[Table] WHERE ContextId=@id AND Name=N'Parent')); INSERT INTO MultiContext.ForeignKey (ContextId, ConstraintName, ParentName, ChildName, PkSchema, PkTableName, PkColumn, FkSchema, FkTableName, FkColumn, Ordinal, CascadeOnDelete, IsNotEnforced, HasUniqueConstraint) VALUES (@id, N'CustomNameForForeignKey', N'ParentFkName', N'ChildFkName', N'dbo', N'NoPrimaryKeys', N'Description', N'Synonyms', N'Parent', N'ParentName', 1, 0, 0, 0); GO UPDATE MultiContext.[Column] SET Attributes=N'[ExampleForTesting("abc")]~[CustomRequired]' WHERE Name=N'Dollar' UPDATE MultiContext.[Column] SET Attributes=N'[ExampleForTesting("def")]~[CustomSecurity(SecurityEnum.Readonly)]' WHERE Name=N'Pound' GO -- Test to make sure all optional fields are read in and stored in dictionary ALTER TABLE MultiContext.[Column] ADD Test VARCHAR(10) NULL; GO ALTER TABLE MultiContext.[Column] ADD DummyInt int NULL; GO ALTER TABLE MultiContext.[Column] ADD date_of_birth DATETIME NULL; GO UPDATE MultiContext.[Column] SET Test = N'Hello', DummyInt = 1234, date_of_birth = '20 June 2019' WHERE Name=N'Dollar' UPDATE MultiContext.[Column] SET Test = N'World', DummyInt = 5678, date_of_birth = '21 June 2019' WHERE Name=N'Pound' GO /* To see what settings you have SELECT * FROM MultiContext.Context; SELECT * FROM MultiContext.[Table]; SELECT * FROM MultiContext.[Column]; SELECT * FROM MultiContext.StoredProcedure; SELECT * FROM MultiContext.[Function]; SELECT * FROM MultiContext.Enumeration; SELECT * FROM MultiContext.ForeignKey; */ USE [EfrpgTest] GO -- Enumeration generation tests CREATE SCHEMA EnumTest GO -- Enum inside schema CREATE TABLE EnumTest.DaysOfWeek ( TypeName VARCHAR(50) NOT NULL, TypeId INT NOT NULL ); GO INSERT INTO EnumTest.DaysOfWeek (TypeName, TypeId) VALUES ('Sun', 0), ('Mon', 1), ('Tue', 2), ('Wed', 3), ('Thu', 4), ('Fri', 6), ('Sat', 7); GO -- Enum in default schema CREATE TABLE dbo.EnumsWithStringAsValue ( enum_name VARCHAR(50) NOT NULL, [value] VARCHAR(10) NOT NULL ); GO INSERT INTO EnumsWithStringAsValue VALUES ('SunRoof','0x01'), ('Spoiler', '0x02'), ('FogLights', '0x04'), ('TintedWindows', '0x08') GO -- #321 Fix reverse navigation properties for One-To-One relationships CREATE SCHEMA Stafford GO CREATE TABLE Stafford.Boo ( id INT IDENTITY(1, 1) NOT NULL, [name] NCHAR(10) NOT NULL, CONSTRAINT PK_Boo PRIMARY KEY CLUSTERED (id ASC) ); CREATE TABLE Stafford.Foo ( id INT NOT NULL, [name] NCHAR(10) NOT NULL, CONSTRAINT PK_Foo PRIMARY KEY CLUSTERED (id ASC) ); GO ALTER TABLE Stafford.Foo WITH CHECK ADD CONSTRAINT FK_Foo_Boo FOREIGN KEY(id) REFERENCES Stafford.Boo (id); GO ALTER TABLE Stafford.Foo CHECK CONSTRAINT FK_Foo_Boo; GO CREATE TABLE Stafford.ComputedColumns ( Id INT NOT NULL IDENTITY(1,1), MyColumn varchar(10) NOT NULL, MyComputedColumn AS MyColumn, CONSTRAINT PK_Stafford_ComputedColumns PRIMARY KEY CLUSTERED (id ASC) ); GO CREATE FUNCTION [dbo].[CsvToInt] ( @array varchar(8000), @array2 varchar(8000) = '' ) RETURNS @IntTable TABLE(IntValue int) AS BEGIN DECLARE @seperator char(1) SET @seperator = ',' DECLARE @seperator_position int DECLARE @array_value varchar(8000) SET @array = @array + @seperator WHILE PATINDEX('%,%', @array) <> 0 BEGIN SELECT @seperator_position = PATINDEX('%,%', @array) SELECT @array_value = LEFT(@array, @seperator_position - 1) INSERT @IntTable VALUES (CAST(@array_value AS int)) SELECT @array = STUFF(@array, 1, @seperator_position, '') IF LEN(@array) = 0 AND LEN(@array2) > 0 BEGIN SET @array = @array2 + ',' SET @array2 = '' END END RETURN END GO IF SCHEMA_ID(N'CustomSchema') IS NULL EXEC (N'CREATE SCHEMA [CustomSchema];'); GO CREATE FUNCTION [CustomSchema].[CsvToIntWithSchema] ( @array varchar(8000), @array2 varchar(8000) = '' ) RETURNS @IntTable TABLE(IntValue int) AS BEGIN DECLARE @seperator char(1) SET @seperator = ',' DECLARE @seperator_position int DECLARE @array_value varchar(8000) SET @array = @array + @seperator WHILE PATINDEX('%,%', @array) <> 0 BEGIN SELECT @seperator_position = PATINDEX('%,%', @array) SELECT @array_value = LEFT(@array, @seperator_position - 1) INSERT @IntTable VALUES (CAST(@array_value AS int)) SELECT @array = STUFF(@array, 1, @seperator_position, '') IF LEN(@array) = 0 AND LEN(@array2) > 0 BEGIN SET @array = @array2 + ',' SET @array2 = '' END END RETURN END GO CREATE FUNCTION udfNetSale (@quantity INT, @list_price DEC(10, 2), @discount DEC(4, 2)) RETURNS DEC(10, 2) AS BEGIN RETURN @quantity * @list_price * (1 - @discount); END; GO -- DROP TABLE ColumnNameAndTypes; CREATE TABLE ColumnNameAndTypes ( [$] INT NOT null, [%] INT null, [£] INT null, [&fred$] INT null, [abc/\] INT null, [joe.bloggs] INT null, -- Contains a period [simon-hughes] INT null, -- Snake cased [description] varchar(20) NOT NULL DEFAULT (space((0))), someDate DATETIME2(7) NOT NULL DEFAULT (GETDATE()), [Obs] VARCHAR(50) NULL CONSTRAINT [DF__PlanStudies_Obs] DEFAULT ('[{"k":"en","v":""},{"k":"pt","v":""}]'), -- #281 Default values must be escaped on entity classes [Obs1] VARCHAR(50) NULL CONSTRAINT [DF__PlanStudies_Obs1] DEFAULT ('\'), -- #281 [Obs2] VARCHAR(50) NULL CONSTRAINT [DF__PlanStudies_Obs2] DEFAULT ('\\'), -- #281 [Obs3] VARCHAR(50) NULL CONSTRAINT [DF__PlanStudies_Obs3] DEFAULT ('\\\'), -- #281 [static] INT NULL, -- #279 Illegal C# [readonly] INT NULL, -- #279 Illegal C# [123Hi] INT NULL, -- #279 Illegal C# [areal] REAL NULL DEFAULT (1.23), -- #283 need default as 1.23f [afloat] FLOAT NULL DEFAULT (999.), [afloat8] FLOAT(8) NULL, [afloat20] FLOAT(20) NULL, [afloat24] FLOAT(24) NULL, -- same as real. real = float(24) [afloat53] FLOAT(53) NULL, [adecimal] DECIMAL NULL, [adecimal_19_4] DECIMAL(19, 4) NULL, [adecimal_10_3] DECIMAL(10, 3) NULL, [anumeric] NUMERIC NULL, [anumeric_5_2] NUMERIC(5, 2) NULL, [anumeric_11_3] NUMERIC(11, 3) NULL, [amoney] MONEY NULL, [asmallmoney] SMALLMONEY NULL, [brandon] INT NULL, -- <NAME>. IsFixedLength not acceptable for CHAR fixed length columns. GeographyType GEOGRAPHY NULL DEFAULT(CONVERT(GEOGRAPHY,'POINT (0 0)')), GeometryType GEOMETRY NULL DEFAULT(GEOMETRY::STGeomFromText('LINESTRING (100 100, 20 180, 180 180)', 0)), CONSTRAINT PK_ColumnNameAndTypes PRIMARY KEY CLUSTERED ([$]) ); GO EXEC sys.sp_addextendedproperty @name = N'MS_Description', @value = N'This is to document the bring the action table', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'ColumnNameAndTypes'; GO INSERT INTO ColumnNameAndTypes ([$]) VALUES (1); GO EXEC sys.sp_addextendedproperty @name = N'MS_Description_v2', @value = N'This is to document the table with poor column name choices', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'ColumnNameAndTypes'; GO -- This table is unusable by EF as all the columns are NULL. -- We should see this table generated inside a comment, but with a comment that it is unusable CREATE TABLE NoPrimaryKeys ( Id INT NULL, [Description] VARCHAR(10) NULL ) GO -- Create objects that will be linked to via synonyms from another database CREATE SCHEMA Synonyms GO CREATE TABLE [Synonyms].[Parent]( [ParentId] [int] NOT NULL, [ParentName] [varchar](100) NOT NULL, CONSTRAINT [PK_Parent] PRIMARY KEY CLUSTERED ( [ParentId] 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 INSERT INTO [Synonyms].[Parent] ([ParentId], [ParentName]) VALUES (1 ,'Parent 1') GO CREATE TABLE [Synonyms].[Child]( [ChildId] [int] NOT NULL, [ParentId] [int] NOT NULL, [ChildName] [varchar](100) NULL, CONSTRAINT [PK_Child] PRIMARY KEY CLUSTERED ( [ChildId] 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 ALTER TABLE [Synonyms].[Child] WITH CHECK ADD CONSTRAINT [FK_Child_Parent] FOREIGN KEY([ParentId]) REFERENCES [Synonyms].[Parent] ([ParentId]) GO ALTER TABLE [Synonyms].[Child] CHECK CONSTRAINT [FK_Child_Parent] GO INSERT INTO [Synonyms].[Child] ([ChildId],[ParentId],[ChildName]) VALUES (1, 1, 'Child 1') GO CREATE PROCEDURE [Synonyms].[SimpleStoredProc] @InputInt int AS BEGIN SET NOCOUNT ON; SELECT 'Return' AS ReturnValue END GO -- Create synonyms pointing to main test dabase USE [EfrpgTest_Synonyms] GO CREATE SCHEMA Synonyms GO CREATE SCHEMA [CustomSchema] GO CREATE SYNONYM [Synonyms].[Parent] FOR [EfrpgTest].[Synonyms].[Parent] CREATE SYNONYM [Synonyms].[Child] FOR [EfrpgTest].[Synonyms].[Child] CREATE SYNONYM [Synonyms].[SimpleStoredProc] FOR [EfrpgTest].[Synonyms].[SimpleStoredProc] CREATE SYNONYM [CustomSchema].[CsvToIntWithSchema] FOR [EfrpgTest].[CustomSchema].[CsvToIntWithSchema] GO -- Create table with multiple FK's CREATE TABLE dbo.UserInfo ( Id INT IDENTITY(1, 1) NOT NULL, Forename VARCHAR(20) NULL CONSTRAINT PK_UserInfo PRIMARY KEY CLUSTERED ([Id] ASC), ) CREATE TABLE dbo.UserInfoAttributes ( Id INT IDENTITY(1, 1) NOT NULL, CONSTRAINT PK_UserInfoAttributes PRIMARY KEY CLUSTERED ([Id] ASC), PrimaryId INT NOT NULL, SecondaryId INT NOT NULL ) GO ALTER TABLE dbo.UserInfoAttributes WITH CHECK ADD CONSTRAINT FK_UserInfoAttributes_PrimaryUserInfo FOREIGN KEY(PrimaryId) REFERENCES dbo.UserInfo (id); ALTER TABLE dbo.UserInfoAttributes WITH CHECK ADD CONSTRAINT FK_UserInfoAttributes_SecondaryUserInfo FOREIGN KEY(SecondaryId) REFERENCES dbo.UserInfo (id); ALTER TABLE dbo.UserInfoAttributes CHECK CONSTRAINT FK_UserInfoAttributes_PrimaryUserInfo; ALTER TABLE dbo.UserInfoAttributes CHECK CONSTRAINT FK_UserInfoAttributes_SecondaryUserInfo; GO USE EfrpgTest GO -- DROP TABLE BatchTest CREATE TABLE BatchTest ( code NVARCHAR(8) NOT NULL, CONSTRAINT PK_BatchTest PRIMARY KEY CLUSTERED (code) ); GO -- Table contains a period -- DROP TABLE [Period.Table] CREATE TABLE [Period.Table] ( id INT NOT NULL, [joe.bloggs] INT null, -- Column contains a period CONSTRAINT PK_Period_Table PRIMARY KEY CLUSTERED (Id) ); GO -- Table contains a period -- DROP TABLE [PeriodTestTable] CREATE TABLE [PeriodTestTable] ( id INT NOT NULL, [joe.bloggs] INT null, -- Column contains a period CONSTRAINT PK_PeriodTestTable PRIMARY KEY (id) ); GO -- DROP TABLE SmallDecimalTest CREATE TABLE SmallDecimalTest ( id INT NOT NULL, KoeffVed DECIMAL(4,4) NULL DEFAULT (0.5), CONSTRAINT PK_SmallDecimalTest PRIMARY KEY (id) ); GO /****** Object: Default [d_t_address_type_domain] Script Date: 22/07/2015 14:28:05 ******/ CREATE DEFAULT [dbo].[d_t_address_type_domain] AS 'A' GO -- DROP TABLE PropertyTypesToAdd CREATE TABLE PropertyTypesToAdd ( id INT NOT NULL, dt_default DATETIME2 NULL, dt7 DATETIME2(7) NULL, defaultCheck varchar(10) NULL, CONSTRAINT PK_PropertyTypesToAdd PRIMARY KEY (id) ) GO sp_bindefault '[dbo].[d_t_address_type_domain]', 'PropertyTypesToAdd.defaultCheck'; GO CREATE SCHEMA FkTest GO -- DROP TABLE FkTest.SmallDecimalTestAttribute CREATE TABLE FkTest.SmallDecimalTestAttribute ( FkID INT NOT NULL, [description] varchar(20) NOT NULL, CONSTRAINT PK_FkTest_SmallDecimalTestAttribute PRIMARY KEY (FkID) ) GO ALTER TABLE FkTest.SmallDecimalTestAttribute ADD CONSTRAINT KateFK FOREIGN KEY (FkID) REFERENCES dbo.SmallDecimalTest (id) -- ALTER TABLE FkTest.SmallDecimalTestAttribute drop CONSTRAINT KateFK; GO -- DROP PROC FkTest.Hello; CREATE PROC FkTest.Hello AS SELECT [static],[readonly] -- #279 Contains static and readonly, which are illegal in C# FROM ColumnNameAndTypes GO CREATE VIEW SmallDecimalTestView AS SELECT FkID, description FROM FkTest.SmallDecimalTestAttribute GO CREATE VIEW [view.with.multiple.periods] AS SELECT FkID, description FROM FkTest.SmallDecimalTestAttribute GO -- DROP TABLE [table.with.multiple.periods] CREATE TABLE [table.with.multiple.periods] ( id INT NOT NULL, [description] varchar(20) NOT NULL, CONSTRAINT PK_table_with_multiple_periods PRIMARY KEY (id) ) GO --DROP TABLE HasPrincipalKeyTestChild; DROP TABLE HasPrincipalKeyTestParent CREATE TABLE HasPrincipalKeyTestParent ( Id INT IDENTITY(1,1) NOT NULL, AA INT NOT NULL, BB INT NOT NULL, CC INT NULL, DD INT NULL, CONSTRAINT PK_HasPrincipalKeyTestParent PRIMARY KEY (Id) ); GO CREATE TABLE HasPrincipalKeyTestChild ( Id INT IDENTITY(1,1) NOT NULL, A INT NOT NULL, B INT NOT NULL, C INT NULL, D INT NULL, CONSTRAINT PK_HasPrincipalKeyTestChild PRIMARY KEY (Id) ); GO ALTER TABLE HasPrincipalKeyTestParent ADD CONSTRAINT [UQ_HasPrincipalKeyTestParent_AB] UNIQUE NONCLUSTERED (AA, BB); ALTER TABLE HasPrincipalKeyTestParent ADD CONSTRAINT [UQ_HasPrincipalKeyTestParent_CD] UNIQUE NONCLUSTERED (CC, DD); ALTER TABLE HasPrincipalKeyTestParent ADD CONSTRAINT [UQ_HasPrincipalKeyTestParent_AC] UNIQUE NONCLUSTERED (AA, CC); GO ALTER TABLE HasPrincipalKeyTestChild WITH CHECK ADD CONSTRAINT [FK_HasPrincipalKey_AB] FOREIGN KEY(A, B) REFERENCES HasPrincipalKeyTestParent (AA, BB); ALTER TABLE HasPrincipalKeyTestChild WITH CHECK ADD CONSTRAINT [FK_HasPrincipalKey_CD] FOREIGN KEY(C, D) REFERENCES HasPrincipalKeyTestParent (CC, DD); ALTER TABLE HasPrincipalKeyTestChild WITH CHECK ADD CONSTRAINT [FK_HasPrincipalKey_AC] FOREIGN KEY(A, C) REFERENCES HasPrincipalKeyTestParent (AA, CC); GO CREATE SCHEMA FFRS GO CREATE TABLE [FFRS].[CV]( [BatchUID] [uniqueidentifier] NOT NULL, [CVID] [int] NOT NULL, [CVName] [nvarchar](200) NULL ) ON [PRIMARY] GO CREATE PROC FFRS.cv_data(@maxId INT) AS SELECT BatchUID, CVID, CVName FROM FFRS.CV WHERE CVID < @maxId GO CREATE PROC FFRS.data_from_dbo AS SELECT Id, PrimaryColourId, CarMake FROM Car GO CREATE PROC FFRS.data_from_dbo_and_ffrs AS SELECT Id, PrimaryColourId, CarMake, CVName FROM Car JOIN FFRS.CV ON Id = CVID GO CREATE PROC dbo.dbo_proc_data_from_ffrs(@maxId INT) AS SELECT BatchUID, CVID, CVName FROM FFRS.CV WHERE CVID < @maxId GO CREATE PROC dbo.dbo_proc_data_from_ffrs_and_dbo AS SELECT Id, PrimaryColourId, CarMake, CVName FROM Car JOIN FFRS.CV ON Id = CVID GO CREATE FUNCTION [FFRS].[CsvToInt2] ( @array varchar(8000), @array2 varchar(8000) = '' ) RETURNS @IntTable TABLE(IntValue int) AS BEGIN DECLARE @seperator char(1) SET @seperator = ',' DECLARE @seperator_position int DECLARE @array_value varchar(8000) SET @array = @array + @seperator WHILE PATINDEX('%,%', @array) <> 0 BEGIN SELECT @seperator_position = PATINDEX('%,%', @array) SELECT @array_value = LEFT(@array, @seperator_position - 1) INSERT @IntTable VALUES (CAST(@array_value AS int)) SELECT @array = STUFF(@array, 1, @seperator_position, '') IF LEN(@array) = 0 AND LEN(@array2) > 0 BEGIN SET @array = @array2 + ',' SET @array2 = '' END END RETURN END GO SELECT * FROM FFRS.CsvToInt2('123,456','') GO SELECT dbo.udfNetSale(10, 100, 0.1) AS [Value]; GO -- #183 Return Model for functions returning nullable CREATE FUNCTION [dbo].[182_test1] ( @test INT ) RETURNS TABLE AS RETURN ( SELECT Id, ISNULL([Description], '') AS [Description] FROM NoPrimaryKeys ) GO CREATE PROCEDURE [dbo].[182_test2] @Flag INT AS BEGIN SET NOCOUNT ON; IF @Flag = 1 BEGIN SELECT Id, [Description] AS DescriptionFlag1 FROM NoPrimaryKeys END SELECT Id, ISNULL([Description], '') AS [DescriptionNotNull] FROM NoPrimaryKeys SELECT Id, [Description] FROM NoPrimaryKeys END GO -- #711 Calculated Column Not Null CREATE TABLE CalculatedColumnNotNull ( ID INT IDENTITY(1, 1) NOT NULL, [Type] TINYINT NOT NULL, IsCalendar AS CONVERT(BIT, CASE WHEN [Type] BETWEEN 0 AND 7 THEN 1 ELSE 0 END) PERSISTED NOT NULL, IsUtilization AS CONVERT(BIT, CASE WHEN [Type] BETWEEN 8 AND 10 THEN 1 ELSE 0 END) PERSISTED NOT NULL, CONSTRAINT PK_CalculatedColumnNotNull PRIMARY KEY NONCLUSTERED (ID ASC) ); GO -- Stored procedures resolving to the same name -- DROP PROC resolve_to_same_name /*CREATE PROC resolve_to_same_name AS BEGIN SELECT name, type, type_desc FROM sys.objects END GO -- DROP PROC Resolve_ToSameName CREATE PROC Resolve_ToSameName AS BEGIN SELECT name, type, type_desc FROM sys.objects END GO*/ -- #670 Table name issue CREATE TABLE Task ( TaskId BIGINT NOT NULL CONSTRAINT PK_Task PRIMARY KEY CLUSTERED (TaskId ASC) ); GO -- #614 CREATE TABLE Burak2 ( id BIGINT IDENTITY(1, 1) NOT NULL, num BIGINT NOT NULL, CONSTRAINT PK_Burak2 PRIMARY KEY CLUSTERED (id ASC), CONSTRAINT U_Burak2 UNIQUE NONCLUSTERED (id ASC, num ASC) ); GO CREATE TABLE Burak1 ( id BIGINT IDENTITY(1, 1) NOT NULL, id_t BIGINT NOT NULL, num BIGINT NOT NULL, CONSTRAINT PK_Burak1 PRIMARY KEY CLUSTERED (id ASC) ); GO ALTER TABLE Burak1 WITH CHECK ADD CONSTRAINT FK_Burak_Test1 FOREIGN KEY (id_t, num) REFERENCES Burak2 (id, num); ALTER TABLE Burak1 WITH CHECK ADD CONSTRAINT FK_Burak_Test2 FOREIGN KEY (id, num) REFERENCES Burak2 (id, num); ALTER TABLE Burak1 CHECK CONSTRAINT FK_Burak_Test1; ALTER TABLE Burak1 CHECK CONSTRAINT FK_Burak_Test1; GO -- #714 Self-referencing tables. Thanks to afust003 -- DROP TABLE TableA CREATE TABLE TableA ( TableAId INT IDENTITY(1, 1) NOT NULL, TableADesc VARCHAR(20) NULL, CONSTRAINT TableA_pkey PRIMARY KEY (TableAId ASC) ); GO -- DROP TABLE TableB CREATE TABLE TableB ( TableBId INT IDENTITY(1, 1) NOT NULL, TableAId INT NOT NULL, ParentTableAId INT NULL, TableBDesc VARCHAR(20) NULL, CONSTRAINT TableB_pkey PRIMARY KEY (TableBId, TableAId), CONSTRAINT FK_TableA_CompositeKey_Req FOREIGN KEY (TableAId) REFERENCES TableA (TableAId), CONSTRAINT ParentTableB_Hierarchy FOREIGN KEY (TableAId, TableBId) REFERENCES TableB ); GO CREATE INDEX fki_ParentTableA_FK_Constraint ON TableB (TableAId); GO -- #453 datetimeoffset type SQL default function getdate() does not translate CREATE TABLE [dbo].[DateTimeDefaultTest]( [Id] [int] NOT NULL, [CreatedDate] [datetimeoffset](7) NULL ) GO ALTER TABLE [dbo].[DateTimeDefaultTest] ADD CONSTRAINT [DF_DateTimeDefaultTest_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate] GO -- #329 Async SPROCs with output parameters. Thanks to ymerej. CREATE PROCEDURE dbo.InsertRecord @Data VARCHAR(256), @InsertedId INT OUT AS BEGIN INSERT INTO TableA (TableADesc) VALUES (@Data) SET @InsertedId = SCOPE_IDENTITY(); END; GO -- drop PROCEDURE dbo.InsertRecordTwo CREATE PROCEDURE dbo.InsertRecordTwo @Data VARCHAR(256), @InsertedId INT OUT, @AnotherInsertedId INT OUT AS BEGIN INSERT INTO TableA (TableADesc) VALUES (@Data) SET @InsertedId = SCOPE_IDENTITY(); SET @AnotherInsertedId = @InsertedId + 1; END; GO CREATE PROCEDURE dbo.InsertRecordThree @Data VARCHAR(256), @InsertedId INT OUT, @SomeId INT, @AnotherInsertedId INT OUT AS BEGIN INSERT INTO TableA (TableADesc) VALUES (@Data) SET @InsertedId = SCOPE_IDENTITY(); SET @AnotherInsertedId = @InsertedId + 1; END; GO -- #364 Generate foreign keys: FK against a unique index CREATE TABLE dbo.CODE_MeetingTopicDetails ( id INT IDENTITY(1, 1) NOT NULL, id_reuniao INT NOT NULL, ord_trab INT NULL, assunto NVARCHAR(250) NULL, desenvolvimento NVARCHAR(MAX) NULL, origem NVARCHAR(5) NULL, id_origem INT NULL, Estado INT NULL, CompanyID INT NOT NULL, DateCreated DATETIME NOT NULL, DateChanged DATETIME NULL, CONSTRAINT PK_CODE_MeetingTopicDetails PRIMARY KEY CLUSTERED (id ASC) ); GO CREATE TABLE dbo.CODE_PARAM_MeetingTopicDetailSource ( ID INT IDENTITY(1, 1) NOT NULL, Code NVARCHAR(5) NOT NULL, Label NVARCHAR(50) NULL, LabelENG NVARCHAR(50) NULL, LabelESP NVARCHAR(50) NULL, LabelFRA NVARCHAR(50) NULL, DateCreated DATETIME NOT NULL, DateChanged DATETIME NULL, CONSTRAINT PK_CODE_PARAM_MeetingTopicDetailSource PRIMARY KEY CLUSTERED (ID ASC), CONSTRAINT UK_CODE_PARAM_MeetingTopicDetailSource UNIQUE NONCLUSTERED (Code ASC) ); GO ALTER TABLE [dbo].[CODE_MeetingTopicDetails] WITH CHECK ADD CONSTRAINT [FK_CODE_MeetingTopicDetails_CODE_PARAM_MeetingTopicDetailSource] FOREIGN KEY([origem]) REFERENCES [dbo].[CODE_PARAM_MeetingTopicDetailSource] ([Code]) GO ALTER TABLE [dbo].[CODE_MeetingTopicDetails] CHECK CONSTRAINT [FK_CODE_MeetingTopicDetails_CODE_PARAM_MeetingTopicDetailSource] GO -- From Unders0n. Case #161 CREATE TABLE [dbo].[Бренды товара]( [Код бренда] [int] IDENTITY(1,1) NOT NULL, [Наименование бренда] [varchar](50) NOT NULL, [Логотип_бренда] [image] NULL, [Логотип_бренда_вертикальный] [image] NULL, CONSTRAINT [PK_Бренды] PRIMARY KEY CLUSTERED ( [Код бренда] ASC ) ) GO -- #571 Stored procs returning spatial types not being mapped correctly -- DROP PROCEDURE dbo.SpatialTypesWithParams -- DROP PROCEDURE dbo.SpatialTypesNoParams CREATE PROCEDURE dbo.SpatialTypesWithParams (@geometry GEOMETRY, @geography GEOGRAPHY) AS SELECT [$] AS Dollar, GeographyType, GeometryType FROM ColumnNameAndTypes; GO CREATE PROCEDURE dbo.SpatialTypesNoParams AS SELECT [$] AS Dollar, someDate, GeographyType, GeometryType FROM ColumnNameAndTypes; GO -- From 0v3rCl0ck. Case 180 CREATE SCHEMA Alpha; GO CREATE SCHEMA Beta; GO CREATE SCHEMA Omega; GO CREATE PROCEDURE Alpha.Overclock (@Parameter DATETIME) AS BEGIN RETURN 0 END; GO CREATE PROCEDURE Beta.Overclock (@Parameter DATETIME) AS BEGIN RETURN 0 END; GO CREATE PROCEDURE Omega.Overclock (@Parameter DATETIME) AS BEGIN RETURN 0 END; GO CREATE TABLE Alpha.Test ( Id INT NULL, ExclusionTest INT NULL -- Try and exclude this one column, and not the others below ) CREATE TABLE Beta.Test ( Id INT NULL, ExclusionTest INT NULL ) CREATE TABLE Omega.Test ( Id INT NULL, ExclusionTest INT NULL ) CREATE TABLE dbo.Test ( Id INT NULL, ExclusionTest INT NULL ) GO -- Harish3485. Duplicate foreign key names "in different schemas" cause problems -- Running transformation: Failed to read database schema - Object reference not set to an instance of an object. --DROP TABLE Beta.Harish3485 --DROP TABLE Alpha.Harish3485 CREATE TABLE Alpha.Harish3485 ( id int NOT NULL IDENTITY(1,1), harish_id INT NOT NULL ) GO CREATE TABLE Beta.Harish3485 ( id int NOT NULL IDENTITY(1,1), another_id INT NOT NULL ) GO ALTER TABLE [Alpha].[Harish3485] ADD CONSTRAINT [PK_Alpha_Harish3485] PRIMARY KEY CLUSTERED ([id]) ON [PRIMARY]; ALTER TABLE [Beta].[Harish3485] ADD CONSTRAINT [PK_Beta_Harish3485] PRIMARY KEY CLUSTERED ([id]) ON [PRIMARY]; GO -- vvvvvvvvvvv same name vvvvvv different column names ALTER TABLE Alpha.Harish3485 WITH CHECK ADD CONSTRAINT [FK_Harish] FOREIGN KEY(harish_id) REFERENCES FkTest.SmallDecimalTestAttribute (FkID) ALTER TABLE Beta.Harish3485 WITH CHECK ADD CONSTRAINT [FK_Harish] FOREIGN KEY(another_id) REFERENCES PropertyTypesToAdd (id) GO -- #309 Two tables having one property with the same name and their relationship is related to the same table. Model generation issue. Thanks to fxvits. SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Country]( [CountryID] [int] IDENTITY(1,1) NOT NULL, [Code] [varchar](12) NULL, CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED ( [CountryID] ASC )) ON [PRIMARY] GO CREATE TABLE [dbo].[Attendee]( [AttendeeID] [bigint] NOT NULL, [Lastname] [nvarchar](50) NOT NULL, [Firstname] [nvarchar](50) NOT NULL, [PhoneCountryID] [int] NULL, CONSTRAINT [PK_Attendee] PRIMARY KEY CLUSTERED ( [AttendeeID] 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 CREATE TABLE [dbo].[User309]( [UserID] [bigint] NOT NULL, [Lastname] [nvarchar](100) NOT NULL, [Firstname] [nvarchar](100) NOT NULL, [PhoneCountryID] [int] NULL, CONSTRAINT [PK_User309] PRIMARY KEY CLUSTERED ( [UserID] 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 SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[Attendee] WITH CHECK ADD CONSTRAINT [FK_Attendee_PhoneCountry] FOREIGN KEY([PhoneCountryID]) REFERENCES [dbo].[Country] ([CountryID]) ALTER TABLE [dbo].[User309] WITH CHECK ADD CONSTRAINT [FK_User309_PhoneCountry] FOREIGN KEY([PhoneCountryID]) REFERENCES [dbo].[Country] ([CountryID]) ALTER TABLE [dbo].[Attendee] CHECK CONSTRAINT [FK_Attendee_PhoneCountry] ALTER TABLE [dbo].[User309] CHECK CONSTRAINT [FK_User309_PhoneCountry] GO -- #312 One to one association missing relationship fluent API or data annotation. Thanks to Chris3773 --DROP TABLE Foo --DROP TABLE Boo /*CREATE TABLE [dbo].[Boo]( [id] [int] IDENTITY(1,1) NOT NULL, [name] [nchar](10) NOT NULL, CONSTRAINT [PK_Boo] PRIMARY KEY CLUSTERED ([id] ASC) ) CREATE TABLE [dbo].[Foo]( [id] [int] NOT NULL, [name] [nchar](10) NOT NULL, CONSTRAINT [PK_Foo] PRIMARY KEY CLUSTERED ([id] ASC) ) GO ALTER TABLE [dbo].[Foo] WITH CHECK ADD CONSTRAINT [FK_Foo_Boo] FOREIGN KEY([id]) REFERENCES [dbo].[Boo] ([id]) ALTER TABLE [dbo].[Foo] CHECK CONSTRAINT [FK_Foo_Boo] GO */ -- #363 Foreign keys with NOCHECK cause compile problems -- 0xced Shouldn't we completely drop the IsNotEnforced setting and use only the nullable information? -- If a foreign key constraint is not enforced, the generator produces a model which is not valid for Entity -- Framework and throws. It can even generate code that does not even compile with a combination of HasOptional + WithOptional. --drop table ForeignKeyIsNotEnforcedItem --drop table ForeignKeyIsNotEnforced CREATE TABLE ForeignKeyIsNotEnforced ( id int NOT NULL IDENTITY(1,1), null_value INT NULL, not_null_value INT NOT NULL, CONSTRAINT PK_ForeignKeyIsNotEnforced PRIMARY KEY (id) ); GO CREATE TABLE ForeignKeyIsNotEnforcedItem ( id int NOT NULL IDENTITY(1,1), null_value INT NULL, not_null_value INT NOT NULL, CONSTRAINT PK_ForeignKeyIsNotEnforcedItem PRIMARY KEY (id) ); GO ALTER TABLE ForeignKeyIsNotEnforced ADD CONSTRAINT [UQ_ForeignKeyIsNotEnforced_null_value] UNIQUE NONCLUSTERED (null_value); ALTER TABLE ForeignKeyIsNotEnforced ADD CONSTRAINT [UQ_ForeignKeyIsNotEnforced_not_null_value] UNIQUE NONCLUSTERED (not_null_value); ALTER TABLE ForeignKeyIsNotEnforcedItem ADD CONSTRAINT [UQ_ForeignKeyIsNotEnforcedItem_null_value] UNIQUE NONCLUSTERED (null_value); ALTER TABLE ForeignKeyIsNotEnforcedItem ADD CONSTRAINT [UQ_ForeignKeyIsNotEnforcedItem_not_null_value] UNIQUE NONCLUSTERED (not_null_value); GO ALTER TABLE ForeignKeyIsNotEnforcedItem WITH NOCHECK ADD CONSTRAINT [FK_ForeignKeyIsNotEnforcedItem_null_null] FOREIGN KEY(null_value) REFERENCES ForeignKeyIsNotEnforced (null_value); ALTER TABLE ForeignKeyIsNotEnforcedItem WITH NOCHECK ADD CONSTRAINT [FK_ForeignKeyIsNotEnforcedItem_null_notnull] FOREIGN KEY(null_value) REFERENCES ForeignKeyIsNotEnforced (not_null_value); ALTER TABLE ForeignKeyIsNotEnforcedItem WITH NOCHECK ADD CONSTRAINT [FK_ForeignKeyIsNotEnforcedItem_notnull_null] FOREIGN KEY(not_null_value) REFERENCES ForeignKeyIsNotEnforced (null_value); ALTER TABLE ForeignKeyIsNotEnforcedItem WITH NOCHECK ADD CONSTRAINT [FK_ForeignKeyIsNotEnforcedItem_notnull_notnull] FOREIGN KEY(not_null_value) REFERENCES ForeignKeyIsNotEnforced (not_null_value); GO -- DELETE from ForeignKeyIsNotEnforced -- DELETE FROM ForeignKeyIsNotEnforcedItem INSERT INTO ForeignKeyIsNotEnforced (null_value, not_null_value) VALUES (222, 222) INSERT INTO ForeignKeyIsNotEnforced (null_value, not_null_value) VALUES (333, 333) INSERT INTO ForeignKeyIsNotEnforced (null_value, not_null_value) VALUES (NULL,444) INSERT INTO ForeignKeyIsNotEnforcedItem (null_value, not_null_value) VALUES (NULL,222) INSERT INTO ForeignKeyIsNotEnforcedItem (null_value, not_null_value) VALUES (333, 333) -- INSERT INTO ForeignKeyIsNotEnforcedItem (null_value, not_null_value) VALUES (NULL, 444) -- Violation of UNIQUE KEY constraint 'UQ_ForeignKeyIsNotEnforcedItem_null_value'. Cannot insert duplicate key in object 'dbo.ForeignKeyIsNotEnforcedItem'. The duplicate key value is (<NULL>). SELECT * FROM ForeignKeyIsNotEnforced SELECT * FROM ForeignKeyIsNotEnforcedItem GO -- Case 32. From android8. CREATE SCHEMA App GO CREATE TABLE App.UserFacilityServiceRole ( userId INT NOT NULL, appId INT NOT NULL, fsrId INT NOT NULL ) GO CREATE PROCEDURE [App].[usp_CMTUserFSRUpdate] @userId INT, @fsrId INT, @ufsrId INT OUT AS SET NOCOUNT ON DECLARE @appId INT SET @appId = 2 INSERT [UserFacilityServiceRole] SELECT @userId, @appId, @fsrId SELECT @ufsrId = @@IDENTITY GO -- from dyardyGIT -- DROP TABLE Beta.workflow -- DROP TABLE Beta.ToAlpha -- DROP TABLE Alpha.workflow CREATE TABLE Alpha.workflow ( [Id] INT NOT NULL IDENTITY(1, 1), [Description] VARCHAR(10) NULL, CONSTRAINT PK_alpha_workflow PRIMARY KEY (Id) ); GO CREATE TABLE Beta.workflow ( [Id] INT NOT NULL IDENTITY(1, 1), [Description] VARCHAR(10) NULL CONSTRAINT PK_beta_workflow PRIMARY KEY (Id) ); GO -- m woffenden - filter out schema, but FK's are not filtered out. CREATE TABLE Beta.ToAlpha ( [Id] INT NOT NULL IDENTITY(1, 1), AlphaId INT NOT NULL, CONSTRAINT PK_beta_ToAlpha PRIMARY KEY (Id) ); GO ALTER TABLE Beta.ToAlpha ADD CONSTRAINT BetaToAlpha_AlphaWorkflow FOREIGN KEY (AlphaId) REFERENCES [Alpha].[Workflow] ([Id]) GO -- #632 Can't map view with recursive join CREATE SCHEMA WVN GO CREATE TABLE WVN.Articles ( PK_Article INT IDENTITY(1, 1) NOT NULL, FK_Factory UNIQUEIDENTIFIER NOT NULL, FK_ArticleLevel INT NOT NULL, FK_ParentArticle INT NULL, Code NVARCHAR(20) NOT NULL CONSTRAINT PK_Articles PRIMARY KEY CLUSTERED (PK_Article ASC), CONSTRAINT UK_Articles UNIQUE NONCLUSTERED (FK_Factory ASC, FK_ArticleLevel ASC, Code ASC) ); GO CREATE VIEW WVN.v_Articles AS WITH TabRecursive AS ( SELECT ItemP.PK_Article, ItemP.FK_Factory, ItemP.FK_ArticleLevel, ItemP.FK_ParentArticle, ItemP.Code, CONVERT(NVARCHAR(100), ItemP.Code) AS FullCode FROM WVN.Articles ItemP WHERE ItemP.FK_ParentArticle IS NULL UNION ALL SELECT Item.PK_Article, Item.FK_Factory, Item.FK_ArticleLevel, Item.FK_ParentArticle, Item.Code, CONVERT(NVARCHAR(100), CONCAT(Parent.FullCode, '/', Item.Code)) AS FullCode FROM WVN.Articles Item INNER JOIN TabRecursive Parent ON Parent.PK_Article = Item.FK_ParentArticle ) SELECT T.PK_Article, T.FK_Factory, T.FK_ArticleLevel, T.FK_ParentArticle, T.Code, T.FullCode FROM TabRecursive T; GO -- #93 TadeuszSobol -- DROP TABLE TadeuszSobol CREATE TABLE TadeuszSobol ( [Id] int NOT NULL IDENTITY(1,1), [Description] VARCHAR(MAX) NULL, [Notes] NVARCHAR(MAX) NULL, [Name] VARCHAR(10) NULL, CONSTRAINT PK_TadeuszSobol PRIMARY KEY (Id) ) GO -- #68 Support for Synonyms (TimSirmovics) CREATE SYNONYM alpha_workflow_synonym FOR Alpha.workflow GO INSERT INTO alpha_workflow_synonym ([description]) VALUES('Hello') GO CREATE SYNONYM cross_database_synonym FOR EfrpgTest_Synonyms.dbo.UserInfo GO INSERT INTO cross_database_synonym (Forename) VALUES ('Ruprecht'); GO -- #186 Incorrect pluralization of reverse navigation property name CREATE SCHEMA OneEightSix GO CREATE TABLE OneEightSix.UploadedFile ( Id int identity(1, 1) not null, FullPath nvarchar(max) not null, constraint PK_UploadedFile primary key clustered(Id) ) GO create table OneEightSix.Issue ( Id int identity(1, 1) not null, Title nvarchar(100) not null, Content nvarchar(max) null, constraint PK_Issue primary key clustered(Id) ) GO create table OneEightSix.IssueUploadedFile ( UploadedFileId int not null, IssueId int not null, constraint PK_IssueUploadedFile primary key clustered(UploadedFileId, IssueId), constraint FK_IssueUploadedFile_UploadedFile foreign key (UploadedFileId) references OneEightSix.UploadedFile(Id), constraint FK_IssueUploadedFile_Issue foreign key (IssueId) references OneEightSix.Issue(Id), ) GO -- Reverse engineer above and put into araxis, then run this, and reverse engineer again and compare with Araxis alter table OneEightSix.Issue add ConsentDocumentId int null alter table OneEightSix.Issue add constraint FK_Issue_UploadedFileConsentDocument foreign key(ConsentDocumentId) references OneEightSix.UploadedFile(Id) GO -- #47 v2.19.3 issue with many to many generation CREATE SCHEMA Issue47 GO --DROP TABLE Issue47.UserRoles --DROP TABLE Issue47.[Role] --DROP TABLE Issue47.Users CREATE TABLE Issue47.Users ( UserId INT NOT NULL IDENTITY(1, 1), Name VARCHAR(10) NULL, CONSTRAINT PK_Issue47_Users PRIMARY KEY (UserId) ); GO CREATE TABLE Issue47.[Role] ( RoleId INT NOT NULL IDENTITY(1, 1), [Role] VARCHAR(10) NULL, CONSTRAINT PK_Issue47_Role PRIMARY KEY (RoleId) ); GO CREATE TABLE Issue47.UserRoles ( UserRoleId INT NOT NULL IDENTITY(1, 1), UserId INT NOT NULL, RoleId INT NOT NULL, CONSTRAINT PK_Issue47_UserRoles PRIMARY KEY (UserRoleId) ); GO ALTER TABLE Issue47.UserRoles ADD CONSTRAINT Issue47_UserRoles_userid FOREIGN KEY (UserId) REFERENCES Issue47.Users (UserId) ALTER TABLE Issue47.UserRoles ADD CONSTRAINT Issue47_UserRoles_roleid FOREIGN KEY (RoleId) REFERENCES Issue47.[Role] (RoleId) GO -- #78 Default values for column mapped to enums fail -- DROP TABLE EnumWithDefaultValue CREATE TABLE EnumWithDefaultValue ( [Id] INT NOT NULL IDENTITY(1, 1), SomeEnum INT NOT NULL DEFAULT (1), CONSTRAINT PK_EnumWithDefaultValue PRIMARY KEY (Id) ); GO -- From mhwlng -- user defined table types for stored procedures CREATE TYPE UserDefinedTypeSample AS TABLE ( sensorid INT, utctimestamp DATETIME, value FLOAT ); GO CREATE PROCEDURE UserDefinedTypeSampleStoredProc (@a INT, @type UserDefinedTypeSample READONLY, @b INT) AS BEGIN -- todo RETURN (0) END GO -- #173 ReturnModel is not generated for stored proc if xml.modify is used CREATE procedure dbo.XmlDataV1 as declare @temp table ([SomeXML] [xml]) insert into @temp values('<root></root>') declare @someXml xml select top 1 @someXml = [SomeXML] from @temp --explicit assignment. when this is line commented out, ReversePoco generates incorrect output type (int) for this stored proc set @someXml = '<root></root>'; set @someXml.modify('insert <new>node</new> into (/root)[1]'); SELECT getdate(), @someXml GO CREATE procedure dbo.XmlDataV2 as declare @temp table ([SomeXML] [xml]) insert into @temp values('<root></root>') declare @someXml xml select top 1 @someXml = [SomeXML] from @temp --explicit assignment. when this is line commented out, ReversePoco generates incorrect output type (int) for this stored proc --set @someXml = '<root></root>'; set @someXml.modify('insert <new>node</new> into (/root)[1]'); SELECT getdate(), @someXml GO -- EXEC dbo.XmlDataV1; EXEC dbo.XmlDataV2; -- SET FMTONLY OFF; SET FMTONLY ON; exec dbo.XmlDataV1; SET FMTONLY OFF; SET FMTONLY OFF; -- SET FMTONLY OFF; SET FMTONLY ON; exec dbo.XmlDataV2; SET FMTONLY OFF; SET FMTONLY OFF; -- Case 156: Should get null instead of "NULL" for varchar DEFAULT NULL -- DROP TABLE [DefaultCheckForNull] CREATE TABLE [dbo].[DefaultCheckForNull] ( [Id] int NOT NULL IDENTITY(1,1), [DescUppercase] varchar(5) NULL DEFAULT NULL, [DescLowercase] varchar(5) NULL DEFAULT null, [DescMixedCase] varchar(5) NULL DEFAULT Null, [DescBrackets] varchar(5) NULL DEFAULT (((NULL))), [X1] varchar(255) NULL, CONSTRAINT PK_DefaultCheckForNull PRIMARY KEY (Id) ) GO -- From pinger. Reserved words in stored procs CREATE PROC dbo.StupidStoredProcedureParams(@ReqType varchar(25),@Dept smallint,@Class smallint,@Item SMALLINT) AS BEGIN RETURN 0 END GO -- JasonMur Reserved words in stored procs CREATE PROC dbo.StupidStoredProcedureParams2(@override varchar(25),@readonly smallint,@class smallint,@enum SMALLINT) AS BEGIN RETURN 0 END GO -- From Bitfiddler. tables with ALLCAPS that end in ies get messed up --DROP TABLE BITFIDDLERALLCAPS --DROP TABLE BitFiddlerCURRENCIES --DROP TABLE BitFiddlerCATEGORIES CREATE TABLE BitFiddlerCATEGORIES ( [Id] INT NOT NULL IDENTITY(1, 1), CONSTRAINT PK_BitFiddlerCATEGORIES PRIMARY KEY (Id) ); GO CREATE TABLE BitFiddlerCURRENCIES ( [Id] INT NOT NULL IDENTITY(1, 1), CONSTRAINT PK_BitFiddlerCURRENCIES PRIMARY KEY (Id) ); GO CREATE TABLE BITFIDDLERALLCAPS ( [Id] INT NOT NULL IDENTITY(1, 1), CONSTRAINT PK_BITFIDDLERALLCAPS PRIMARY KEY (Id) ); GO -- <NAME> -- DROP TABLE Ticket -- DROP TABLE AppUser CREATE TABLE [dbo].[AppUser] ( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, CONSTRAINT PK_AppUser PRIMARY KEY (Id) ) GO CREATE TABLE [dbo].[Ticket] ( [Id] BIGINT IDENTITY(1, 1) NOT NULL, [CreatedById] BIGINT NOT NULL, [ModifiedById] BIGINT NULL, CONSTRAINT [PK_Ticket] PRIMARY KEY CLUSTERED ([Id] ASC), CONSTRAINT [FK_Ticket_AppUser] FOREIGN KEY ([CreatedById]) REFERENCES [dbo].[AppUser] ([Id]), CONSTRAINT [FK_Ticket_AppUser1] FOREIGN KEY ([ModifiedById]) REFERENCES [dbo].[AppUser] ([Id]) ); GO /* When generating this the Ticket POCO will get navigators as public virtual AppUser AppUser_CreatedById { get; set; } // FK_Ticket_AppUser public virtual AppUser AppUser_ModifiedById { get; set; } // FK_Ticket_AppUser1 I want these to be named as public virtual AppUser CreatedBy { get; set; } // FK_Ticket_AppUser public virtual AppUser ModifiedBy { get; set; } // FK_Ticket_AppUser1 */ -- From Silverfox -- DROP TABLE Token CREATE TABLE Token ( Id UNIQUEIDENTIFIER NOT NULL DEFAULT (newsequentialid()) ROWGUIDCOL, Enabled bit NOT NULL, CONSTRAINT PK_Token PRIMARY KEY (Id) ) GO INSERT INTO Token (Enabled) VALUES(1) GO ALTER DATABASE [EfrpgTest] SET ANSI_PADDING ON; GO -- FROM David_Poco --DROP TABLE CarToColour --drop TABLE Car --DROP TABLE Colour CREATE TABLE Car ( Id INT NOT NULL, PrimaryColourId INT NOT NULL, CarMake VARCHAR(255) NOT NULL, CONSTRAINT PK_Car PRIMARY KEY (Id) ) GO SET ANSI_PADDING ON GO ALTER TABLE Car ADD computed_column AS PrimaryColourId * 10, computed_column_persisted AS PrimaryColourId * 10 PERSISTED NOT NULL GO CREATE TABLE Colour ( Id INT NOT NULL, Name VARCHAR(255) NOT NULL, CONSTRAINT PK_Colour PRIMARY KEY (Id) ) GO CREATE TABLE CarToColour ( CarId INT NOT NULL, ColourId INT NOT NULL, CONSTRAINT PK_CarToColour PRIMARY KEY (CarId, ColourId) ) GO ALTER TABLE Car ADD CONSTRAINT CarPrimaryColourFK FOREIGN KEY (PrimaryColourId) REFERENCES Colour (Id); ALTER TABLE CarToColour ADD CONSTRAINT CarToColour_CarId FOREIGN KEY (CarId) REFERENCES Car (Id); ALTER TABLE CarToColour ADD CONSTRAINT CarToColour_ColourId FOREIGN KEY (ColourId) REFERENCES Colour (Id); GO INSERT INTO Colour (Id, Name) VALUES (1, 'Red'),(2,'Green'),(3,'Blue') INSERT INTO Car (Id, PrimaryColourId, CarMake) VALUES (1, 1, 'Ford'),(2,3, 'Saab') INSERT INTO CarToColour (CarId, ColourId) VALUES (1,2),(2,1),(2,2) GO -- drop table MultipleKeys CREATE TABLE MultipleKeys ( UserId INT NOT NULL, FavouriteColourId INT NOT NULL CONSTRAINT UC_MultipleKeys_FavouriteColour UNIQUE, BestHolidayTypeId INT NOT NULL, BankId INT NOT NULL, CarId INT NOT NULL ) GO ALTER TABLE MultipleKeys ADD CONSTRAINT PK_MultipleKeys PRIMARY KEY CLUSTERED (UserId, FavouriteColourId, BestHolidayTypeId) CREATE UNIQUE INDEX IX_MultipleKeys_Holiday_Bank ON MultipleKeys(BestHolidayTypeId, BankId) CREATE INDEX IX_MultipleKeys_BestHolidayType ON MultipleKeys(BestHolidayTypeId) GO -- DROP TABLE DSOpe CREATE TABLE DSOpe ( ID INT NOT NULL, [decimal_default] decimal(15, 2) NOT NULL, MyGuid UNIQUEIDENTIFIER NOT NULL DEFAULT ('9B7E1F67-5A81-4277-BC7D-06A3262A5C70'), [default] VARCHAR(10) NULL, -- reserved keyword [MyGuidBadDefault] UNIQUEIDENTIFIER CONSTRAINT [DF_MyGuidBadDefaul] DEFAULT (NULL) NULL, CONSTRAINT PK_DSOpe PRIMARY KEY (Id) ) GO ALTER TABLE DSOpe ADD CONSTRAINT [DF_DSOpe_MaxRabat] DEFAULT ((99.99)) FOR [decimal_default] GO -- From <NAME> <<EMAIL>> CREATE PROCEDURE DSOpeProc AS BEGIN SET NOCOUNT ON; SELECT ID, CONVERT(BIT, CASE WHEN [default] IS NOT NULL THEN 1 ELSE 0 END) AS Selected FROM DSOpe; END; --DROP TABLE tblOrderErrorsAB_ --DROP TABLE AB_OrderLinesAB_ --DROP TABLE AB_OrdersAB_ --DROP TABLE tblOrderErrors --DROP TABLE tblOrderLines --DROP TABLE tblOrders CREATE TABLE tblOrders ( ID INT NOT NULL IDENTITY(1, 1), added DATETIME NOT NULL DEFAULT GETDATE(), CONSTRAINT PK_tblOrders PRIMARY KEY (Id) ); GO CREATE TABLE tblOrderLines ( ID INT NOT NULL IDENTITY(1, 1), OrderID INT NOT NULL, sku VARCHAR(15) NULL, CONSTRAINT PK_tblOrderLines PRIMARY KEY (Id) ); GO CREATE TABLE tblOrderErrors ( ID INT NOT NULL IDENTITY(1, 1), error VARCHAR(50) NULL, CONSTRAINT PK_tblOrderErrors PRIMARY KEY (Id) ); GO CREATE TABLE AB_OrdersAB_ ( ID INT NOT NULL IDENTITY(1, 1), added DATETIME NOT NULL DEFAULT GETDATE(), CONSTRAINT PK_AB_OrdersAB PRIMARY KEY (Id) ); GO CREATE TABLE AB_OrderLinesAB_ ( ID INT NOT NULL IDENTITY(1, 1), OrderID INT NOT NULL, sku VARCHAR(15) NULL, CONSTRAINT PK_AB_OrderLinesAB PRIMARY KEY (Id) ); GO CREATE TABLE tblOrderErrorsAB_ ( ID INT NOT NULL IDENTITY(1, 1), error VARCHAR(50) NULL, CONSTRAINT PK_tblOrderErrorsAB PRIMARY KEY (Id) ); GO ALTER TABLE tblOrderLines ADD CONSTRAINT tblOrdersFK FOREIGN KEY (OrderID) REFERENCES tblOrders (id); ALTER TABLE AB_OrderLinesAB_ ADD CONSTRAINT AB_OrderLinesAB_FK FOREIGN KEY (OrderID) REFERENCES AB_OrdersAB_ (id); GO -- Forign key with multiple fields --DROP TABLE footer; DROP TABLE header; CREATE TABLE header ( ID INT NOT NULL, anotherID INT NOT NULL, added DATETIME NOT NULL DEFAULT GETDATE(), CONSTRAINT PK_header PRIMARY KEY (ID, anotherID) ); GO CREATE TABLE footer ( ID INT NOT NULL IDENTITY(1, 1), otherID INT NOT NULL, added DATETIME NOT NULL DEFAULT GETDATE(), CONSTRAINT PK_footer PRIMARY KEY (Id) ); GO ALTER TABLE footer ADD CONSTRAINT fooderFK FOREIGN KEY (ID,otherID) REFERENCES header (ID,anotherID); GO INSERT INTO SmallDecimalTest (id, KoeffVed) VALUES (1, 0.1),(2, 0.2),(3, 0.3),(4, 0.4) INSERT INTO PropertyTypesToAdd (id, dt_default, dt7) VALUES(1, GETDATE(), GETDATE()), (2, GETDATE(), GETDATE()), (3, GETDATE(), GETDATE()) INSERT INTO FkTest.SmallDecimalTestAttribute (FkID,[description]) VALUES (1,'tattoo') INSERT INTO [FFRS].[CV] ([BatchUID], [CVID], [CVName]) VALUES (NEWID(),123, N'Hello world') INSERT INTO DSOpe (ID,decimal_default,[default]) VALUES (1,2,3) GO IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'dcg') EXEC sys.sp_executesql N'CREATE SCHEMA [dcg]' GO IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dcg].[rov_ColumnDefinitions]')) DROP VIEW [dcg].[rov_ColumnDefinitions] GO SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dcg].[rov_ColumnDefinitions] AS SELECT isc.*, o.TYPE FROM INFORMATION_SCHEMA.COLUMNS AS isc INNER JOIN sys.objects AS o ON SCHEMA_NAME(o.SCHEMA_ID) = isc.TABLE_SCHEMA AND o.NAME = isc.TABLE_NAME WHERE NOT isc.TABLE_SCHEMA IN ('dcg'); GO CREATE PROCEDURE GetSmallDecimalTest(@maxId INT) AS BEGIN SET NOCOUNT ON; IF(@maxId IS NULL) SET @maxId = 999 SELECT id, KoeffVed FROM SmallDecimalTest WHERE id <= @maxId END GO CREATE PROCEDURE AddTwoValues(@a INT, @b INT) AS BEGIN SET NOCOUNT ON; RETURN @a + @b -- 0 indicates success, anything else is a failure END GO CREATE PROCEDURE AddTwoValuesWithResult(@a INT, @b INT, @result INT OUTPUT, @result2 INT OUTPUT) AS BEGIN SET NOCOUNT ON; SET @result = @a + @b SET @result2 = @b - @a END GO CREATE PROCEDURE MinTripSequenceStart(@minTripSequenceStartParam DATETIME2 OUTPUT) AS BEGIN SET NOCOUNT ON; SET @minTripSequenceStartParam = GETDATE() END GO CREATE PROCEDURE MinTripSequenceStartNull(@minTripSequenceStartParam DATETIME2 OUTPUT) AS BEGIN SET NOCOUNT ON; SET @minTripSequenceStartParam = NULL END GO CREATE PROCEDURE ConvertToString(@someValue INT, @someString VARCHAR(20) OUTPUT) AS BEGIN SET NOCOUNT ON; SET @someString = '*' + CAST(@someValue AS VARCHAR(20)) + '*' END GO CREATE TABLE [dbo].[FinancialInstitutionOffice]( [Code] [uniqueidentifier] NOT NULL, [FinancialInstitutionCode] [uniqueidentifier] NOT NULL, [OfficeName] [nvarchar](200) NULL ) GO ALTER TABLE [dbo].[FinancialInstitutionOffice] ADD CONSTRAINT [UniqueOfficeName_FinancialInstitutionOffice] UNIQUE NONCLUSTERED ( [FinancialInstitutionCode] ASC, [OfficeName] ASC ) GO CREATE TABLE [dbo].[CodeObject]( [codeObjectNo] [int] NOT NULL CONSTRAINT [DF__Object__objectNo__7E6CC920] DEFAULT ((0)), [applicationNo] [int] NULL, [type] [int] NOT NULL, [eName] [nvarchar](250) NOT NULL, [aName] [nvarchar](250) NULL, [description] [nvarchar](250) NULL, [codeName] [nvarchar](250) NULL, [note] [nvarchar](250) NULL, [isObject] [bit] NOT NULL CONSTRAINT [DF__Object__isObject__7F60ED59] DEFAULT ((0)), [versionNumber] [timestamp] NULL, CONSTRAINT [aaaaaObject_PK] PRIMARY KEY NONCLUSTERED ( [codeObjectNo] 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 INSERT INTO CodeObject (codeObjectNo,applicationNo,type,eName,aName,description,codeName,note,isObject) VALUES (1,2,3,'fred','test','hello','some name','a note',0) GO EXEC sys.sp_addextendedproperty @name = N'MS_Description', @value = N'This is a test', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'CodeObject'; GO -- Table with sequences CREATE SEQUENCE dbo.CountBy1 AS INT START WITH 1 INCREMENT BY 1; CREATE SEQUENCE dbo.CountByBigInt AS BIGINT START WITH 22 INCREMENT BY 234 MINVALUE 1 MAXVALUE 9876543 CYCLE; CREATE SEQUENCE dbo.CountByTinyInt AS TINYINT START WITH 33 INCREMENT BY 3 NO MINVALUE NO CYCLE; CREATE SEQUENCE dbo.CountBySmallInt AS SMALLINT START WITH 44 INCREMENT BY 456 NO MAXVALUE CYCLE; CREATE SEQUENCE dbo.CountByDecimal AS DECIMAL START WITH 593 INCREMENT BY 82 MINVALUE 5 MAXVALUE 777777 CACHE 10; CREATE SEQUENCE dbo.CountByNumeric AS NUMERIC START WITH 789 INCREMENT BY 987 MINVALUE 345 NO MAXVALUE NO CACHE; -- DROP SEQUENCE dbo.CountBy1; DROP SEQUENCE dbo.CountByBigInt; DROP SEQUENCE dbo.CountByTinyInt; DROP SEQUENCE dbo.CountBySmallInt; DROP SEQUENCE dbo.CountByDecimal; DROP SEQUENCE dbo.CountByNumeric GO --SELECT NEXT VALUE FOR dbo.CountBy1; CREATE TABLE dbo.SequenceTest -- drop TABLE dbo.SequenceTest ( Id INT NOT NULL DEFAULT (NEXT VALUE FOR dbo.CountBy1), CntByBigInt BIGINT NOT NULL DEFAULT (NEXT VALUE FOR dbo.CountByBigInt), CntByTinyInt TINYINT NOT NULL DEFAULT (NEXT VALUE FOR dbo.CountByTinyInt), CntBySmallInt SMALLINT NOT NULL DEFAULT (NEXT VALUE FOR dbo.CountBySmallInt), CntByDecimal DECIMAL NOT NULL DEFAULT (NEXT VALUE FOR dbo.CountByDecimal), CntByNumeric NUMERIC NOT NULL DEFAULT (NEXT VALUE FOR dbo.CountByNumeric), CONSTRAINT PK_SequenceTest PRIMARY KEY CLUSTERED (Id) ); GO --DROP VIEW AllColumnsNull CREATE VIEW AllColumnsNull AS SELECT SUM(applicationNo) AS total, aName --ISNULL(aName, '') AS aName FROM CodeObject GROUP BY aName GO CREATE PROCEDURE aSimpleExample AS BEGIN SET NOCOUNT ON; declare @test table ( id int, [stuff] varchar(50) ) insert into @test (id, [stuff]) values (1, 'some stuff'), (2, 'more stuff') select 1 as id, 'even more' as [stuff] into #test select * from @test select * from #test DROP TABLE #test END GO CREATE PROCEDURE [dbo].[stp_test] ( @strDateFROM NVARCHAR(20), @strDateTo NVARCHAR(20), @retBool BIT OUTPUT ) AS DECLARE @intError INT SET @intError = 0 SET @retBool = 0 SELECT [codeObjectNo], [applicationNo], [type], [eName], [aName], [description], [codeName], [note], [isObject], [versionNumber] FROM [dbo].[CodeObject]; GO CREATE VIEW [dbo].[view with space] AS SELECT codeObjectNo, applicationNo, type, eName, aName, description, codeName, note, isObject, versionNumber FROM [dbo].[CodeObject]; GO CREATE TABLE [dbo].[table with space]( [id] [int] NOT NULL, CONSTRAINT PK_TableWithSpace PRIMARY KEY CLUSTERED ([id]) ) GO CREATE TABLE [dbo].[table with space and in columns]( [id value] [int] NOT NULL, CONSTRAINT PK_TableWithSpaceAndInColumns PRIMARY KEY CLUSTERED ([id value]) ) GO CREATE TABLE [dbo].[TableWithSpaceInColumnOnly]( [id value] [int] NOT NULL, CONSTRAINT PK_TableWithSpaceInColumnOnly PRIMARY KEY CLUSTERED ([id value]) ) GO CREATE TABLE [dbo].[table mapping with space]( [id] [int] NOT NULL, [id value] [int] NOT NULL, CONSTRAINT [PK_TableMappingWithSpace] PRIMARY KEY CLUSTERED ( [id],[id value] ) ) GO ALTER TABLE [dbo].[table mapping with space] ADD CONSTRAINT space1FK FOREIGN KEY (id) REFERENCES [dbo].[table with space] (id); ALTER TABLE [dbo].[table mapping with space] ADD CONSTRAINT space2FK FOREIGN KEY ([id value]) REFERENCES [dbo].[table with space and in columns] ([id value]); GO INSERT INTO [table with space] (id) VALUES (1) INSERT INTO [table with space and in columns] ([id value]) VALUES (2) INSERT INTO TableWithSpaceInColumnOnly ([id value]) VALUES (3) INSERT INTO [table mapping with space] (id, [id value]) VALUES (1,2) GO CREATE PROCEDURE [dbo].[stp_test_underscore_test] ( @str_Date_FROM NVARCHAR(20), @str_date_to NVARCHAR(20) ) AS BEGIN SELECT [codeObjectNo] AS code_object_no, [applicationNo] AS application_no FROM [dbo].[CodeObject]; END; GO CREATE PROCEDURE [dbo].[stp test space test] (@a_val INT, @b_val INT) AS SELECT [codeObjectNo] AS [code object no], [applicationNo] AS [application no] FROM [dbo].[CodeObject]; GO CREATE PROCEDURE [dbo].[stp_nullable_params_test] (@a_val INT, @b_val int NULL) AS BEGIN SELECT [codeObjectNo],[applicationNo] FROM [dbo].[CodeObject]; END GO CREATE PROCEDURE [dbo].[stp_no_params_test] AS BEGIN SELECT [codeObjectNo],[applicationNo] FROM [dbo].[CodeObject]; END GO CREATE PROCEDURE [dbo].[stp_no_return_fields] AS UPDATE [dbo].[CodeObject] SET type=4 WHERE codeObjectNo < 1000 GO CREATE PROCEDURE [dbo].[stp_multiple_results] AS BEGIN SELECT codeObjectNo, applicationNo, [type], eName, aName, [description], codeName, note, isObject, versionNumber FROM [dbo].[CodeObject]; SELECT Id, PrimaryColourId, CarMake, computed_column, computed_column_persisted FROM Car; SELECT Id,Name FROM Colour; END; GO CREATE PROCEDURE [dbo].[stp_multiple_identical_results] (@someVar INT) AS IF(@someVar > 5) BEGIN SELECT * FROM Colour; END ELSE BEGIN SELECT * FROM Colour; END GO CREATE PROCEDURE [dbo].[stp_multiple_results_with_params] (@first_val INT, @second_val int NULL) AS SELECT [codeObjectNo],[applicationNo] FROM [dbo].[CodeObject]; SELECT * FROM Colour; GO EXEC stp_multiple_results GO -- DROP PROC [dbo].[stp_multiple_multiple_results_with_params] CREATE PROCEDURE [dbo].[stp_multiple_multiple_results_with_params] (@first_val INT, @second_val int NULL, @third_val INT) AS SELECT [codeObjectNo],[applicationNo] FROM [dbo].[CodeObject]; SELECT * FROM Colour; SELECT * FROM BatchTest; SELECT * FROM Burak1; SELECT * FROM Car; SELECT * FROM AB_OrderLinesAB_; GO DECLARE @procResult int EXEC @procResult = [dbo].[stp_multiple_multiple_results_with_params] @first_val=1,@second_val=2,@third_val=3 PRINT @procResult GO -- DROP VIEW ComplexView CREATE VIEW dbo.ComplexView AS with cteLicenses as ( select sum(case when sp.type = 0 and sp.aName <> 'test' then cast(sp.applicationNo as int) else 0 end) as AccessWare , sum(case when sp.type = 4 then cast(sp.applicationNo as int) else 0 end) as AdvInventory , sum( cast(sp.applicationNo as int)) as Test from CodeObject sp where sp.isObject = 0 ) SELECT ISNULL(LicenseType, '') AS LicenseType, [Count] FROM cteLicenses UNPIVOT ( [Count] FOR LicenseType IN (AccessWare, Test) ) unpvt; GO /* SELECT * FROM ComplexView EXEC [dbo].[stp_test_underscore_test] '','' EXEC [dbo].[stp test space test] 0,0 EXEC [dbo].[stp_nullable_params_test] NULL,NULL */ DECLARE @proc_result INT EXEC @proc_result = GetSmallDecimalTest @maxId = 3 SELECT 'proc_result' = @proc_result GO DECLARE @proc_result int EXEC @proc_result = AddTwoValues @a = 2, @b = 6 SELECT @proc_result AS 'proc_result' GO DECLARE @proc_result int, @result INT, @result2 INT EXEC @proc_result = AddTwoValuesWithResult @a = 3, @b = 7, @result = @result OUTPUT, @result2 = @result2 OUTPUT SELECT @result as '@result', @result2 AS '@result2' SELECT @proc_result AS 'proc_result' GO DECLARE @proc_result INT DECLARE @result VARCHAR(50) EXEC @proc_result = ConvertToString @someValue = 56, @someString = @result OUTPUT SELECT @result as '@result' SELECT @proc_result AS 'proc_result' GO SELECT * FROM ColumnNameAndTypes SELECT * FROM SmallDecimalTest SELECT * FROM PropertyTypesToAdd SELECT * FROM FkTest.SmallDecimalTestAttribute SELECT * FROM DSOpe SELECT * FROM [FFRS].[CV] GO -- From Naveen CREATE TABLE [dbo].[CMS_File]( [FileId] [int] IDENTITY(1,1) NOT NULL, [FileName] [nvarchar](100) NOT NULL, [FileDescription] [varchar](500) NOT NULL, [FileIdentifier] [varchar](100) NOT NULL, [ValidStartDate] [datetime] NULL, [ValidEndDate] [datetime] NULL, [IsActive] [bit] NOT NULL, CONSTRAINT [PK_CMS_File] PRIMARY KEY CLUSTERED ( [FileId] 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 CREATE TABLE [dbo].[CMS_Tag]( [TagId] [int] IDENTITY(1,1) NOT NULL, [TagName] [varchar](100) NOT NULL, CONSTRAINT [PK_CMS_Tag] PRIMARY KEY CLUSTERED ( [TagId] 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 CREATE TABLE [dbo].[CMS_FileTag]( [FileId] [int] NOT NULL, [TagId] [int] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[CMS_FileTag] WITH NOCHECK ADD CONSTRAINT [FK_CMS_FileTag_CMS_File] FOREIGN KEY([FileId]) REFERENCES [dbo].[CMS_File] ([FileId]) ALTER TABLE [dbo].[CMS_FileTag] CHECK CONSTRAINT [FK_CMS_FileTag_CMS_File] ALTER TABLE [dbo].[CMS_FileTag] WITH NOCHECK ADD CONSTRAINT [FK_CMS_FileTag_CMS_Tag] FOREIGN KEY([TagId]) REFERENCES [dbo].[CMS_Tag] ([TagId]) ALTER TABLE [dbo].[CMS_FileTag] CHECK CONSTRAINT [FK_CMS_FileTag_CMS_Tag] GO -- From 0v3rCl0ck CREATE PROCEDURE [dbo].[proc_TestDecimalOutput] @PerfectNumber decimal(18,2) OUTPUT AS BEGIN SET @PerfectNumber = 10.35; END GO CREATE PROCEDURE [dbo].[proc_TestDecimalOutputV2] @PerfectNumber decimal(12,8) OUTPUT AS BEGIN SET @PerfectNumber = 10.35; END GO CREATE PROCEDURE [dbo].[proc_TestDecimalOutputV3Default] @PerfectNumber decimal OUTPUT AS BEGIN SET @PerfectNumber = 10.35; END GO --- From WisdomGuidedByExperience -- stored proc with nvarchar(max) parameter is missing size parameter CREATE PROCEDURE [dbo].NvarcharTest @maxOutputParam NVARCHAR(MAX), @normalOutputParam NVARCHAR(20) AS BEGIN SET @maxOutputParam = 'hello' SET @normalOutputParam = 'world' END GO -- From <NAME> CREATE TABLE hierarchy_test ( ID INT NOT NULL IDENTITY(1, 1), hid HIERARCHYID NOT NULL, CONSTRAINT PK_hierarchy_test PRIMARY KEY CLUSTERED (ID) ) GO INSERT INTO hierarchy_test (hid) VALUES ('/1/'),('/2/'),('/1/1/'),('/1/2/'),('/1/1/1/') GO -- My own testing -- DROP TABLE ClientCreationState CREATE TABLE ClientCreationState ( id UNIQUEIDENTIFIER NOT NULL, WebhookSetup BIT NOT NULL, AuthSetup BIT NOT NULL, AssignedCarrier BIT NOT NULL, CONSTRAINT PK_ClientCreationState PRIMARY KEY CLUSTERED (Id) ); GO -- SELECT * FROM ClientCreationState WHERE WebhookSetup=0 OR AuthSetup=0 OR AssignedCarrier=0 GO -- From Raju_L -- DROP PROC TestReturnString CREATE PROCEDURE [dbo].[TestReturnString] AS BEGIN SET NOCOUNT ON SET XACT_ABORT ON DECLARE @error VARCHAR(100) SET @error = '' IF(1+1 = 2) BEGIN SET @error = 'test' END SELECT @error AS error END GO EXEC [TestReturnString] GO -- #91 From igormono. FnWithCustomTableTypeReturnModel is not generated CREATE TYPE [dbo].CustomTableType AS TABLE ( [id] [INT] NOT NULL, PRIMARY KEY CLUSTERED ([id] ASC) ) GO CREATE FUNCTION [dbo].[fnWithCustomTableType] (@cusType dbo.CustomTableType READONLY) RETURNS @result TABLE ([Something] NVARCHAR(64)) AS BEGIN INSERT INTO @result SELECT 'Something' RETURN; END; GO -- #595 from kinetic (Brian) CREATE TABLE [User] ( ID INT IDENTITY(1, 1) NOT NULL, ExternalUserID VARCHAR(50) NULL, CONSTRAINT PK_User PRIMARY KEY CLUSTERED (ID ASC) ); GO CREATE TABLE User_Document ( ID INT IDENTITY(1, 1) NOT NULL, UserID INT NOT NULL, CreatedByUserID INT NOT NULL, CONSTRAINT PK_User_Document PRIMARY KEY CLUSTERED (ID ASC) ); GO ALTER TABLE User_Document WITH CHECK ADD CONSTRAINT FK_User_Document_User FOREIGN KEY (UserID) REFERENCES [User] (ID) ON DELETE CASCADE; GO ALTER TABLE User_Document CHECK CONSTRAINT FK_User_Document_User; GO ALTER TABLE User_Document WITH CHECK ADD CONSTRAINT FK_User_Document_User1 FOREIGN KEY (CreatedByUserID) REFERENCES [User] (ID); GO ALTER TABLE User_Document CHECK CONSTRAINT FK_User_Document_User1; GO -- From <NAME> CREATE TABLE dbo.Blah ( BlahID INT NOT NULL IDENTITY(1, 1), CONSTRAINT PK_Blah PRIMARY KEY CLUSTERED (BlahID) ) CREATE TABLE dbo.Blarg ( BlargID INT NOT NULL IDENTITY(1, 1), CONSTRAINT PK_Blarg PRIMARY KEY CLUSTERED (BlargID) ) CREATE TABLE dbo.BlahBlargLink ( BlahID INT NOT NULL, BlargID INT NOT NULL, CONSTRAINT [PK_BlahBlargLink] PRIMARY KEY CLUSTERED (BlahID, BlargID), CONSTRAINT FK_BlahBlargLink_Blah FOREIGN KEY (BlahID) REFERENCES Blah (BlahID), CONSTRAINT FK_BlahBlargLink_Blarg FOREIGN KEY (BlargID) REFERENCES dbo.Blarg (BlargID) ) CREATE TABLE dbo.BlahBlahLink ( BlahID INT NOT NULL, BlahID2 INT NOT NULL, CONSTRAINT [PK_BlahBlahLink] PRIMARY KEY CLUSTERED (BlahID, BlahID2), CONSTRAINT FK_BlahBlahLink_Blah FOREIGN KEY (BlahID) REFERENCES dbo.Blah (BlahID), CONSTRAINT FK_BlahBlahLink_Blah2 FOREIGN KEY (BlahID2) REFERENCES Blah (BlahID) ) GO CREATE TABLE dbo.BlahBlahLink_readonly ( BlahID INT NOT NULL, BlahID2 INT NOT NULL, [RowVersion] TIMESTAMP NULL, -- readonly timestamp id INT NOT NULL IDENTITY(1, 1), -- readonly identity id2 as (id+100) -- readonly computed CONSTRAINT [PK_BlahBlahLink_ro] PRIMARY KEY CLUSTERED (BlahID, BlahID2), CONSTRAINT FK_BlahBlahLink_Blah_ro FOREIGN KEY (BlahID) REFERENCES dbo.Blah (BlahID), CONSTRAINT FK_BlahBlahLink_Blah_ro2 FOREIGN KEY (BlahID2) REFERENCES Blah (BlahID) ) GO CREATE TABLE dbo.BlahBlahLink_v2 ( BlahID INT NOT NULL, BlahID2 INT NOT NULL, dummy1 INT NULL, dummy2 INT NOT NULL, hello INT NOT NULL, CONSTRAINT [PK_BlahBlahLinkv2_ro] PRIMARY KEY CLUSTERED (BlahID, BlahID2), CONSTRAINT FK_BlahBlahLinkv2_Blah_ro FOREIGN KEY (BlahID) REFERENCES dbo.Blah (BlahID) ON DELETE CASCADE, CONSTRAINT FK_BlahBlahLinkv2_Blah_ro2 FOREIGN KEY (BlahID2) REFERENCES Blah (BlahID) ) GO -- Multiple foreign keys [InverseProperty] test CREATE TABLE Person ( Id INT NOT NULL IDENTITY(1, 1), [Name] VARCHAR(50) NOT NULL, CONSTRAINT PK_Person PRIMARY KEY CLUSTERED (Id) ) GO CREATE TABLE PersonPosts ( Id INT NOT NULL IDENTITY(1, 1), Title VARCHAR(20) NOT NULL, Body VARCHAR(100) NOT NULL, CreatedBy INT NOT NULL, UpdatedBy INT NOT NULL, CONSTRAINT PK_PersonPosts PRIMARY KEY CLUSTERED (Id), CONSTRAINT FK_PersonPosts_CreatedBy FOREIGN KEY (CreatedBy) REFERENCES Person (Id), CONSTRAINT FK_PersonPosts_UpdatedBy FOREIGN KEY (UpdatedBy) REFERENCES Person (Id) ) GO -- Case 142 - no fk created (This relationship has multiple composite keys) Relationship.DoNotUse CREATE TABLE [dbo].[AAREF] ( [C1] [INT] NOT NULL, [C2] [INT] NOT NULL, [CreatedUTC] [DATETIME2](7) NOT NULL, CONSTRAINT [PK_AREF] PRIMARY KEY CLUSTERED ([C1] ASC, [C2] ASC) ) GO CREATE TABLE [dbo].[A] ( [AId] [INT] IDENTITY(1, 1) NOT NULL, [C1] [INT] NOT NULL, [C2] [INT] NOT NULL, CONSTRAINT [PK_A] PRIMARY KEY CLUSTERED ([AId] ASC) ) GO ALTER TABLE [dbo].[A] WITH CHECK ADD CONSTRAINT [FK_A_A] FOREIGN KEY([C1], [C2]) REFERENCES [dbo].[AAREF] ([C1], [C2]) GO CREATE TABLE [table with duplicate column names] ( [id] [INT] IDENTITY(1, 1) NOT NULL, [user_id] [INT] NOT NULL, [UserId] [INT] NOT NULL, [User Id] [INT] NOT NULL, [User Id] [INT] NOT NULL, [user__id] [INT] NOT NULL, CONSTRAINT PK_TableWithDuplicateColumnNames PRIMARY KEY CLUSTERED (Id) ) GO -- DROP TABLE pk_ordinal_test CREATE TABLE pk_ordinal_test ( C1 INT NOT NULL, C2 INT NOT NULL, C3 INT NOT NULL, CONSTRAINT PK_pk_ordinal_test PRIMARY KEY (C3,C1) ); GO -- SELECT * FROM pk_ordinal_test CREATE TABLE EventProcessor ( Id INT NOT NULL IDENTITY(1,1), [Name] VARCHAR(200) NOT NULL, [Description] VARCHAR(512) NULL, [EndpointAddress] VARCHAR(512) NULL, [Enabled] BIT NOT NULL, CONSTRAINT [PK_EventProcessor] PRIMARY KEY CLUSTERED (Id) ); GO CREATE TABLE EventProcessorEventFilter ( Id INT NOT NULL IDENTITY(1,1), EventProcessorId INT NOT NULL, WantedEventId INT NOT NULL, CONSTRAINT [PK_EventProcessorEventFilter] PRIMARY KEY CLUSTERED (Id) ); GO CREATE UNIQUE INDEX [IX_EventProcessorEventFilter] ON EventProcessorEventFilter (EventProcessorId, WantedEventId); ALTER TABLE EventProcessorEventFilter ADD CONSTRAINT [FK_EventProcessorEventFilter__EventProcessor] FOREIGN KEY (EventProcessorId) REFERENCES EventProcessor (Id); GO
<filename>sql/data-design.sql -- drop table statements go here DROP TABLE IF EXISTS strainFavorite; DROP TABLE IF EXISTS strainLeafRating; DROP TABLE IF EXISTS strainReview; DROP TABLE IF EXISTS dispensaryFavorite; DROP TABLE IF EXISTS dispensaryLeafRating; DROP TABLE IF EXISTS dispensaryReview; DROP TABLE IF EXISTS strain; DROP TABLE IF EXISTS dispensary; DROP TABLE IF EXISTS profile; CREATE TABLE profile ( profileId INT UNSIGNED AUTO_INCREMENT NOT NULL, profileUserName VARCHAR(32) NOT NULL, profileEmail VARCHAR(128) NOT NULL, profileHash CHAR(128) NOT NULL, profileSalt CHAR(64) NOT NULL, profileActivation CHAR(32), UNIQUE (profileUserName), UNIQUE (profileEmail), PRIMARY KEY (profileId) ); CREATE TABLE dispensary ( dispensaryId INT UNSIGNED AUTO_INCREMENT NOT NULL, dispensaryAttention VARCHAR(32), dispensaryCity VARCHAR(48) NOT NULL, dispensaryEmail VARCHAR(128), dispensaryName VARCHAR(64) NOT NULL, dispensaryPhone VARCHAR(32) NOT NULL , dispensaryState CHAR(2) NOT NULL, dispensaryStreet1 VARCHAR(48) NOT NULL, dispensaryStreet2 VARCHAR(48), dispensaryUrl VARCHAR(128), dispensaryZipCode VARCHAR(10) NOT NULL, PRIMARY KEY (dispensaryId) ); CREATE TABLE strain ( strainId INT UNSIGNED AUTO_INCREMENT NOT NULL, strainName VARCHAR(32) NOT NULL, strainType VARCHAR(16) NOT NULL, strainThc DECIMAL(8,6) NOT NULL, strainCbd DECIMAL(8,6) NOT NULL, strainDescription VARCHAR(255) NOT NULL, PRIMARY KEY (strainId) ); CREATE TABLE dispensaryReview ( dispensaryReviewId INT UNSIGNED AUTO_INCREMENT NOT NULL, dispensaryReviewProfileId INT UNSIGNED NOT NULL, dispensaryReviewDispensaryId INT UNSIGNED NOT NULL, dispensaryReviewDateTime DATETIME, dispensaryReviewTxt VARCHAR(255) NOT NULL, INDEX (dispensaryReviewProfileId), INDEX (dispensaryReviewDispensaryId), UNIQUE (dispensaryReviewId), FOREIGN KEY (dispensaryReviewProfileId) REFERENCES profile (profileId), FOREIGN KEY (dispensaryReviewDispensaryId) REFERENCES dispensary (dispensaryId), PRIMARY KEY (dispensaryReviewDispensaryId, dispensaryReviewProfileId) ); CREATE TABLE dispensaryLeafRating ( dispensaryLeafRatingRating TINYINT UNSIGNED NOT NULL, dispensaryLeafRatingDispensaryId INT UNSIGNED NOT NULL, dispensaryLeafRatingProfileId INT UNSIGNED NOT NULL, INDEX (dispensaryLeafRatingDispensaryId), INDEX (dispensaryLeafRatingProfileId), FOREIGN KEY (dispensaryLeafRatingProfileId) REFERENCES profile (profileId), FOREIGN KEY (dispensaryLeafRatingDispensaryId) REFERENCES dispensary (dispensaryId), PRIMARY KEY (dispensaryLeafRatingProfileId, dispensaryLeafRatingDispensaryId) ); CREATE TABLE dispensaryFavorite ( dispensaryFavoriteProfileId INT UNSIGNED NOT NULL, dispensaryFavoriteDispensaryId INT UNSIGNED NOT NULL, INDEX (dispensaryFavoriteProfileId), INDEX (dispensaryFavoriteDispensaryId), FOREIGN KEY (dispensaryFavoriteProfileId) REFERENCES profile (profileId), FOREIGN KEY (dispensaryFavoriteDispensaryId) REFERENCES dispensary (dispensaryId), PRIMARY KEY (dispensaryFavoriteProfileId, dispensaryFavoriteDispensaryId) ); CREATE TABLE strainReview ( strainReviewId INT UNSIGNED AUTO_INCREMENT NOT NULL, strainReviewProfileId INT UNSIGNED NOT NULL, strainReviewStrainId INT UNSIGNED NOT NULL, strainReviewDateTime DATETIME, strainReviewTxt VARCHAR (255), INDEX (strainReviewProfileId), INDEX (strainReviewStrainId), UNIQUE (strainReviewId), FOREIGN KEY (strainReviewProfileId) REFERENCES profile (profileId), FOREIGN KEY (strainReviewStrainId) REFERENCES strain (strainId), PRIMARY KEY (strainReviewProfileId, strainReviewStrainId) ); CREATE TABLE strainLeafRating ( strainLeafRatingRating TINYINT UNSIGNED NOT NULL, strainLeafRatingStrainId INT UNSIGNED NOT NULL, strainLeafRatingProfileId INT UNSIGNED NOT NULL, INDEX (strainLeafRatingStrainId), INDEX (strainLeafRatingProfileId), FOREIGN KEY (strainLeafRatingProfileId) REFERENCES profile (profileId), FOREIGN KEY (strainLeafRatingStrainId) REFERENCES strain (strainId), PRIMARY KEY (strainLeafRatingProfileId, strainLeafRatingStrainId) ); CREATE TABLE strainFavorite ( strainFavoriteProfileId INT UNSIGNED NOT NULL, strainFavoriteStrainId INT UNSIGNED NOT NULL, INDEX (strainFavoriteProfileId), INDEX (strainFavoriteStrainId), FOREIGN KEY (strainFavoriteProfileId) REFERENCES profile (profileId), FOREIGN KEY (strainFavoriteStrainId) REFERENCES strain (strainId), PRIMARY KEY (strainFavoriteProfileId, strainFavoriteStrainId) );
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50720 Source Host : localhost:3306 Source Database : math Target Server Type : MYSQL Target Server Version : 50720 File Encoding : 65001 Date: 2019-05-30 16:53:50 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for ma_quiz -- ---------------------------- DROP TABLE IF EXISTS `ma_quiz`; CREATE TABLE `ma_quiz` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `is_finish` tinyint(4) DEFAULT NULL, `final_diff` int(11) DEFAULT NULL, `start_time` datetime DEFAULT NULL, `end_time` datetime DEFAULT NULL, `visible` tinyint(4) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records of ma_quiz -- ---------------------------- INSERT INTO `ma_quiz` VALUES ('1', '2', null, '0', '1', '2019-02-16 19:01:17', null, '1'); INSERT INTO `ma_quiz` VALUES ('2', '3', null, '1', '1', '2019-02-23 14:52:51', '2019-02-23 23:25:49', '1'); INSERT INTO `ma_quiz` VALUES ('3', '3', null, '1', '1', '2019-02-23 23:35:42', '2019-02-24 15:27:50', '1'); INSERT INTO `ma_quiz` VALUES ('4', '1', null, '1', '1', '2019-03-16 16:17:43', '2019-03-16 16:20:10', '1'); INSERT INTO `ma_quiz` VALUES ('5', '1', null, '1', '1', '2019-03-16 16:32:23', '2019-03-16 16:32:29', '1'); INSERT INTO `ma_quiz` VALUES ('6', '1', null, '1', '1', '2019-03-16 16:57:40', '2019-05-30 14:26:22', '1'); INSERT INTO `ma_quiz` VALUES ('7', '1', null, '0', '2', '2019-05-30 14:26:59', null, '0'); INSERT INTO `ma_quiz` VALUES ('8', '1', null, '1', '2', '2019-05-30 14:45:23', '2019-05-30 15:29:02', '1'); INSERT INTO `ma_quiz` VALUES ('9', '1', null, '1', '4', '2019-05-30 16:38:52', '2019-05-30 16:44:13', '1'); INSERT INTO `ma_quiz` VALUES ('10', '1', null, '1', '2', '2019-05-30 16:44:23', '2019-05-30 16:45:48', '1'); INSERT INTO `ma_quiz` VALUES ('11', '1', null, '1', '2', '2019-05-30 16:48:01', '2019-05-30 16:48:37', '1');
<filename>scripts/schema/ccpv1/093-event-instance.sql /* Copyright (c) 2006-2012 Regents of the University of Minnesota. For licensing terms, see the file LICENSE. */ /* Make sure event tables (at least those in the public/shared schema) record which instance the event happened under. */ BEGIN TRANSACTION; SET CONSTRAINTS ALL DEFERRED; -- Set default when creating column to avoid dealing with update triggers ALTER TABLE user_preference_event ADD COLUMN instance TEXT NOT NULL DEFAULT 'minnesota'; -- Remove to ensure column is explicitly set in the future ALTER TABLE user_preference_event ALTER COLUMN instance DROP DEFAULT; ALTER TABLE auth_fail_event ADD COLUMN instance TEXT NOT NULL DEFAULT 'minnesota'; ALTER TABLE auth_fail_event ALTER COLUMN instance DROP DEFAULT; COMMIT;
ALTER TABLE nodes DROP COLUMN IF EXISTS address;
<reponame>YangHao666666/hawq DROP TABLE IF EXISTS test_parquet_types_varchar10; CREATE TABLE test_parquet_types_varchar10 (c0 varchar(10)) with (appendonly=true, orientation=parquet, compresstype=none, rowgroupsize=8388608, pagesize=1048576, compresslevel=0); INSERT INTO test_parquet_types_varchar10 values ('123456789a'), ('bbccddeeff'), ('aaaa'), (null);
/******************* *RESET THE DATABASE* *******************/ DROP TABLE Attachments; DROP TABLE ReimbursementNotes; DROP TABLE NoteReasons; DROP TABLE Reimbursements; DROP TABLE ApprovalDates; DROP TABLE Employees; DROP TABLE EmployeeTypes; DROP TABLE Events; DROP TABLE EventTypes; DROP TABLE Grades; DROP TABLE GradingFormats; DROP TABLE GradeLetters; DROP TABLE ReimbursementStatuses; /*********************** *Create Database Tables* ***********************/ CREATE TABLE Attachments ( ID INT NOT NULL, Reimbursement INT NOT NULL, AttachmentPath VARCHAR2(260) UNIQUE NOT NULL, --maxPath CONSTRAINT PK_Attachments PRIMARY KEY (ID) ); CREATE TABLE ReimbursementNotes ( ID INT NOT NULL, Reimbursement INT UNIQUE NOT NULL, NoteReason INT NOT NULL, Note VARCHAR2(140) NOT NULL, CONSTRAINT PK_ReimbursementNotes PRIMARY KEY (ID) ); CREATE TABLE NoteReasons --REFERENCE TABLE ( ID INT NOT NULL, NoteReason VARCHAR2(70) UNIQUE NOT NULL, CONSTRAINT PK_NoteReasons PRIMARY KEY (ID) ); CREATE TABLE Reimbursements ( ID INT NOT NULL, Employee INT NOT NULL, DateSubmitted DATE NOT NULL, Event INT UNIQUE NOT NULL, WorkTimeMissed VARCHAR2(140) NOT NULL, Justification VARCHAR2(140) NOT NULL, ProjectedAmount NUMBER(6,2) NOT NULL, BenefitsCoordinator INT, ApprovalDates INT UNIQUE NOT NULL, ReimbursementStatus INT NOT NULL, AmountAwarded NUMBER(6,2), CONSTRAINT PK_Reimbursements PRIMARY KEY (ID) ); CREATE TABLE ApprovalDates ( ID INT NOT NULL, DirectSupervisor DATE, DepartmentHead DATE, BenefitsCoordinator DATE, CONSTRAINT PK_ApprovalDates PRIMARY KEY (ID) ); CREATE TABLE Employees ( ID INT NOT NULL, FirstName VARCHAR2(35) NOT NULL, LastName VARCHAR2(35) NOT NULL, Email VARCHAR2(100) UNIQUE NOT NULL, --firstname.lastname@domain Password VARCHAR2(128) NOT NULL, EmployeeType INT NOT NULL, DirectSupervisor INT, DepartmentHead INT, AvailableReimbursement NUMBER(6,2), CONSTRAINT PK_Employees PRIMARY KEY (ID) ); CREATE TABLE EmployeeTypes --REFERENCE TABLE ( ID INT NOT NULL, EmployeeType VARCHAR2(100) UNIQUE NOT NULL, CONSTRAINT PK_EmployeeTypes PRIMARY KEY (ID) ); CREATE TABLE Events ( ID INT NOT NULL, Name VARCHAR2(100) NOT NULL, EventType INT NOT NULL, Description VARCHAR2(140) NOT NULL, StartDate DATE NOT NULL, EndDate DATE NOT NULL, Time VARCHAR2(8) NOT NULL, --HH:mm AM/PM Location VARCHAR2(175) NOT NULL, Cost NUMBER(6,2) NOT NULL, Grades INT UNIQUE NOT NULL, CONSTRAINT PK_Events PRIMARY KEY (ID) ); CREATE TABLE EventTypes --REFERENCE TABLE ( ID INT NOT NULL, EventType VARCHAR2(70) UNIQUE NOT NULL, PercentCovered NUMBER(2,1) NOT NULL, CONSTRAINT PK_EventTypes PRIMARY KEY (ID) ); CREATE TABLE Grades ( ID INT NOT NULL, GradingFormat INT NOT NULL, Passing INT NOT NULL, --Presentations get Grades as well Recieved NUMBER(4,2), --Points #/# CONSTRAINT PK_Grades PRIMARY KEY (ID) ); CREATE TABLE GradingFormats --REFERENCE TABLE ( ID INT NOT NULL, GradingFormat VARCHAR2(35) UNIQUE NOT NULL, CONSTRAINT PK_GradingFormats PRIMARY KEY (ID) ); CREATE TABLE GradeLetters --REFERENCE TABLE ( ID INT NOT NULL, GradeLetter VARCHAR2(2) UNIQUE NOT NULL, MinPercentage NUMBER(2,1) UNIQUE NOT NULL, MaxPercentage NUMBER(2,1) UNIQUE NOT NULL, CONSTRAINT PK_GradeLetters PRIMARY KEY (ID) ); CREATE TABLE ReimbursementStatuses --REFERENCE TABLE ( ID INT NOT NULL, ReimbursementStatus VARCHAR2(35) UNIQUE NOT NULL, CONSTRAINT PK_ReimbursementStatuses PRIMARY KEY (ID) ); /**************************** *Add Foriegn Key Constraints* ****************************/ ALTER TABLE Attachments ADD CONSTRAINT FK_Reimbursement_1 FOREIGN KEY (Reimbursement) REFERENCES Reimbursements (ID); ALTER TABLE ReimbursementNotes ADD CONSTRAINT FK_Reimbursement_2 FOREIGN KEY (Reimbursement) REFERENCES Reimbursements (ID); ALTER TABLE ReimbursementNotes ADD CONSTRAINT FK_NoteReason FOREIGN KEY (NoteReason) REFERENCES NoteReasons (ID);ALTER TABLE Reimbursements ADD CONSTRAINT FK_Employee FOREIGN KEY (Employee) REFERENCES Employees (ID); ALTER TABLE Reimbursements ADD CONSTRAINT FK_Event FOREIGN KEY (Event) REFERENCES Events (ID); ALTER TABLE Reimbursements ADD CONSTRAINT FK_ReimbursementStatus FOREIGN KEY (ReimbursementStatus) REFERENCES ReimbursementStatuses (ID); ALTER TABLE Reimbursements ADD CONSTRAINT FK_ApprovalDates FOREIGN KEY (ApprovalDates) REFERENCES ApprovalDates (ID); ALTER TABLE Reimbursements ADD CONSTRAINT FK_BenefitsCoordinator FOREIGN KEY (BenefitsCoordinator) REFERENCES Employees (ID); ALTER TABLE Employees ADD CONSTRAINT FK_EmployeeType FOREIGN KEY (EmployeeType) REFERENCES EmployeeTypes (ID); ALTER TABLE Employees ADD CONSTRAINT FK_DirectSupervisor_1 FOREIGN KEY (DirectSupervisor) REFERENCES Employees (ID); ALTER TABLE Employees ADD CONSTRAINT FK_DepartmentHead_1 FOREIGN KEY (DepartmentHead) REFERENCES Employees (ID); ALTER TABLE Events ADD CONSTRAINT FK_EventType FOREIGN KEY (EventType) REFERENCES EventTypes (ID); ALTER TABLE Events ADD CONSTRAINT FK_Grade FOREIGN KEY (Grades) REFERENCES Grades (ID); ALTER TABLE Grades ADD CONSTRAINT FK_GradingFormat FOREIGN KEY (GradingFormat) REFERENCES GradingFormats (ID); ALTER TABLE Grades ADD CONSTRAINT FK_Passing FOREIGN KEY (Passing) REFERENCES GradeLetters (ID); /************************* *Add Reference Table Data* *************************/ INSERT INTO NoteReasons (ID, NoteReason) VALUES (0,'Reimbursement Denied'); INSERT INTO NoteReasons (ID, NoteReason) VALUES (1,'Reimbursement Amount Exceeded'); INSERT INTO EmployeeTypes (ID, EmployeeType) VALUES (0,'Standard'); INSERT INTO EmployeeTypes (ID, EmployeeType) VALUES (1,'Benefits Coordinator'); INSERT INTO EmployeeTypes (ID, EmployeeType) VALUES (2,'Management'); INSERT INTO EventTypes (ID, EventType, PercentCovered) VALUES (0,'University Course',0.80); INSERT INTO EventTypes (ID, EventType, PercentCovered) VALUES (1,'Seminar',0.60); INSERT INTO EventTypes (ID, EventType, PercentCovered) VALUES (2,'Certification Preparation Classe',0.75); INSERT INTO EventTypes (ID, EventType, PercentCovered) VALUES (3,'Certification Exam',1.00); INSERT INTO EventTypes (ID, EventType, PercentCovered) VALUES (4,'Technical Training',0.90); INSERT INTO EventTypes (ID, EventType, PercentCovered) VALUES (5,'Other',0.30); INSERT INTO GradingFormats (ID, GradingFormat) VALUES (0,'Letter Grade'); INSERT INTO GradingFormats (ID, GradingFormat) VALUES (1,'Presentation'); INSERT INTO GradeLetters (ID, GradeLetter, MinPercentage, MaxPercentage) VALUES (0,'A',0.9,1.0); INSERT INTO GradeLetters (ID, GradeLetter, MinPercentage, MaxPercentage) VALUES (1,'B',0.8,0.9); INSERT INTO GradeLetters (ID, GradeLetter, MinPercentage, MaxPercentage) VALUES (2,'C',0.7,0.8); INSERT INTO GradeLetters (ID, GradeLetter, MinPercentage, MaxPercentage) VALUES (3,'D',0.6,0.7); INSERT INTO GradeLetters (ID, GradeLetter, MinPercentage, MaxPercentage) VALUES (4,'F',0.0,0.6); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (0,'Pending'); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (1,'Grade Pending'); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (2,'Approval Pending'); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (3,'Awarded'); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (4,'Cancelled'); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (5,'Urgent'); INSERT INTO ReimbursementStatuses (ID, ReimbursementStatus) VALUES (6,'Denied'); /******************** *Add Mock Table Data* ********************/ INSERT INTO Employees (ID, FirstName, LastName, Email, Password, EmployeeType, DirectSupervisor, DepartmentHead, AvailableReimbursement) VALUES (0,'Department','Head','<EMAIL>','password',2,null,null,null); INSERT INTO Employees (ID, FirstName, LastName, Email, Password, EmployeeType, DirectSupervisor, DepartmentHead, AvailableReimbursement) VALUES (1, 'Direct', 'Supervisor','<EMAIL>','password',2,0,0,null); INSERT INTO Employees (ID, FirstName, LastName, Email, Password, EmployeeType, DirectSupervisor, DepartmentHead, AvailableReimbursement) VALUES (3, 'BenCo', 'Supervisor', '<EMAIL>','password',2, null,null,null); INSERT INTO Employees (ID, FirstName, LastName, Email, Password, EmployeeType, DirectSupervisor, DepartmentHead, AvailableReimbursement) VALUES (4,'Benefits','Coordinator','<EMAIL>','password',1,3,null,null); INSERT INTO Employees (ID, FirstName, LastName, Email, Password, EmployeeType, DirectSupervisor, DepartmentHead, AvailableReimbursement) VALUES (5, 'Code', 'Monkee', '<EMAIL>', 'password',0,1,0,1000); INSERT INTO Grades (ID, GradingFormat, Passing, Recieved) VALUES (0,0,2,null); INSERT INTO Grades (ID, GradingFormat, Passing, Recieved) VALUES (1,1,2,null); INSERT INTO Grades (ID, GradingFormat, Passing, Recieved) VALUES (2,0,2,null); INSERT INTO Grades (ID, GradingFormat, Passing, Recieved) VALUES (3,0,2,null); INSERT INTO Grades (ID, GradingFormat, Passing, Recieved) VALUES (4,1,2,null); INSERT INTO Grades (ID, GradingFormat, Passing, Recieved) VALUES (5,1,2,null); INSERT INTO Events (ID,Name,EventType,Description,StartDate,EndDate,Time,Location,Cost,Grades) VALUES (0,'AUniversityCourse',0,'A University Course',TO_DATE('2017-01-08','yyyy-mm-dd'),TO_DATE('2017-01-15','yyyy-mm-dd'),'12:00 PM','Location1',100,0); INSERT INTO Events (ID,Name,EventType,Description,StartDate,EndDate,Time,Location,Cost,Grades) VALUES (1,'ASeminar',1,'A Seminar',TO_DATE('2017-02-08','yyyy-mm-dd'),TO_DATE('2017-02-08','yyyy-mm-dd'),'01:00 PM','Location2',75,1); INSERT INTO Events (ID,Name,EventType,Description,StartDate,EndDate,Time,Location,Cost,Grades) VALUES (2,'ACertificationPreperationClass',2,'A Certification Preperation Class',TO_DATE('2017-03-08','yyyy-mm-dd'),TO_DATE('2017-03-15','yyyy-mm-dd'),'02:00 PM','Location3',50,2); INSERT INTO Events (ID,Name,EventType,Description,StartDate,EndDate,Time,Location,Cost,Grades) VALUES (3,'ACertificationExam',3,'A Certification Exam',TO_DATE('2017-04-08','yyyy-mm-dd'),TO_DATE('2017-04-08','yyyy-mm-dd'),'03:00 PM','Location4',150,3); INSERT INTO Events (ID,Name,EventType,Description,StartDate,EndDate,Time,Location,Cost,Grades) VALUES (4,'SomeTechnicalTraining',4,'Some Technical Training',TO_DATE('2017-05-08','yyyy-mm-dd'),TO_DATE('2017-05-15','yyyy-mm-dd'),'04:00 PM','Location5',200,4); INSERT INTO Events (ID,Name,EventType,Description,StartDate,EndDate,Time,Location,Cost,Grades) VALUES (5,'Other',5,'Some Other Event',TO_DATE('2017-06-08','yyyy-mm-dd'),TO_DATE('2017-06-15','yyyy-mm-dd'),'05:00 PM','Location6',25,5); INSERT INTO ApprovalDates(ID) VALUES (0); INSERT INTO ApprovalDates(ID) VALUES (1); INSERT INTO ApprovalDates(ID) VALUES (2); INSERT INTO ApprovalDates(ID) VALUES (3); INSERT INTO ApprovalDates(ID) VALUES (4); INSERT INTO ApprovalDates(ID) VALUES (5); INSERT INTO Reimbursements (ID,Employee,DateSubmitted,Event,WorkTimeMissed,Justification,ProjectedAmount,ApprovalDates,ReimbursementStatus) VALUES (0,5,TO_DATE('2017-01-01','yyyy-mm-dd'),0,'4 Weeks','JUSTIFIED1',80,0,1); INSERT INTO Reimbursements (ID,Employee,DateSubmitted,Event,WorkTimeMissed,Justification,ProjectedAmount,ApprovalDates,ReimbursementStatus) VALUES (1,5,TO_DATE('2017-02-01','yyyy-mm-dd'),1,'2 Days','JUSTIFIED2',45,1,1); INSERT INTO Reimbursements (ID,Employee,DateSubmitted,Event,WorkTimeMissed,Justification,ProjectedAmount,ApprovalDates,ReimbursementStatus) VALUES (2,5,TO_DATE('2017-03-01','yyyy-mm-dd'),2,'1 Week','JUSTIFIED3',37.5,2,1); INSERT INTO Reimbursements (ID,Employee,DateSubmitted,Event,WorkTimeMissed,Justification,ProjectedAmount,ApprovalDates,ReimbursementStatus) VALUES (3,5,TO_DATE('2017-04-01','yyyy-mm-dd'),3,'1 Day','JUSTIFIED4',150,3,1); INSERT INTO Reimbursements (ID,Employee,DateSubmitted,Event,WorkTimeMissed,Justification,ProjectedAmount,ApprovalDates,ReimbursementStatus) VALUES (4,5,TO_DATE('2017-05-01','yyyy-mm-dd'),4,'2 Weeks','JUSTIFIED5',180,4,1); INSERT INTO Reimbursements (ID,Employee,DateSubmitted,Event,WorkTimeMissed,Justification,ProjectedAmount,ApprovalDates,ReimbursementStatus) VALUES (5,5,TO_DATE('2017-06-01','yyyy-mm-dd'),5,'4 Days','JUSTIFIED6',7.5,5,1);
<filename>createdatabase.sql CREATE DATABASE `laratasks`;
--SELECT MIN("TrainsUK2_2"."Target Amount Minutes") AS "TEMP(Calculation_8390609132022332)(2549172019)(0)", "TrainsUK2_2"."TOC" AS "TOC" FROM "TrainsUK2_2" WHERE (("TrainsUK2_2"."TOC" = 'HY') AND ("TrainsUK2_2"."Target Type Name" = 'PPM')) GROUP BY 2;
<filename>pruebadesa_Cristia_Aparicio.sql -- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Servidor: 1172.16.17.32 -- Tiempo de generación: 05-02-2022 a las 01:46:08 -- Versión del servidor: 10.4.20-MariaDB -- Versión de PHP: 7.4.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `pruebadesa_nombre_aspirante` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `departamentos` -- CREATE TABLE `departamentos` ( `id` bigint(20) UNSIGNED NOT NULL, `nombdepa` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `departamentos` -- INSERT INTO `departamentos` (`id`, `nombdepa`, `created_at`, `updated_at`) VALUES (1, 'Antioquia', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (2, 'Atlantico', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (3, 'Bogotá', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (4, 'Bolivar', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (5, 'Boyaca', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (6, 'Caldas', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (7, 'Caqueta', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (8, 'Cauca', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (9, 'Cesar', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (10, 'Cordova', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (11, 'Cundinamarca', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (12, 'Choco', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (13, 'Huila', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (14, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (15, 'Magdalena', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (16, 'Meta', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (17, 'Nariño', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (18, '<NAME> Santander', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (19, 'Quindio', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (20, 'Risaralda', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (21, 'Santander', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (22, 'Sucre', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (23, 'Tolima', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (24, 'Valle', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (25, 'Arauca', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (26, 'Casanare', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (27, 'Putumayo', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (28, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (29, 'Amazonas', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (30, 'Guainia', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (31, 'Guaviare', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (32, 'Vaupes', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (33, 'Vichada', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2019_12_14_000001_create_personal_access_tokens_table', 1), (2, '2022_02_04_185741_create_departamentos_table', 1), (3, '2022_02_04_185804_create_municipios_table', 1), (4, '2022_02_04_185817_create_tipoterceros_table', 1), (5, '2022_02_04_185827_create_terceros_table', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `municipios` -- CREATE TABLE `municipios` ( `id` bigint(20) UNSIGNED NOT NULL, `iddepa` bigint(20) UNSIGNED NOT NULL, `nombmuni` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `municipios` -- INSERT INTO `municipios` (`id`, `iddepa`, `nombmuni`, `created_at`, `updated_at`) VALUES (1, 1, 'MEDELLIN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (2, 1, 'ABEJORRAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (3, 1, 'ABRIAQUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (4, 1, 'ALEJANDRIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (5, 1, 'AMAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (6, 1, 'AMALFI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (7, 1, 'ANDES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (8, 1, 'ANGELOPOLIS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (9, 1, 'ANGOSTURA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (10, 1, 'ANORI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (11, 1, 'ANTIOQUIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (12, 1, 'ANZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (13, 1, 'APARTADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (14, 1, 'ARBOLETES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (15, 1, 'ARGELIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (16, 1, 'ARMENIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (17, 1, 'BARBOSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (18, 1, 'BELMIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (19, 1, 'BELLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (20, 1, 'BETANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (21, 1, 'BETULIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (22, 1, 'BOLIVAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (23, 1, 'BRICEÑO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (24, 1, 'BURITICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (25, 1, 'CACERES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (26, 1, 'CAICEDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (27, 1, 'CALDAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (28, 1, 'CAMPAMENTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (29, 1, 'CAÑASGORDAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (30, 1, 'CARACOLI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (31, 1, 'CARAMANTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (32, 1, 'CAREPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (33, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (34, 1, 'CAROLINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (35, 1, 'CAUCASIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (36, 1, 'CHIGORODO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (37, 1, 'CISNEROS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (38, 1, 'COCORNA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (39, 1, 'CONCEPCION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (40, 1, 'CONCORDIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (41, 1, 'COPACABANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (42, 1, 'DABEIBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (43, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (44, 1, 'EBEJICO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (45, 1, 'EL BAGRE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (46, 1, 'ENTRERRIOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (47, 1, 'ENVIGADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (48, 1, 'FREDONIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (49, 1, 'FRONTINO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (50, 1, 'GIRALDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (51, 1, 'GIRARDOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (52, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (53, 1, 'GRANADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (54, 1, 'GUADALUPE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (55, 1, 'GUARNE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (56, 1, 'GUATAPE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (57, 1, 'HELICONIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (58, 1, 'HISPANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (59, 1, 'ITAGUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (60, 1, 'ITUANGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (61, 1, 'JARDIN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (62, 1, 'JERICO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (63, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (64, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (65, 1, 'LA PINTADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (66, 1, 'LA UNION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (67, 1, 'LIBORINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (68, 1, 'MACEO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (69, 1, 'MARINILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (70, 1, 'MONTEBELLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (71, 1, 'MURINDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (72, 1, 'MUTATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (73, 1, 'NARIÑO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (74, 1, 'NECOCLI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (75, 1, 'NECHI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (76, 1, 'OLAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (77, 1, 'PEÑOL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (78, 1, 'PEQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (79, 1, 'PUEBLORRICO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (80, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (81, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (82, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (83, 1, 'REMEDIOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (84, 1, 'RETIRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (85, 1, 'RIONEGRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (86, 1, 'SABANALARGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (87, 1, 'SABANETA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (88, 1, 'SALGAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (89, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (90, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (91, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (92, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (93, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (94, 1, 'SAN <NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (95, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (96, 1, 'SAN PEDRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (97, 1, 'SAN PEDRO DE URABA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (98, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (99, 1, 'SAN ROQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (100, 1, 'SAN VICENTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (101, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (102, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (103, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (104, 1, 'SANTUARIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (105, 1, 'SEGOVIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (106, 1, 'SONSON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (107, 1, 'SOPETRAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (108, 1, 'TAMESIS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (109, 1, 'TARAZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (110, 1, 'TARSO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (111, 1, 'TITIRIBI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (112, 1, 'TOLEDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (113, 1, 'TURBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (114, 1, 'URAMITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (115, 1, 'URRAO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (116, 1, 'VALDIVIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (117, 1, 'VALPARAISO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (118, 1, 'VEGACHI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (119, 1, 'VENECIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (120, 1, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (121, 1, 'YALI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (122, 1, 'YARUMAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (123, 1, 'YOLOMBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (124, 1, 'YONDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (125, 1, 'ZARAGOZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (126, 2, 'BARRANQUILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (127, 2, 'BARANOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (128, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (129, 2, 'CANDELARIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (130, 2, 'GALAPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (131, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (132, 2, 'LURUACO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (133, 2, 'MALAMBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (134, 2, 'MANATI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (135, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (136, 2, 'PIOJO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (137, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (138, 2, 'PONEDERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (139, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (140, 2, 'REPELON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (141, 2, 'SABANAGRANDE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (142, 2, 'SABANALARGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (143, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (144, 2, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (145, 2, 'SOLEDAD', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (146, 2, 'SUAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (147, 2, 'TUBARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (148, 2, 'USIACURI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (149, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (150, 3, 'USAQUEN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (151, 3, 'CHAPINERO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (152, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (153, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (154, 3, 'USME', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (155, 3, 'TUNJUELITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (156, 3, 'BOSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (157, 3, 'KENNEDY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (158, 3, 'FONTIBON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (159, 3, 'ENGATIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (160, 3, 'SUBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (161, 3, 'BARRIOS UNIDOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (162, 3, 'TEUSAQUILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (163, 3, 'MARTIRES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (164, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (165, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (166, 3, 'CANDELARIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (167, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (168, 3, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (169, 3, 'SUMAPAZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (170, 4, 'CARTAGENA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (171, 4, 'ACHI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (172, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (173, 4, 'ARENAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (174, 4, 'ARJONA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (175, 4, 'ARROYOHONDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (176, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (177, 4, 'CALAMAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (178, 4, 'CANTAGALLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (179, 4, 'CICUCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (180, 4, 'CORDOBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (181, 4, 'CLEMENCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (182, 4, 'EL <NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (183, 4, 'EL GUAMO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (184, 4, 'EL PEÑON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (185, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (186, 4, 'MAGANGUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (187, 4, 'MAHATES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (188, 4, 'MARGARITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (189, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (190, 4, 'MONTECRISTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (191, 4, 'MOMPOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (192, 4, 'MORALES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (193, 4, 'PINILLOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (194, 4, 'REGIDOR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (195, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (196, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (197, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (198, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (199, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (200, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (201, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (202, 4, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (203, 4, 'SAN PABLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (204, 4, 'SANTA CATALINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (205, 4, 'SANTA ROSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (206, 4, 'SANTA ROSA DEL SUR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (207, 4, 'SIMITI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (208, 4, 'SOPLAVIENTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (209, 4, 'T<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (210, 4, 'TIQUISIO (PUERTO RICO)', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (211, 4, 'TURBACO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (212, 4, 'TURBANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (213, 4, 'VILLANUEVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (214, 4, 'ZAMBRANO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (215, 5, 'TUNJA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (216, 5, 'ALMEIDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (217, 5, 'AQUITANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (218, 5, 'ARCABUCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (219, 5, 'BELEN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (220, 5, 'BERBEO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (221, 5, 'BETEITIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (222, 5, 'BOAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (223, 5, 'BOYACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (224, 5, 'BRICEÑO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (225, 5, 'BUENAVISTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (226, 5, 'BUSBANZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (227, 5, 'CALDAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (228, 5, 'CAMPOHERMOSO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (229, 5, 'CERINZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (230, 5, 'CHINAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (231, 5, 'CHIQUINQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (232, 5, 'CHISCAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (233, 5, 'CHITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (234, 5, 'CHITARAQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (235, 5, 'CHIVATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (236, 5, 'CIENEGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (237, 5, 'COMBITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (238, 5, 'COPER', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (239, 5, 'CORRALES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (240, 5, 'COVARACHIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (241, 5, 'CUBARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (242, 5, 'CUCAITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (243, 5, 'CUITIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (244, 5, 'CHIQUIZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (245, 5, 'CHIVOR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (246, 5, 'DUITAMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (247, 5, 'EL COCUY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (248, 5, 'EL ESPINO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (249, 5, 'FIRAVITOBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (250, 5, 'FLORESTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (251, 5, 'GACHANTIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (252, 5, 'GAMEZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (253, 5, 'GARAGOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (254, 5, 'GUACAMAYAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (255, 5, 'GUATEQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (256, 5, 'GUAYATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (257, 5, 'GUICAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (258, 5, 'IZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (259, 5, 'JENESANO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (260, 5, 'JERICO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (261, 5, 'LABRANZAGRANDE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (262, 5, 'LA CAPILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (263, 5, 'LA VICTORIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (264, 5, 'LA UVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (265, 5, 'VILLA DE LEIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (266, 5, 'MACANAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (267, 5, 'MARIPI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (268, 5, 'MIRAFLORES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (269, 5, 'MONGUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (270, 5, 'MONGUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (271, 5, 'MONIQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (272, 5, 'MOTAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (273, 5, 'MUZO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (274, 5, 'NOBSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (275, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (276, 5, 'OICATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (277, 5, 'OTANCHE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (278, 5, 'PACHAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (279, 5, 'PAEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (280, 5, 'PAIPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (281, 5, 'PAJARITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (282, 5, 'PANQUEBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (283, 5, 'PAUNA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (284, 5, 'PAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (285, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (286, 5, 'PESCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (287, 5, 'PISBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (288, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (289, 5, 'QUIPAMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (290, 5, 'RAMIRIQUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (291, 5, 'RAQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (292, 5, 'RONDON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (293, 5, 'SABOYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (294, 5, 'SACHICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (295, 5, 'SAMACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (296, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (297, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (298, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (299, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (300, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (301, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (302, 5, 'SANTANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (303, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (304, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (305, 5, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (306, 5, 'SATIVANORTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (307, 5, 'SATIVASUR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (308, 5, 'SIACHOQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (309, 5, 'SOATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (310, 5, 'SOCOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (311, 5, 'SOCHA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (312, 5, 'SOGAMOSO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (313, 5, 'SOMONDOCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (314, 5, 'SORA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (315, 5, 'SOTAQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (316, 5, 'SORACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (317, 5, 'SUSACON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (318, 5, 'SUTAMARCHAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (319, 5, 'SUTATENZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (320, 5, 'TASCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (321, 5, 'TENZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (322, 5, 'TIBANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (323, 5, 'TIBASOSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (324, 5, 'TINJACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (325, 5, 'TIPACOQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (326, 5, 'TOCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (327, 5, 'TOGUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (328, 5, 'TOPAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (329, 5, 'TOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (330, 5, 'TUNUNGUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (331, 5, 'TURMEQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (332, 5, 'TUTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (333, 5, 'TUTASA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (334, 5, 'UMBITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (335, 5, 'VENTAQUEMADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (336, 5, 'VIRACACHA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (337, 5, 'ZETAQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (338, 6, 'MANIZALES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (339, 6, 'AGUADAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (340, 6, 'ANSERMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (341, 6, 'ARANZAZU', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (342, 6, 'BELALCAZAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (343, 6, 'CHINCHINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (344, 6, 'FILADELFIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (345, 6, 'LA DORADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (346, 6, 'LA MERCED', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (347, 6, 'MANZANARES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (348, 6, 'MARMATO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (349, 6, 'MARQUETALIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (350, 6, 'MARULANDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (351, 6, 'NEIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (352, 6, 'NORCASIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (353, 6, 'PACORA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (354, 6, 'PALESTINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (355, 6, 'PENSILVANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (356, 6, 'RIOSUCIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (357, 6, 'RISARALDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (358, 6, 'SALAMINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (359, 6, 'SAMANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (360, 6, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (361, 6, 'SUPIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (362, 6, 'VICTORIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (363, 6, 'VILLAMARIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (364, 6, 'VITERBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (365, 7, 'FLORENCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (366, 7, 'ALBANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (367, 7, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (368, 7, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (369, 7, 'CURILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (370, 7, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (371, 7, 'EL PAUJIL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (372, 7, 'LA MONTAÑITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (373, 7, 'MILAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (374, 7, 'MORELIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (375, 7, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (376, 7, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (377, 7, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (378, 7, 'SOLANO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (379, 7, 'SOLITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (380, 7, 'VALPARAISO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (381, 8, 'POPAYAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (382, 8, 'ALMAGUER', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (383, 8, 'ARGELIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (384, 8, 'BALBOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (385, 8, 'BOLIVAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (386, 8, 'BUENOS AIRES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (387, 8, 'CAJIBIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (388, 8, 'CALDONO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (389, 8, 'CALOTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (390, 8, 'CORINTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (391, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (392, 8, 'FLORENCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (393, 8, 'GUAPI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (394, 8, 'INZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (395, 8, 'JAMBALO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (396, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (397, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (398, 8, 'LOPEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (399, 8, 'MERCADERES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (400, 8, 'MIRANDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (401, 8, 'MORALES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (402, 8, 'PADILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (403, 8, 'PAEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (404, 8, 'PATIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (405, 8, 'PIAMONTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (406, 8, 'PIENDAMO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (407, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (408, 8, 'PURACE (COCONUCO)', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (409, 8, 'ROSAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (410, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (411, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (412, 8, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (413, 8, 'SILVIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (414, 8, 'SOTARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (415, 8, 'SUAREZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (416, 8, 'TIMBIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (417, 8, 'TIMBIQUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (418, 8, 'TORIBIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (419, 8, 'TOTORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (420, 8, 'VILLARICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (421, 9, 'VALLEDUPAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (422, 9, 'AGUACHICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (423, 9, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (424, 9, 'ASTREA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (425, 9, 'BECERRIL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (426, 9, 'BOSCONIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (427, 9, 'CHIMICHAGUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (428, 9, 'CHIRIGUANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (429, 9, 'CURUMANI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (430, 9, 'EL COPEY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (431, 9, 'EL PASO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (432, 9, 'GAMARRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (433, 9, 'GONZALEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (434, 9, 'LA GLORIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (435, 9, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (436, 9, 'MANAURE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (437, 9, 'PAILITAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (438, 9, 'PELAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (439, 9, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (440, 9, 'RIO DE ORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (441, 9, 'LA PAZ (ROBLES)', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (442, 9, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (443, 9, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (444, 9, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (445, 9, 'TAMALAMEQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (446, 10, 'MONTERIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (447, 10, 'AYAPEL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (448, 10, 'BUENAVISTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (449, 10, 'CANALETE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (450, 10, 'CERETE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (451, 10, 'CHIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (452, 10, 'CHINU', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (453, 10, 'CIENAGA DE ORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (454, 10, 'COTORRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (455, 10, 'LA APARTADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (456, 10, 'LORICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (457, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (458, 10, 'MOMIL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (459, 10, 'MONTELIBANO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (460, 10, 'MOÑITOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (461, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (462, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (463, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (464, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (465, 10, 'PURISIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (466, 10, 'SAHAGUN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (467, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (468, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (469, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (470, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (471, 10, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (472, 10, 'TIERRALTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (473, 10, 'VALENCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (474, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (475, 11, 'ALBAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (476, 11, 'ANAPOIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (477, 11, 'ANOLAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (478, 11, 'ARBELAEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (479, 11, 'BELTRAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (480, 11, 'BITUIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (481, 11, 'BOJACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (482, 11, 'CABRERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (483, 11, 'CACHIPAY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (484, 11, 'CAJICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (485, 11, 'CAPARRAPI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (486, 11, 'CAQUEZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (487, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (488, 11, 'CHAGUANI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (489, 11, 'CHIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (490, 11, 'CHIPAQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (491, 11, 'CHOACHI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (492, 11, 'CHOCONTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (493, 11, 'COGUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (494, 11, 'COTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (495, 11, 'CUCUNUBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (496, 11, 'EL COLEGIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (497, 11, 'EL PEÑON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (498, 11, 'EL ROSAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (499, 11, 'FACATATIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (500, 11, 'FOMEQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (501, 11, 'FOSCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (502, 11, 'FUNZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (503, 11, 'FUQUENE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (504, 11, 'FUSAGASUGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (505, 11, 'GACHALA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (506, 11, 'GACHANCIPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (507, 11, 'GACHETA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (508, 11, 'GAMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (509, 11, 'GIRARDOT', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (510, 11, 'GRANADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (511, 11, 'GUACHETA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (512, 11, 'GUADUAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (513, 11, 'GUASCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (514, 11, 'GUATAQUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (515, 11, 'GUATAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (516, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (517, 11, 'GUAYABETAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (518, 11, 'GUTIERREZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (519, 11, 'JERUSALEN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (520, 11, 'JUNIN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (521, 11, 'LA CALERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (522, 11, 'LA MESA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (523, 11, 'LA PALMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (524, 11, 'LA PEÑA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (525, 11, 'LA VEGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (526, 11, 'LENGUAZAQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (527, 11, 'MACHETA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (528, 11, 'MADRID', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (529, 11, 'MANTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (530, 11, 'MEDINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (531, 11, 'MOSQUERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (532, 11, 'NARIÑO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (533, 11, 'NEMOCON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (534, 11, 'NILO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (535, 11, 'NIMAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (536, 11, 'NOCAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (537, 11, 'VENECIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (538, 11, 'PACHO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (539, 11, 'PAIME', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (540, 11, 'PANDI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (541, 11, 'PARATEBUENO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (542, 11, 'PASCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (543, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (544, 11, 'PULI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (545, 11, 'QUEBRADANEGRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (546, 11, 'QUETAME', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (547, 11, 'QUIPILE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (548, 11, 'APULO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (549, 11, 'RICAURTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (550, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (551, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (552, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (553, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (554, 11, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (555, 11, 'SASAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (556, 11, 'SESQUILE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (557, 11, 'SIBATE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (558, 11, 'SILVANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (559, 11, 'SIMIJACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (560, 11, 'SOACHA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (561, 11, 'SOPO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (562, 11, 'SUBACHOQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (563, 11, 'SUESCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (564, 11, 'SUPATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (565, 11, 'SUSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (566, 11, 'SUTATAUSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (567, 11, 'TABIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (568, 11, 'TAUSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (569, 11, 'TENA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (570, 11, 'TENJO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (571, 11, 'TIBACUY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (572, 11, 'TIBIRITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (573, 11, 'TOCAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (574, 11, 'TOCANCIPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (575, 11, 'TOPAIPI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (576, 11, 'UBALA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (577, 11, 'UBAQUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (578, 11, 'UBATE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (579, 11, 'UNE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (580, 11, 'UTICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (581, 11, 'VERGARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (582, 11, 'VIANI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (583, 11, 'VILLAGOMEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (584, 11, 'VILLAPINZON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (585, 11, 'VILLETA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (586, 11, 'VIOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (587, 11, 'YACOPI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (588, 11, 'ZIPACON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (589, 11, 'ZIPAQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (590, 12, 'QUIBDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (591, 12, 'ACANDI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (592, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (593, 12, 'ATRATO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (594, 12, 'BAGADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (595, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (596, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (597, 12, 'BOJAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (598, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (599, 12, 'CONDOTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (600, 12, 'EL CARMEN DE ATRATO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (601, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (602, 12, 'ISTMINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (603, 12, 'JURADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (604, 12, 'LLORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (605, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (606, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (607, 12, 'NOVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (608, 12, 'NUQUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (609, 12, 'RIOQUITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (610, 12, 'RIOSUCIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (611, 12, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (612, 12, 'SIPI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (613, 12, 'TADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (614, 12, 'UNGUIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (615, 12, 'UNION PANAMERICANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (616, 13, 'NEIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (617, 13, 'ACEVEDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (618, 13, 'AGRADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (619, 13, 'AIPE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (620, 13, 'ALGECIRAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (621, 13, 'ALTAMIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (622, 13, 'BARAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (623, 13, 'CAMPOALEGRE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (624, 13, 'COLOMBIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (625, 13, 'ELIAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (626, 13, 'GARZON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (627, 13, 'GIGANTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (628, 13, 'GUADALUPE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (629, 13, 'HOBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (630, 13, 'IQUIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (631, 13, 'ISNOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (632, 13, 'LA ARGENTINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (633, 13, 'LA PLATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (634, 13, 'NATAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (635, 13, 'OPORAPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (636, 13, 'PAICOL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (637, 13, 'PALERMO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (638, 13, 'PALESTINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (639, 13, 'PITAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (640, 13, 'PITALITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (641, 13, 'RIVERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (642, 13, 'SALADOBLANCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (643, 13, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (644, 13, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (645, 13, 'SUAZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (646, 13, 'TARQUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (647, 13, 'TESALIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (648, 13, 'TELLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (649, 13, 'TERUEL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (650, 13, 'TIMANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (651, 13, 'VILLAVIEJA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (652, 13, 'YAGUARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (653, 14, 'RIOHACHA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (654, 14, 'BARRANCAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (655, 14, 'DIBULLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (656, 14, 'DISTRACCION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (657, 14, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (658, 14, 'FONSECA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (659, 14, 'HATONUEVO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (660, 14, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (661, 14, 'MAICAO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (662, 14, 'MANAURE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (663, 14, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (664, 14, 'URIBIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (665, 14, 'URUMITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (666, 14, 'VILLANUEVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (667, 15, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (668, 15, 'ALGARROBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (669, 15, 'ARACATACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (670, 15, 'ARIGUANI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (671, 15, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (672, 15, 'CHIVOLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (673, 15, 'CIENAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (674, 15, 'CONCORDIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (675, 15, 'EL BANCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (676, 15, 'EL PIÑON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (677, 15, 'EL RETEN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (678, 15, 'FUNDACION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (679, 15, 'GUAMAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (680, 15, 'PEDRAZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (681, 15, '<NAME> (PIJIÑO)', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (682, 15, 'PIVIJAY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (683, 15, 'PLATO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (684, 15, 'PUEBLOVIEJO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (685, 15, 'REMOLINO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (686, 15, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (687, 15, 'SALAMINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (688, 15, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (689, 15, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (690, 15, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (691, 15, 'SITIONUEVO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (692, 15, 'TENERIFE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (693, 16, 'VILLAVICENCIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (694, 16, 'ACACIAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (695, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (696, 16, 'CABUYARO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (697, 16, 'CASTILLA LA NUEVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (698, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (699, 16, 'CUMARAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (700, 16, 'EL CALVARIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (701, 16, 'EL CASTILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (702, 16, 'EL DORADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (703, 16, 'FUENTE DE ORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (704, 16, 'GRANADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (705, 16, 'GUAMAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (706, 16, 'MAPIRIPAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (707, 16, 'MESETAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (708, 16, 'LA MACARENA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (709, 16, 'LA URIBE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (710, 16, 'LEJANIAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (711, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (712, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (713, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (714, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (715, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (716, 16, 'RESTREPO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (717, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (718, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (719, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (720, 16, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (721, 16, 'VISTAHERMOSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (722, 17, 'PASTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (723, 17, 'ALBAN (SAN JOSE)', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (724, 17, 'ALDANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (725, 17, 'ANCUYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (726, 17, 'ARBOLEDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (727, 17, 'BARBACOAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (728, 17, 'BELEN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (729, 17, 'BUESACO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (730, 17, 'COLON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (731, 17, 'CONSACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (732, 17, 'CONTADERO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (733, 17, 'CORDOBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (734, 17, 'CUASPUD', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (735, 17, 'CUMBAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (736, 17, 'CUMBITARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (737, 17, 'CHACHAGUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (738, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (739, 17, 'EL PEÑOL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (740, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (741, 17, 'EL TABLON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (742, 17, 'EL TAMBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (743, 17, 'FUNES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (744, 17, 'GUACHUCAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO `municipios` (`id`, `iddepa`, `nombmuni`, `created_at`, `updated_at`) VALUES (745, 17, 'GUAITARILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (746, 17, 'GUALMATAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (747, 17, 'ILES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (748, 17, 'IMUES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (749, 17, 'IPIALES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (750, 17, 'LA CRUZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (751, 17, 'LA FLORIDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (752, 17, 'LA LLANADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (753, 17, 'LA TOLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (754, 17, 'LA UNION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (755, 17, 'LEIVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (756, 17, 'LINARES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (757, 17, 'LOS ANDES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (758, 17, 'MAGUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (759, 17, 'MALLAMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (760, 17, 'MOSQUERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (761, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (762, 17, 'OSPINA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (763, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (764, 17, 'POLICARPA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (765, 17, 'POTOSI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (766, 17, 'PROVIDENCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (767, 17, 'PUERRES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (768, 17, 'PUPIALES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (769, 17, 'RICAURTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (770, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (771, 17, 'SAMANIEGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (772, 17, 'SANDONA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (773, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (774, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (775, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (776, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (777, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (778, 17, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (779, 17, 'SAPUYES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (780, 17, 'TAMINANGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (781, 17, 'TANGUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (782, 17, 'TUMACO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (783, 17, 'TUQUERRES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (784, 17, 'YACUANQUER', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (785, 18, 'CUCUTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (786, 18, 'ABREGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (787, 18, 'ARBOLEDAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (788, 18, 'BOCHALEMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (789, 18, 'BUCARASICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (790, 18, 'CACOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (791, 18, 'CACHIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (792, 18, 'CHINACOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (793, 18, 'CHITAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (794, 18, 'CONVENCION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (795, 18, 'CUCUTILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (796, 18, 'DURANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (797, 18, 'EL CARMEN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (798, 18, 'EL TARRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (799, 18, 'EL ZULIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (800, 18, 'GRAMALOTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (801, 18, 'HACARI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (802, 18, 'HERRAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (803, 18, 'LABATECA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (804, 18, 'LA ESPERANZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (805, 18, 'LA PLAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (806, 18, 'LOS PATIOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (807, 18, 'LOURDES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (808, 18, 'MUTISCUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (809, 18, 'OCAÑA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (810, 18, 'PAMPLONA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (811, 18, 'PAMPLONITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (812, 18, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (813, 18, 'RAGONVALIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (814, 18, 'SALAZAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (815, 18, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (816, 18, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (817, 18, 'SANTIAGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (818, 18, 'SARDINATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (819, 18, 'SILOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (820, 18, 'TEORAMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (821, 18, 'TIBU', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (822, 18, 'TOLEDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (823, 18, 'VILLACARO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (824, 18, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (825, 19, 'ARMENIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (826, 19, 'BUENAVISTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (827, 19, 'CALARCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (828, 19, 'CIRCASIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (829, 19, 'CORDOBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (830, 19, 'FILANDIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (831, 19, 'GENOVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (832, 19, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (833, 19, 'MONTENEGRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (834, 19, 'PIJAO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (835, 19, 'QUIMBAYA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (836, 19, 'SALENTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (837, 20, 'PEREIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (838, 20, 'APIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (839, 20, 'BALBOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (840, 20, 'BELEN DE UMBRIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (841, 20, 'DOS QUEBRADAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (842, 20, 'GUATICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (843, 20, 'LA CELIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (844, 20, 'LA VIRGINIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (845, 20, 'MARSELLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (846, 20, 'MISTRATO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (847, 20, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (848, 20, 'QUINCHIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (849, 20, '<NAME>A DE CABAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (850, 20, 'SANTUARIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (851, 21, 'BUCARAMANGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (852, 21, 'AGUADA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (853, 21, 'ALBANIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (854, 21, 'ARATOCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (855, 21, 'BARBOSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (856, 21, 'BARICHARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (857, 21, 'BARRANCABERMEJA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (858, 21, 'BETULIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (859, 21, 'BOLIVAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (860, 21, 'CABRERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (861, 21, 'CALIFORNIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (862, 21, 'CAPITANEJO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (863, 21, 'CARCASI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (864, 21, 'CEPITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (865, 21, 'CERRITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (866, 21, 'CHARALA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (867, 21, 'CHARTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (868, 21, 'CHIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (869, 21, 'CHIPATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (870, 21, 'CIMITARRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (871, 21, 'CONCEPCION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (872, 21, 'CONFINES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (873, 21, 'CONTRATACION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (874, 21, 'COROMORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (875, 21, 'CURITI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (876, 21, 'EL CARMEN DE CHUCURY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (877, 21, 'EL GUACAMAYO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (878, 21, 'EL PEÑON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (879, 21, 'EL PLAYON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (880, 21, 'ENCINO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (881, 21, 'ENCISO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (882, 21, 'FLORIAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (883, 21, 'FLORIDABLANCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (884, 21, 'GALAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (885, 21, 'GAMBITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (886, 21, 'GIRON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (887, 21, 'GUACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (888, 21, 'GUADALUPE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (889, 21, 'GUAPOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (890, 21, 'GUAVATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (891, 21, 'GUEPSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (892, 21, 'HATO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (893, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (894, 21, 'JORDAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (895, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (896, 21, 'LANDAZURI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (897, 21, 'LA PAZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (898, 21, 'LEBRIJA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (899, 21, 'LOS SANTOS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (900, 21, 'MACARAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (901, 21, 'MALAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (902, 21, 'MATANZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (903, 21, 'MOGOTES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (904, 21, 'MOLAGAVITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (905, 21, 'OCAMONTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (906, 21, 'OIBA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (907, 21, 'ONZAGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (908, 21, 'PALMAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (909, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (910, 21, 'PARAMO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (911, 21, 'PIEDECUESTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (912, 21, 'PINCHOTE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (913, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (914, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (915, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (916, 21, 'RIONEGRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (917, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (918, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (919, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (920, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (921, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (922, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (923, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (924, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (925, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (926, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (927, 21, 'SIMACOTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (928, 21, 'SOCORRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (929, 21, 'SUAITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (930, 21, 'SUCRE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (931, 21, 'SURATA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (932, 21, 'TONA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (933, 21, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (934, 21, 'VELEZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (935, 21, 'VETAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (936, 21, 'VILLANUEVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (937, 21, 'ZAPATOCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (938, 22, 'SINCELEJO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (939, 22, 'BUENAVISTA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (940, 22, 'CAIMITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (941, 22, 'COLOSO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (942, 22, 'COROZAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (943, 22, 'CHALAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (944, 22, 'GALERAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (945, 22, 'GUARANDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (946, 22, 'LA UNION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (947, 22, 'LO<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (948, 22, 'MAJAGUAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (949, 22, 'MORROA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (950, 22, 'OVEJAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (951, 22, 'PALMITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (952, 22, 'SAMPUES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (953, 22, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (954, 22, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (955, 22, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (956, 22, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (957, 22, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (958, 22, 'SINCE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (959, 22, 'SUCRE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (960, 22, 'TOLU', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (961, 22, 'TOLUVIEJO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (962, 23, 'IBAGUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (963, 23, 'ALPUJARRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (964, 23, 'ALVARADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (965, 23, 'AMBALEMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (966, 23, 'ANZOATEGUI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (967, 23, 'ARMERO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (968, 23, 'ATACO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (969, 23, 'CAJAMARCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (970, 23, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (971, 23, 'CASABIANCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (972, 23, 'CHAPARRAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (973, 23, 'COELLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (974, 23, 'COYAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (975, 23, 'CUNDAY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (976, 23, 'DOLORES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (977, 23, 'ESPINAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (978, 23, 'FALAN', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (979, 23, 'FLANDES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (980, 23, 'FRESNO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (981, 23, 'GUAMO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (982, 23, 'HERVEO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (983, 23, 'HONDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (984, 23, 'ICONONZO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (985, 23, 'LERIDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (986, 23, 'LIBANO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (987, 23, 'MARIQUITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (988, 23, 'MELGAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (989, 23, 'MURILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (990, 23, 'NATAGAIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (991, 23, 'ORTEGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (992, 23, 'PALOCABILDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (993, 23, 'PIEDRAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (994, 23, 'PLANADAS', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (995, 23, 'PRADO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (996, 23, 'PURIFICACION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (997, 23, 'RIOBLANCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (998, 23, 'RONCESVALLES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (999, 23, 'ROVIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1000, 23, 'SALDAÑA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1001, 23, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1002, 23, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1003, 23, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1004, 23, 'SUAREZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1005, 23, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1006, 23, 'VENADILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1007, 23, 'VILLAHERMOSA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1008, 23, 'VILLARRICA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1009, 24, 'CALI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1010, 24, 'ALCALA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1011, 24, 'ANDALUCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1012, 24, 'ANSERMANUEVO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1013, 24, 'ARGELIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1014, 24, 'BOLIVAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1015, 24, 'BUENAVENTURA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1016, 24, 'BUGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1017, 24, 'BUGALAGRANDE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1018, 24, 'CAICEDONIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1019, 24, 'CALIMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1020, 24, 'CANDELARIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1021, 24, 'CARTAGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1022, 24, 'DAGUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1023, 24, 'EL AGUILA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1024, 24, 'EL CAIRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1025, 24, 'EL CERRITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1026, 24, 'EL DOVIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1027, 24, 'FLORIDA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1028, 24, 'GINEBRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1029, 24, 'GUACARI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1030, 24, 'JAMUNDI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1031, 24, 'LA CUMBRE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1032, 24, 'LA UNION', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1033, 24, 'LA VICTORIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1034, 24, 'OBANDO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1035, 24, 'PALMIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1036, 24, 'PRADERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1037, 24, 'RESTREPO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1038, 24, 'RIOFRIO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1039, 24, 'ROLDANILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1040, 24, 'SAN PEDRO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1041, 24, 'SEVILLA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1042, 24, 'TORO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1043, 24, 'TRUJILLO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1044, 24, 'TULUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1045, 24, 'ULLOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1046, 24, 'VERSALLES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1047, 24, 'VIJES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1048, 24, 'YOTOCO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1049, 24, 'YUMBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1050, 24, 'ZARZAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1051, 25, 'ARAUCA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1052, 25, 'ARAUQUITA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1053, 25, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1054, 25, 'FORTUL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1055, 25, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1056, 25, 'SARAVENA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1057, 25, 'TAME', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1058, 26, 'YOPAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1059, 26, 'AGUAZUL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1060, 26, 'CHAMEZA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1061, 26, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1062, 26, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1063, 26, 'MANI', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1064, 26, 'MONTERREY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1065, 26, 'NUNCHIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1066, 26, 'OROCUE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1067, 26, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1068, 26, 'PORE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1069, 26, 'RECETOR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1070, 26, 'SABANALARGA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1071, 26, 'SACAMA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1072, 26, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1073, 26, 'TAMARA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1074, 26, 'TAURAMENA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1075, 26, 'TRINIDAD', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1076, 26, 'VILLANUEVA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1077, 27, 'MOCOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1078, 27, 'COLON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1079, 27, 'ORITO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1080, 27, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1081, 27, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1082, 27, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1083, 27, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1084, 27, 'SIBUNDOY', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1085, 27, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1086, 27, '<NAME> (LA DORADA)', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1087, 27, 'SANTIAGO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1088, 27, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1089, 27, 'VILLAGARZON', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1090, 28, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1091, 28, 'PROVIDENCIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1092, 29, 'LETICIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1093, 29, 'EL ENCANTO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1094, 29, 'LA CHORRERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1095, 29, 'LA PEDRERA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1096, 29, 'LA VICTORIA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1097, 29, 'MIRITI-PARANA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1098, 29, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1099, 29, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1100, 29, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1101, 29, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1102, 29, 'TARAPACA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1103, 30, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1104, 30, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1105, 30, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1106, 30, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1107, 30, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1108, 30, 'CACAHUAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1109, 30, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1110, 30, 'MORICHAL', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1111, 31, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1112, 31, 'CALAMAR', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1113, 31, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1114, 31, 'MIRAFLORES', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1115, 32, 'MITU', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1116, 32, 'CARURU', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1117, 32, 'PACOA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1118, 32, 'TARAIRA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1119, 32, 'PAPUNAUA', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1120, 32, 'YAVARATE', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1121, 33, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1122, 33, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1123, 33, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1124, 33, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1125, 33, '<NAME>', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (1126, 33, 'CUMARIBO', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal_access_tokens` -- CREATE TABLE `personal_access_tokens` ( `id` bigint(20) UNSIGNED NOT NULL, `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `tokenable_id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `last_used_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `terceros` -- CREATE TABLE `terceros` ( `id` bigint(20) UNSIGNED NOT NULL, `tipoidentificacion` enum('CC','TI','TP','RC','CE') COLLATE utf8mb4_unicode_ci NOT NULL, `numeroidentificacion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `idtipotercero` bigint(20) UNSIGNED NOT NULL, `nombre1` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `nombre2` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `apellido1` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `apellido2` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `iddepartamento` bigint(20) UNSIGNED NOT NULL, `idmunicipio` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `terceros` -- INSERT INTO `terceros` (`id`, `tipoidentificacion`, `numeroidentificacion`, `idtipotercero`, `nombre1`, `nombre2`, `apellido1`, `apellido2`, `iddepartamento`, `idmunicipio`, `created_at`, `updated_at`) VALUES (3, 'CC', '1070619406', 4, 'Cristian', 'Javier', 'Aparicio', 'Tique', 11, 509, '2022-02-04 05:00:00', '2022-02-04 05:00:00'), (4, 'CC', '43445645656', 1, 'Javier', 'Cristian', 'Tique', 'Rojas', 1, 1, '2022-02-05 04:56:31', '2022-02-05 04:56:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipoterceros` -- CREATE TABLE `tipoterceros` ( `id` bigint(20) UNSIGNED NOT NULL, `nombtipo` enum('Paciente','Empleado','Contratista','Otro') COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `tipoterceros` -- INSERT INTO `tipoterceros` (`id`, `nombtipo`, `created_at`, `updated_at`) VALUES (1, 'Paciente', '2022-02-04 20:45:05', '2022-02-04 20:45:09'), (2, 'Empleado', '2022-02-04 20:45:13', '2022-02-04 20:45:17'), (3, 'Contratista', '2022-02-04 05:00:00', '2022-02-04 05:00:00'), (4, 'Otro', '2022-02-04 05:00:00', '2022-02-04 05:00:00'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `departamentos` -- ALTER TABLE `departamentos` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `municipios` -- ALTER TABLE `municipios` ADD PRIMARY KEY (`id`), ADD KEY `municipios_iddepa_foreign` (`iddepa`); -- -- Indices de la tabla `personal_access_tokens` -- ALTER TABLE `personal_access_tokens` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`), ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`); -- -- Indices de la tabla `terceros` -- ALTER TABLE `terceros` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `terceros_numeroidentificacion_unique` (`numeroidentificacion`), ADD KEY `terceros_idtipotercero_foreign` (`idtipotercero`), ADD KEY `terceros_iddepartamento_foreign` (`iddepartamento`), ADD KEY `terceros_idmunicipio_foreign` (`idmunicipio`); -- -- Indices de la tabla `tipoterceros` -- ALTER TABLE `tipoterceros` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `departamentos` -- ALTER TABLE `departamentos` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; -- -- AUTO_INCREMENT de la tabla `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `municipios` -- ALTER TABLE `municipios` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1127; -- -- AUTO_INCREMENT de la tabla `personal_access_tokens` -- ALTER TABLE `personal_access_tokens` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `terceros` -- ALTER TABLE `terceros` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `tipoterceros` -- ALTER TABLE `tipoterceros` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `municipios` -- ALTER TABLE `municipios` ADD CONSTRAINT `municipios_iddepa_foreign` FOREIGN KEY (`iddepa`) REFERENCES `departamentos` (`id`) ON DELETE CASCADE; -- -- Filtros para la tabla `terceros` -- ALTER TABLE `terceros` ADD CONSTRAINT `terceros_iddepartamento_foreign` FOREIGN KEY (`iddepartamento`) REFERENCES `departamentos` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `terceros_idmunicipio_foreign` FOREIGN KEY (`idmunicipio`) REFERENCES `municipios` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `terceros_idtipotercero_foreign` FOREIGN KEY (`idtipotercero`) REFERENCES `tipoterceros` (`id`) ON DELETE CASCADE; 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 */;
<gh_stars>0 CREATE TABLE sys.conversation_groups ( conversation_group_id uniqueidentifier NOT NULL, service_id int NOT NULL, is_system bit );
-- # Problem: https://www.hackerrank.com/challenges/japan-population/problem -- # Score: 10 SELECT SUM(Population) FROM City WHERE COUNTRYCODE = 'JPN';
{% sql 'users_by_country', note='counts users' %} SELECT count(*) AS count FROM user WHERE country_code = 'UA' {% endsql %} {% sql 'select_all' %} SELECT * FROM user {% endsql %} {% sql 'select_all_with_comment' %} -- select all users with all fields, really SELECT * FROM user {% endsql %} {% sql 'users_count_cond', note='counts users by country' %} SELECT count(*) AS count FROM user {% if by_country -%} WHERE country_code = {{ country_code }} {%- endif %} {% endsql %} {% sql 'users_select_cond', note='select users with condition' %} SELECT * FROM user {% if users_ids -%} WHERE user_id IN ({{ users_ids|join(', ') }}) {%- endif %} {% endsql %} {% sql 'users_escaping', note='try to escape' %} SELECT * FROM user {% if user_name -%} WHERE user_name = {{ user_name|guards.string }} {%- endif %} {% endsql %}
-- Mar 6, 2017 10:26 PM -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_TIMESTAMP('2017-03-06 22:26:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3792 ;
<gh_stars>0 CREATE DATABASE notes_app; USE [notes_app] GO /****************************** USERS INFORMATION ****************************************/ CREATE SCHEMA NotesUsers AUTHORIZATION dbo; GO CREATE TABLE [NotesUsers].[User]( id uniqueidentifier CONSTRAINT DFT_user_id DEFAULT NEWID(), username NVARCHAR(28) NOT NULL, email NVARCHAR(1024) NOT NULL, password NVARCHAR(MAX) NOT NULL, dob DATE NOT NULL, CONSTRAINT UNIQUE_username UNIQUE(username), CONSTRAINT PK_Users PRIMARY KEY(id) ); ALTER TABLE [NotesUsers].[User] ADD CONSTRAINT chk_username CHECK(LEN(username) >= 8 and LEN(username) <= 28); ALTER TABLE [NotesUsers].[User] ADD CONSTRAINT chk_dob CHECK(YEAR(dob) >= YEAR(CAST('19900101' AS DATE)) and YEAR(dob) <= YEAR(CAST(SYSDATETIME() AS DATE))); ALTER TABLE [NotesUsers].[User] ADD CONSTRAINT Unique_email UNIQUE(email); CREATE TABLE [NotesUsers].[Token]( id uniqueidentifier PRIMARY KEY CONSTRAINT DFT_token_id DEFAULT NEWID(), token NVARCHAR(500) NOT NULL, createdAt DATE NOT NULL CONSTRAINT DFT_token_createdAt DEFAULT GETDATE(), userID uniqueidentifier NOT NULL, CONSTRAINT FK_token_user FOREIGN KEY(userID) REFERENCES [NotesUsers].[User](id) ON DELETE CASCADE ); /****************************** NOTES INFORMATION ****************************************/ CREATE SCHEMA NotesInfo AUTHORIZATION dbo; CREATE TABLE [NotesInfo].[Notes]( id uniqueidentifier CONSTRAINT DFT_note_id DEFAULT NEWID(), title NVARCHAR(MAX) NOT NULL, note NVARCHAR(MAX) NOT NULL, createdAt DATETIME2(7)NOT NULL CONSTRAINT DFT_noteCreation DEFAULT GETDATE(), updatedAt DATETIME2(7) NULL, userId uniqueidentifier NOT NULL, CONSTRAINT FK_userID FOREIGN KEY(userId) REFERENCES [NotesUsers].[User](id) ON DELETE CASCADE, CONSTRAINT PK_notes PRIMARY KEY(id) ); CREATE TABLE [NotesInfo].[Comments]( id uniqueidentifier PRIMARY KEY CONSTRAINT DFT_comment_id DEFAULT NEWID(), NoteId uniqueidentifier NOT NULL, NoteOwner NVARCHAR(28) NOT NULL, CommentOwner NVARCHAR(28) NOT NULL, CommentValue NVARCHAR(MAX) NOT NULL, CreatedAt DATETIME2(7) CONSTRAINT DFT_createdAt DEFAULT GETDATE(), CONSTRAINT FK_note_id FOREIGN KEY(NoteId) REFERENCES [NotesInfo].[Notes](id) ON DELETE CASCADE, CONSTRAINT FK_note_owner FOREIGN KEY(NoteOwner) REFERENCES [NotesUsers].[User](username) ON DELETE NO ACTION, CONSTRAINT FK_comment_owner FOREIGN KEY(NoteOwner) REFERENCES [NotesUsers].[User](username) ON DELETE NO ACTION ); /******************************* Real Time Connections *************************************/ CREATE SCHEMA real_time_processing AUTHORIZATION dbo; CREATE TABLE [real_time_processing].[connections]( connectionId NVARCHAR(256) PRIMARY KEY, userAgent NVARCHAR(MAX) NOT NULL, connected BIT NOT NULL DEFAULT(0) ); @"SELECT username " " FROM [NotesUsers].[User] " + " WHERE username NOT IN ( " + " SELECT CommentOwner " + " FROM [NotesInfo].[Comments] " + " WHERE NoteOwner <> @user AND CommentOwner = @user) " + " AND NOT IN ( " + " SELECT CommentOwner " + " FROM [NotesInfo].[Comments] " + " WHERE NoteOwner = @user AND CommentOwner <> @user);"; /*******************************************************************************************/ SELECT username FROM [NotesUsers].[User] WHERE username NOT IN ( SELECT CommentOwner FROM [NotesInfo].[Comments] WHERE NoteOwner <> @user AND CommentOwner = @user ) AND username NOT IN( SELECT CommentOwner FROM [NotesInfo].[Comments] WHERE NoteOwner = @user AND CommentOwner <> @user) AND username <> @user;
<reponame>bsanchezdev/p_solvencia ALTER TABLE `deuda` DROP COLUMN `FECHA_ENVIO`, DROP COLUMN `ROL`, DROP COLUMN `PAGADO`;
/* SQLyog Ultimate v11.24 (32 bit) MySQL - 5.6.46 : Database - otasos ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!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 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`otasos` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE `otasos`; /*Table structure for table `contacts` */ CREATE TABLE `contacts` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `uid` bigint(20) DEFAULT '0', `uname` varchar(20) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL, `remake` varchar(20) DEFAULT '""', `available` tinyint(2) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Table structure for table `device` */ CREATE TABLE `device` ( `id` int(11) NOT NULL AUTO_INCREMENT, `deviceName` varchar(50) DEFAULT NULL, `firmwareName` varchar(50) DEFAULT NULL, `version` varchar(10) DEFAULT NULL, `updateTime` varchar(50) DEFAULT '2017年12月1日以前', `info` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `deviceName` (`deviceName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Table structure for table `history_sos` */ CREATE TABLE `history_sos` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `uid` bigint(20) DEFAULT NULL, `info` varchar(50) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL, `sendTime` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `device_bind_info` */ CREATE TABLE `device_bind_info` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `uid` bigint(20) DEFAULT NULL, `serial_number` varchar(64) DEFAULT NULL, `state` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
<gh_stars>0 Copy (select u.id, u.username, ud.email from "user" u join user_detail ud on u.id = ud.id order by u.id) To '/tmp/users.csv' With CSV;
/* For GVCO Project with status of Done for Issue Type Content Batch */ SELECT (CAST(p.pkey as varchar) + CAST(' - ' as varchar) + CAST(ji.issuenum as varchar)) as issuekey,ji.issuenum,ci.FIELD,ci.OLDSTRING,ci.NEWSTRING,ji.CREATED,cg.CREATED as transitiontime,cg.AUTHOR, DATEDIFF(DAY,ji.CREATED,cg.CREATED) as resolutiontime FROM changeitem ci JOIN changegroup cg ON cg.ID = ci.groupid JOIN jiraissue ji ON ji.ID = cg.issueid JOIN issuestatus iss ON iss.ID = ji.issuestatus JOIN project p ON p.ID = ji.PROJECT JOIN project_key pk ON pk.PROJECT_ID = P.ID WHERE pk.PROJECT_KEY = 'GVCO' AND ci.FIELD = 'status' AND ji.issuestatus = 10019 AND ji.issuetype = 11402 AND NEWSTRING LIKE 'Done' ORDER BY ji.issuenum DESC
CREATE TABLE guestbook_message ( id BIGINT NOT NULL AUTO_INCREMENT, name CHAR(128) NOT NULL, message CHAR(255), image_uri CHAR(255), PRIMARY KEY (id) );
<filename>db/migrations/sqlite/000041_drop_operations_member.up.sql ALTER TABLE operations DROP COLUMN member;
-- Copyright 2021 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. WITH high_watermark_filter AS ( SELECT IFNULL(MAX(execution_ts), TIMESTAMP("1970-01-01 00:00:00")) as high_watermark FROM `<your_gcp_project_id>.<your_bigquery_dataset_id>.dq_summary` WHERE table_id = '<your_gcp_project_id>.<your_bigquery_dataset_id>.contact_details' AND rule_binding_id = 'T1_DQ_1_VALUE_NOT_NULL' AND progress_watermark IS TRUE ), zero_record AS ( SELECT 'T1_DQ_1_VALUE_NOT_NULL' AS rule_binding_id, ), data AS ( SELECT *, 'T1_DQ_1_VALUE_NOT_NULL' AS rule_binding_id, FROM `<your_gcp_project_id>.<your_bigquery_dataset_id>.contact_details` d ,high_watermark_filter WHERE CAST(d.ts AS TIMESTAMP) > high_watermark_filter.high_watermark AND True ), last_mod AS ( SELECT project_id || '.' || dataset_id || '.' || table_id AS table_id, TIMESTAMP_MILLIS(last_modified_time) AS last_modified FROM `<your_gcp_project_id>.<your_bigquery_dataset_id>.__TABLES__` ), validation_results AS ( SELECT CURRENT_TIMESTAMP() AS execution_ts, 'T1_DQ_1_VALUE_NOT_NULL' AS rule_binding_id, 'NOT_NULL_SIMPLE' AS rule_id, '<your_gcp_project_id>.<your_bigquery_dataset_id>.contact_details' AS table_id, 'value' AS column_id, data.value AS column_value, CAST(NULL AS STRING) AS dimension, CASE WHEN value IS NOT NULL THEN TRUE ELSE FALSE END AS simple_rule_row_is_valid, TRUE AS skip_null_count, CAST(NULL AS INT64) AS complex_rule_validation_errors_count, CAST(NULL AS BOOLEAN) AS complex_rule_validation_success_flag, FROM zero_record LEFT JOIN data ON zero_record.rule_binding_id = data.rule_binding_id ), all_validation_results AS ( SELECT r.execution_ts AS execution_ts, r.rule_binding_id AS rule_binding_id, r.rule_id AS rule_id, r.table_id AS table_id, r.column_id AS column_id, CAST(r.dimension AS STRING) AS dimension, r.skip_null_count AS skip_null_count, r.simple_rule_row_is_valid AS simple_rule_row_is_valid, r.complex_rule_validation_errors_count AS complex_rule_validation_errors_count, r.complex_rule_validation_success_flag AS complex_rule_validation_success_flag, r.column_value AS column_value, (SELECT COUNT(*) FROM data) AS rows_validated, last_mod.last_modified, '{}' AS metadata_json_string, '' AS configs_hashsum, CAST(NULL AS STRING) AS dataplex_lake, CAST(NULL AS STRING) AS dataplex_zone, CAST(NULL AS STRING) AS dataplex_asset_id, CONCAT(r.rule_binding_id, '_', r.rule_id, '_', r.execution_ts, '_', True) AS dq_run_id, TRUE AS progress_watermark, FROM validation_results r JOIN last_mod USING(table_id) ) SELECT * FROM all_validation_results
INSERT INTO Type SELECT id + 1, 'mds.field.description.relationship','mds.field.relationship','relationshipName','org.motechproject.mds.domain.Relationship' FROM Type ORDER BY id DESC LIMIT 1; INSERT INTO Type SELECT id + 1, 'mds.field.description.relationship.oneToMany','mds.field.relationship.oneToMany','oneToManyRelationshipName','org.motechproject.mds.domain.OneToManyRelationship' FROM Type ORDER BY id DESC LIMIT 1; UPDATE SEQUENCE_TABLE SET NEXT_VAL = (SELECT id + 1 FROM Type ORDER BY id DESC LIMIT 1) WHERE SEQUENCE_NAME LIKE 'org.motechproject.mds.domain.Type';
insert into waffle_switch (name, active, note) values ('soft_delete', 0, 'Set addons/webapps to STATUS_DELETED instead of removing them');
<reponame>AaronFeickert/tari CREATE TABLE outputs ( spending_key BLOB PRIMARY KEY NOT NULL, value INTEGER NOT NULL, flags INTEGER NOT NULL, maturity INTEGER NOT NULL, status INTEGER NOT NULL, tx_id INTEGER NULL ); CREATE TABLE pending_transaction_outputs ( tx_id BIGINT PRIMARY KEY NOT NULL, short_term INTEGER NOT NULL, timestamp DATETIME NOT NULL ); CREATE TABLE key_manager_states ( id INTEGER PRIMARY KEY, master_seed BLOB NOT NULL, branch_seed TEXT NOT NULL, primary_key_index INTEGER NOT NULL, timestamp DATETIME NOT NULL );
<gh_stars>0 CREATE DATABASE M_OpFlix; USE M_OpFlix; create table Midias( IdMidia int primary key identity ,Nome varchar(200) not null ); create table Generos( IdGenero int primary key identity ,Nome varchar(200) not null ); create table Plataformas( IdPlataforma int primary key identity ,Nome varchar(200) not null ); create table Novidades( IdNovidade int primary key identity ,Nome varchar(200) not null ,IdMidia int Not null Foreign key references Midias(IdMidia) ,IdGenero int Not null Foreign key references Generos(IdGenero) ,Descricao varchar(500) ,Lancamento Date not null ,IdPlataforma int Not null Foreign key references Plataformas(IdPlataforma) ); create table TiposUsuarios( IdTipo int primary key identity ,Nome varchar(200) not null ); create table Cadastros( IdUsuario int primary key identity ,Nome varchar(200) not null ,Email varchar(200) not null ,Senha varchar(200) not null ,IdTipo int Not null Foreign key references TiposUsuarios(IdTipo) ); create table Favoritos( IdNovidade int Not null Foreign key references Novidades(IdNovidade) ,IdUsuario int Not null Foreign key references Cadastros(IdUsuario) );
use mysql; create user 'gergas'@'localhost' identified by "gergas2021"; create database bd_gergas; use bd_gergas; create table bd_gergas(codi smallint, nom varchar(20), cognoms varchar(50), email varchar (50)); alter table tl_gergas add primary key(codi); grant select,insert,delete, update on bd_gergas.tl_gergas to 'gergas'@'localhost'; insert into tl_gergas values(1,"anna", "<NAME>", "<EMAIL>"); insert into tl_gergas values(2,"joan", "<NAME>", "<EMAIL>"); insert into tl_gergas values(3,"pere", "<NAME>", "<EMAIL>"); insert into tl_gergas values(4,"marta", "<NAME>", "<EMAIL>"); insert into tl_gergas values(5,"salvador", "<NAME>", "<EMAIL>"); show tables; select * from tl_gergas; show grants for 'gergas'@'localhost';
<filename>sql/Robna Kartica/RobnaK.sql --select * from --( Select --+ INDEX( STAVKA_DOK STAVKA_DOK_PROIZVOD ) INDEX( DOKUMENT DOKUMENT_PK ) Proizvod, Datum_Dok, sd.Godina, sd.Broj_Dok, sd.Vrsta_Dok, K_Robe, Kolicina, Faktor, Kontrola, Realizovano, Kolicina_Kontrolna,sd.Cena1, D.Tip_Dok,sd.cena, D.Broj_Dok1 -- ,( -- select cena ---- datum_dok, DATUM_UNOSA ---- , d1.godina god, d1.vrsta_dok vrd, d1.broj_dok brd, org_deo mag, sd1.proizvod pro, sd1.cena, sd1.cena1, kolicina kol, realizovano rlz ---- , sd1.valuta VAL, sd1.k_robe KR, sd1.faktor FK -- from stavka_dok sd1 , dokument d1 -- Where sd1.godina = d1.godina and sd1.vrsta_dok = d1.vrsta_dok and sd1.broj_dok = d1.broj_dok -- ----------------------------- -- -- ostali uslovi -- and d1.godina = 2009 and d1.vrsta_dok = 80 and d1.org_deo = 103 and d1.status > 0 and proizvod = sd.proizvod -- and d.datum_dok = d1.datum_dok and to_char(d.DATUM_UNOSA,'dd.mm.yyyy') = to_char(d1.datum_unosa,'dd.mm.yyyy') -- ) niv From Stavka_Dok sd, Dokument d Where --Proizvod = 6845 And D.Vrsta_Dok = sd.Vrsta_Dok And D.Broj_Dok = sd.Broj_Dok And D.Godina = sd.Godina And d.godina = 2012 and (sd.K_Robe != 0 OR d.vrsta_dok = '80') And D.Org_Deo = 103 And D.Status > 0 and proizvod <> 399 And D.Datum_Dok Between (Select max(d.datum_dok) from dokument where vrsta_Dok = 21 and godina = 2012 and Org_Deo = 103) And sysdate--to_date('30.11.2009','dd.mm.yyyy') And --) --where niv is not null Order By To_Number( Proizvod ), Datum_Dok,Datum_Unosa;
CREATE TABLE [dbo].[ProjectBugs] ( [Id] INT NOT NULL IDENTITY(1,1) ,[Title] NVARCHAR(250) NOT NULL ,[WorkItemId] INT NOT NULL ,[ProjectId] INT NOT NULL ,[OriginDateOffset] DATETIMEOFFSET NOT NULL ,[DateCreatedOffset] DATETIMEOFFSET NOT NULL CONSTRAINT [PK_ProjectBugs] PRIMARY KEY ([Id]), CONSTRAINT [FK_ProjectBugs_Projects] FOREIGN KEY ([ProjectId]) REFERENCES [Projects]([Id]) )
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: 2017-12-18 14:43:08 -- 服务器版本: 5.7.18 -- PHP Version: 5.6.26 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: `edusys` -- -- -------------------------------------------------------- -- -- 表的结构 `answers` -- CREATE TABLE `answers` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `article_id` int(10) UNSIGNED NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `votes_count` int(11) NOT NULL DEFAULT '0', `comments_count` int(11) NOT NULL DEFAULT '0', `is_hidden` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `close_comment` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `is_first` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `answers` -- INSERT INTO `answers` (`id`, `user_id`, `article_id`, `body`, `votes_count`, `comments_count`, `is_hidden`, `close_comment`, `is_first`, `created_at`, `updated_at`) VALUES (1, 1, 3, '<p><span style=\"color: rgb(82, 82, 82); font-family: &quot;Source Sans Pro&quot;, sans-serif; font-size: 14.5px; line-height: 24.65px; widows: 1; background-color: rgb(255, 255, 255);\">每个命令也包含了「帮助」界面,它会显示并概述命令可使的参数及选项</span></p>', 1, 27, 'F', 'F', 'F', '2017-06-02 16:29:12', '2017-12-08 09:19:19'), (2, 1, 3, '<p>bilibilibilibili<br/></p>', 1, 8, 'F', 'F', 'F', '2017-06-02 16:42:21', '2017-06-28 22:15:30'), (3, 1, 3, '<p>1<br/></p>', 1, 2, 'F', 'F', 'F', '2017-06-02 16:56:51', '2017-06-21 16:58:51'), (4, 1, 3, '<p>123456789012</p>', 0, 2, 'F', 'F', 'F', '2017-06-02 17:00:59', '2017-06-21 17:23:57'), (5, 3, 8, '<p>年后</p><p><br/></p>', 1, 3, 'F', 'F', 'F', '2017-06-28 22:14:30', '2017-06-29 10:13:14'), (6, 3, 8, '<p>。。。。。。。。。。。。。。。。。。</p>', 0, 0, 'F', 'F', 'F', '2017-06-28 22:14:48', '2017-06-28 22:14:48'), (7, 1, 8, '<p>haokankankanakana</p>', 0, 0, 'F', 'F', 'F', '2017-07-26 09:51:38', '2017-07-26 09:51:47'), (8, 1, 10, '<p>1111111111111111111111111</p>', 0, 0, 'F', 'F', 'F', '2017-12-12 09:03:07', '2017-12-12 09:03:07'); -- -------------------------------------------------------- -- -- 表的结构 `articles` -- CREATE TABLE `articles` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `comments_count` int(11) NOT NULL DEFAULT '0', `followers_count` int(11) NOT NULL DEFAULT '1', `answers_count` int(11) NOT NULL DEFAULT '0', `close_comment` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `is_hidden` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `is_first` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `articles` -- INSERT INTO `articles` (`id`, `title`, `body`, `user_id`, `comments_count`, `followers_count`, `answers_count`, `close_comment`, `is_hidden`, `is_first`, `created_at`, `updated_at`) VALUES (2, '复仇者联盟', '<p><img src=\"/uploads/ueditor/php/upload/image/20170601/1496305199244508.jpeg\" title=\"1496305199244508.jpeg\" alt=\"75F58PICfj9.jpg\"/></p><p>《复仇者联盟》<em>(Marvel&#39;s The Avengers)</em>是<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E6%BC%AB%E5%A8%81\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">漫威</a>影业出品的一部科幻动作电影,取材自漫威漫画,是<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E6%BC%AB%E5%A8%81%E7%94%B5%E5%BD%B1%E5%AE%87%E5%AE%99\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">漫威电影宇宙</a>的第六部电影,同时也是第一阶段的收官作品。由<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E4%B9%94%E6%96%AF%C2%B7%E9%9F%A6%E7%99%BB\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">乔斯·韦登</a>执导,<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%B0%8F%E7%BD%97%E4%BC%AF%E7%89%B9%C2%B7%E5%94%90%E5%B0%BC\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">小罗伯特·唐尼</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%85%8B%E9%87%8C%E6%96%AF%C2%B7%E5%9F%83%E6%96%87%E6%96%AF\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">克里斯·埃文斯</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%85%8B%E9%87%8C%E6%96%AF%C2%B7%E6%B5%B7%E5%A7%86%E6%96%AF%E6%B2%83%E6%96%AF\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">克里斯·海姆斯沃斯</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%A9%AC%E5%85%8B%C2%B7%E9%B2%81%E6%B3%95%E6%B4%9B\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">马克·鲁法洛</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E6%96%AF%E5%98%89%E4%B8%BD%C2%B7%E7%BA%A6%E7%BF%B0%E9%80%8A\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">斯嘉丽·约翰逊</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E6%9D%B0%E7%91%9E%E7%B1%B3%C2%B7%E9%9B%B7%E7%BA%B3\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">杰瑞米·雷纳</a>和<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E6%B1%A4%E5%A7%86%C2%B7%E5%B8%8C%E5%BE%B7%E5%8B%92%E6%96%AF%E9%A1%BF\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">汤姆·希德勒斯顿</a>联袂出演。影片于2012年5月5日在中国内地正式上映。</p><p>影片讲述了<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E7%A5%9E%E7%9B%BE%E5%B1%80\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">神盾局</a>指挥官<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%B0%BC%E5%85%8B%C2%B7%E5%BC%97%E7%91%9E\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">尼克·弗瑞</a>为了对付《<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%9B%B7%E7%A5%9E/871772\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">雷神</a>》中被流放的洛基,积极奔走寻找最强者,在神盾局斡旋下将<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%92%A2%E9%93%81%E4%BE%A0/1918968\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">钢铁侠</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD%E9%98%9F%E9%95%BF\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">美国队长</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%9B%B7%E7%A5%9E%E6%89%98%E5%B0%94/3804120\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">雷神托尔</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E7%BB%BF%E5%B7%A8%E4%BA%BA/65931\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">绿巨人</a>、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%BB%91%E5%AF%A1%E5%A6%87\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">黑寡妇</a>和<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%B9%B0%E7%9C%BC%E4%BE%A0\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">鹰眼侠</a>六位超级英雄集结在一起,组成了复仇者联盟,共同携手应对邪神洛基<a class=\"sup-anchor\" style=\"color: rgb(19, 110, 194); position: relative; top: -50px; font-size: 0px; line-height: 0;\">&nbsp;</a>&nbsp;。</p><p><br/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-06-01 16:20:20', '2017-06-01 16:20:20'), (3, 'Laravel 5.5 将是下一个 LTS 版本,预计 7/8 月份发布', '<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 1.46em; color: rgb(68, 68, 67); font-family: Georgia, &quot;Xin Gothic&quot;, &quot;Hiragino Sans GB&quot;, &quot;Droid Sans Fallback&quot;, &quot;Microsoft YaHei&quot;, sans-serif; font-size: 18px; line-height: 29.16px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">Laravel 的上一个 LTS(长期支持)版本是 Laravel 5.1,发布于 2015 年 6 月,按照对 LTS 版本的约定,两年的 bug 修复支持到今年中旬就结束了,所以今年中旬必然要出一个 LTS 后继版本,就是 Laravel 5.5。</p><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 1.46em; color: rgb(68, 68, 67); font-family: Georgia, &quot;Xin Gothic&quot;, &quot;Hiragino Sans GB&quot;, &quot;Droid Sans Fallback&quot;, &quot;Microsoft YaHei&quot;, sans-serif; font-size: 18px; line-height: 29.16px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">今天 Laravel 官方在 twitter 上发布消息,Laravel 5.5 版本预计在今年的 7 、8 月份就会发布,遵循约定,Laravel 5.5 LTS 版本同样包含两年的 bug 修复以及三年的安全修复支持。</p><p><img src=\"/uploads/ueditor/php/upload/image/20170602/1496385777774287.png\" title=\"1496385777774287.png\" alt=\"0540baaed781628b02aac992d1c8f.png\"/></p>', 1, 0, 1, 4, 'F', 'F', 'F', '2017-06-02 14:43:31', '2017-06-02 17:00:59'), (4, 'Bootstrap', '<h2 class=\"bs-docs-featurette-title\" style=\"box-sizing: border-box; font-family: -apple-system, system-ui, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, &quot;Helvetica Neue&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, sans-serif; font-weight: 400; line-height: 1.1; color: rgb(51, 51, 51); margin-top: 20px; margin-bottom: 5px; font-size: 40px; text-align: center; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">为所有开发者、所有应用场景而设计。</h2><p class=\"lead\" style=\"box-sizing: border-box; margin: 0px auto 20px; font-size: 21px; line-height: 1.4; max-width: 80%; color: rgb(85, 85, 85); font-family: -apple-system, system-ui, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, &quot;Helvetica Neue&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, sans-serif; text-align: center; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">Bootstrap 让前端开发更快速、简单。所有开发者都能快速上手、所有设备都可以适配、所有项目都适用。</p><hr/><p><img src=\"http://v3.bootcss.com/assets/img/sass-less.png\" alt=\"Sass and Less support\" class=\"img-responsive\"/></p><h3 style=\"box-sizing: border-box; font-family: inherit; font-weight: 400; line-height: 1.1; color: rgb(51, 51, 51); margin-top: 20px; margin-bottom: 5px; font-size: 24px;\">预处理脚本</h3><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px;\">虽然可以直接使用 Bootstrap 提供的 CSS 样式表,不要忘记 Bootstrap 的源码是基于最流行的 CSS 预处理脚本 -&nbsp;<a href=\"http://v3.bootcss.com/css/#less\" style=\"box-sizing: border-box; color: rgb(51, 122, 183); text-decoration-line: none; background-color: transparent;\">Less</a>&nbsp;和&nbsp;<a href=\"http://v3.bootcss.com/css/#sass\" style=\"box-sizing: border-box; color: rgb(51, 122, 183); text-decoration-line: none; background-color: transparent;\">Sass</a>&nbsp;开发的。你可以采用预编译的 CSS 文件快速开发,也可以从源码定制自己需要的样式。</p><p><img src=\"http://v3.bootcss.com/assets/img/devices.png\" alt=\"Responsive across devices\" class=\"img-responsive\"/></p><h3 style=\"box-sizing: border-box; font-family: inherit; font-weight: 400; line-height: 1.1; color: rgb(51, 51, 51); margin-top: 20px; margin-bottom: 5px; font-size: 24px;\">一个框架、多种设备</h3><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px;\">你的网站和应用能在 Bootstrap 的帮助下通过同一份代码快速、有效适配手机、平板、PC 设备,这一切都是 CSS 媒体查询(Media Query)的功劳。</p><p><img src=\"http://v3.bootcss.com/assets/img/components.png\" alt=\"Components\" class=\"img-responsive\"/></p><h3 style=\"box-sizing: border-box; font-family: inherit; font-weight: 400; line-height: 1.1; color: rgb(51, 51, 51); margin-top: 20px; margin-bottom: 5px; font-size: 24px;\">特性齐全</h3><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px;\">Bootstrap 提供了全面、美观的文档。你能在这里找到关于 HTML 元素、HTML 和 CSS 组件、jQuery 插件方面的所有详细文档。</p><p><br/></p>', 3, 0, 1, 0, 'F', 'F', 'F', '2017-06-20 16:05:56', '2017-06-20 16:05:56'), (5, '啦啦啦啦德玛西亚', '<p><strong>粗体</strong></p><p><em>斜体</em></p><p><span style=\"text-decoration: underline;\">下划线</span></p><p><span style=\"border: 1px solid rgb(0, 0, 0);\">边框</span></p><p><span style=\"text-decoration: line-through;\">删除线</span></p><p><sup><span style=\"text-decoration: none;\">上标</span></sup></p><p><sub>下标</sub></p><blockquote><p><span style=\"text-decoration: none;\">引用<br/></span></p></blockquote><p><span style=\"text-decoration: none; background-color: rgb(247, 150, 70);\">橙色</span><span style=\"text-decoration: none;\"><br/></span></p><ol class=\" list-paddingleft-2\" style=\"list-style-type: decimal;\"><li><p>列表1</p></li><li><p>列表2</p></li></ol><p><br/></p><p><span style=\"font-size: 16px; font-style: italic; font-weight: bold; line-height: 18px;\">111</span><br/></p><p><a href=\"http://blog.csdn.net/?ref=toolbar\" target=\"_blank\" title=\"CSDN\">CSDN博客</a><br/></p><p><img src=\"/uploads/ueditor/php/upload/image/20170620/1497948919915313.jpeg\" title=\"1497948919915313.jpeg\" alt=\"63562396c7833aa.jpg\"/></p><p><img src=\"http://img.baidu.com/hi/jx2/j_0002.gif\"/><img src=\"http://img.baidu.com/hi/jx2/j_0004.gif\"/><img src=\"http://img.baidu.com/hi/jx2/j_0007.gif\"/></p><p><img src=\"/uploads/ueditor/php/upload/image/20170620/1497949030429306.png\" title=\"1497949030429306.png\" alt=\"scrawl.png\"/></p><p><br/></p><p><br/></p><p><br/></p><p><br/></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><pre class=\"brush:bash;toolbar:false\">vagrant&nbsp;ssh</pre><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span><br/></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"></span></span></p><hr/><p>2017-06-20<span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\">2017-06-20</span></span><br/></p><p><br/></p><p>16:59:06</p><p>∟</p><p><img width=\"530\" height=\"340\" src=\"http://api.map.baidu.com/staticimage?center=104.023344,30.617042&zoom=11&width=530&height=340&markers=104.023344,30.617042\"/></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p><span style=\"text-decoration: none;\"><span style=\"text-decoration: none;\"><br/></span></span></p><p style=\"display:none;\"><br/></p>', 3, 0, 1, 0, 'F', 'F', 'F', '2017-06-20 17:00:49', '2017-06-20 17:00:49'), (7, 'GitHub', '<p>全球最大的社交编程及代码托管网站GitHub以其开创性的新型软件开发方式并且能高效利用有限的资源通过自力更生实现公司盈利和300%的年收入增长成功的吸引知名风投机构<NAME>一亿美金的投资。新的资金注入将帮助GitHub平台得到进一步的改进和扩展。</p><p>事实上,这不仅对首次接受外部投资的GitHub意义重大,同样对于投资方<NAME>而言,这也是其迄今为止进行过的最大一次单笔投资案。作为投资案的一部分,<NAME>的<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%90%88%E4%BC%99%E4%BA%BA\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">合伙人</a><NAME>将入主GitHub<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E8%91%A3%E4%BA%8B%E4%BC%9A\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">董事会</a>。</p><p>根据GitHub官方解释,这笔资金除了用于扩充员工队伍,改进现有服务并移植到<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E7%A7%BB\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">移</a></p><p><a class=\"image-link\" href=\"http://baike.baidu.com/pic/github/10145341/0/0db2c9ca3ae9e614f21fe7d2?fr=lemma&ct=single\" target=\"_blank\" title=\"Github吉祥物Octocat\" style=\"color: rgb(19, 110, 194); text-decoration-line: none; display: block; width: 220px; height: 220px;\"><img class=\"\" src=\"https://imgsa.baidu.com/baike/s%3D220/sign=f23b0796b74543a9f11bfdce2e178a7b/8b13632762d0f703d0ad4cbe08fa513d2697c5b1.jpg\" alt=\"Github吉祥物Octocat\"/></a><span class=\"description\" style=\"display: block; color: rgb(85, 85, 85); font-size: 12px; text-indent: 0px; font-family: 宋体; word-wrap: break-word; word-break: break-all; line-height: 15px; padding: 8px 7px; min-height: 12px; border-top: 1px solid rgb(224, 224, 224);\">Github吉祥物Octocat</span></p><p>动平台之外,还将服务对象从原来的编程爱好者和专业软件开发人员拓展至企业、<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E8%AE%BE%E8%AE%A1%E5%B8%88\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">设计师</a>、文字<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%B7%A5%E4%BD%9C\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">工作</a>者等更广泛的客户群体。</p><p>GitHub有170万名软件开发人员的忠实用户,他们平均每天更新8万个并新建7千个<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E8%BD%AF%E4%BB%B6%E5%BA%93\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">软件库</a>。对GitHub网站上托管的总计超过300万个软件库,其联合创始人<NAME>曾经形象地称其为“<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E7%A8%8B%E5%BA%8F%E5%91%98\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">程序员</a>的<a target=\"_blank\" href=\"http://baike.baidu.com/item/%E7%BB%B4%E5%9F%BA%E7%99%BE%E7%A7%91\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\">维基百科</a>全书”。</p><p><a class=\"lemma-anchor para-title\" style=\"color: rgb(19, 110, 194); position: absolute; top: -50px;\"></a><a class=\"lemma-anchor \" style=\"color: rgb(19, 110, 194); position: absolute; top: -50px;\"></a><a class=\"lemma-anchor \" style=\"color: rgb(19, 110, 194); position: absolute; top: -50px;\"></a></p><p><br/></p>', 3, 0, 1, 0, 'F', 'F', 'F', '2017-06-21 15:07:07', '2017-06-21 15:07:07'), (8, '变形金刚5:最后的骑士', '<p>地球陷入毁灭危机,擎天柱失踪,越来越多的汽车人和霸天虎来到地球,前海豹突击队成员威廉·伦诺克斯<em>(&nbsp;</em><a target=\"_blank\" href=\"http://baike.baidu.com/item/%E4%B9%94%E4%BB%80%C2%B7%E6%9D%9C%E5%93%88%E6%98%8E\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\"><em>乔什·杜哈明</em></a><em>饰)</em>成为了政府军组建的TRF中的一员,负责绞杀地球上的汽车人——不论好坏。在芝加哥街头,伦诺克斯遇到了凯德·伊格尔<em>(</em><a target=\"_blank\" href=\"http://baike.baidu.com/item/%E9%A9%AC%E5%85%8B%C2%B7%E6%B2%83%E5%B0%94%E4%BC%AF%E6%A0%BC\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\"><em>马克·沃尔伯格</em></a><em>饰)</em>孤儿伊莎贝拉<em>(</em><a target=\"_blank\" href=\"http://baike.baidu.com/item/%E4%BC%8A%E8%8E%8E%E8%B4%9D%E6%8B%89%C2%B7%E8%8E%AB%E5%A5%88\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\"><em>伊莎贝拉·莫奈</em></a><em>饰)</em>。</p><p>凯德因为帮助、支持汽车人而成为政府通缉犯,所以他在一个垃圾场看管着一群幸存的汽车人。与此同时,失踪的擎天柱被女巫昆塔莎黑化,要毁灭地球。拯救世界的责任于是落在了这支由凯德为首的非同寻常的队伍身上,大黄蜂、一位英国爵士<em>(</em><a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%AE%89%E4%B8%9C%E5%B0%BC%C2%B7%E9%9C%8D%E6%99%AE%E9%87%91%E6%96%AF\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\"><em>安东尼·霍普金斯</em></a><em>饰)</em>还有一位牛津大学教授<em>(</em><a target=\"_blank\" href=\"http://baike.baidu.com/item/%E5%8A%B3%E6%8B%89%C2%B7%E5%93%88%E5%BE%B7%E5%85%8B\" style=\"color: rgb(19, 110, 194); text-decoration-line: none;\"><em>劳拉·哈德克</em></a><em>饰)</em>,一场史诗浩劫彻底将地球变成了战场<span style=\"font-size: 12px; line-height: 0; position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; color: rgb(51, 102, 204); cursor: default; padding: 0px 2px;\">[2]</span><a class=\"sup-anchor\" style=\"color: rgb(19, 110, 194); position: relative; top: -50px; font-size: 0px; line-height: 0;\">&nbsp;</a>&nbsp;。</p><p style=\"text-align:center\"><a class=\"image-link\" href=\"http://baike.baidu.com/pic/%E5%8F%98%E5%BD%A2%E9%87%91%E5%88%9A5%EF%BC%9A%E6%9C%80%E5%90%8E%E7%9A%84%E9%AA%91%E5%A3%AB/19672571/0/5ab5c9ea15ce36d3d096fc8a30f33a87e850b1fd?fr=lemma&ct=single\" target=\"_blank\" title=\"\" style=\"color: rgb(19, 110, 194); text-decoration-line: none; display: block; width: 500px; height: 250px;\"><img class=\"\" src=\"https://gss1.bdstatic.com/-vo3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D500/sign=8fbc29ad68d0f703e2b295dc38fb5148/5ab5c9ea15ce36d3d096fc8a30f33a87e850b1fd.jpg\" alt=\"\"/></a></p><p><strong><span style=\"font-family: arial, tahoma, &quot;Microsoft Yahei&quot;, 宋体, sans-serif; font-size: 14px; line-height: 24px; text-indent: 28px; widows: 1; color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);\">内地上映</span></strong><br/></p>', 3, 0, 1, 3, 'F', 'F', 'F', '2017-06-28 22:14:11', '2017-07-26 09:51:38'), (9, '111111111111111', '<p>1111111111111111111111111<br/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-07-27 17:46:44', '2017-07-27 17:46:44'), (10, '2017.7.28任务计划', '<h1 style=\"font-size: 32px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); padding: 0px 4px 0px 0px; text-align: center; margin: 0px 0px 20px;\"><span style=\"font-family: 楷体, 楷体_GB2312, SimKai;\">2017.7.28任务计划</span></h1><p><img src=\"/uploads/ueditor/php/upload/image/20170728/1501225947101219.jpeg\" title=\"1501225947101219.jpeg\" alt=\"5257f27875c97e3.jpg\"/></p><h2><span style=\"font-family:宋体\">一、开发</span></h2><ul class=\" list-paddingleft-2\" style=\"list-style-type: disc;\"><li><p><span style=\"text-decoration: line-through;\"><span style=\"text-decoration: line-through; font-family: 宋体;\">在</span>windows-apache<span style=\"text-decoration: line-through; font-family: 宋体;\">上开发</span></span></p></li><li><p><span style=\"text-decoration: line-through;\">npm run watch<span style=\"text-decoration: line-through; font-family: 宋体;\">问题</span></span></p></li><li><p>css<span style=\"font-family:宋体\">优化</span></p></li><li><p><span style=\"font-family:宋体\">控制器代码优化</span></p></li><li><p><span style=\"font-family:宋体\">文件存储改变</span></p></li></ul><p>&nbsp;</p><h2><span style=\"font-family:宋体\">二、W</span>eb</h2><ul class=\" list-paddingleft-2\" style=\"list-style-type: disc;\"><li><p><span style=\"font-family: 宋体; text-decoration: line-through;\">分页</span></p></li><li><p><span style=\"font-family: 宋体; text-decoration: line-through;\">底部异步加载组件</span></p></li><li><p><span style=\"font-family: 宋体; text-decoration: line-through;\">权限</span></p></li><li><p><span style=\"font-family:宋体\">消息通知</span></p></li><li><p><span style=\"font-family:宋体\">部分样式修改</span></p></li><li><p><span style=\"text-decoration: line-through;\"><span style=\"text-decoration: line-through; font-family: 宋体;\">模态框导航条</span>fixBUG</span></p></li><li><p><span style=\"font-family:宋体\">组件化</span></p></li></ul><p>&nbsp;</p><h2><span style=\"font-family:宋体\">三、</span>GitHub</h2><ul class=\" list-paddingleft-2\" style=\"list-style-type: disc;\"><li><p><span style=\"text-decoration: line-through;\">canvas<span style=\"text-decoration: line-through; font-family: 宋体;\">代码上传</span></span></p></li><li><p><span style=\"text-decoration: line-through;\">laravel<span style=\"text-decoration: line-through; font-family: 宋体;\">项目代码管理</span></span></p></li></ul><p><br/></p>', 1, 0, 1, 1, 'F', 'F', 'F', '2017-07-28 07:14:34', '2017-12-12 09:03:07'), (11, '17.12.06计划', '<ol class=\" list-paddingleft-2\" style=\"list-style-type: decimal;\"><li><p><span style=\"text-decoration: line-through;\">合并首页和文章区</span></p></li><li><p><span style=\"text-decoration: line-through;\">更改个人中心视图</span></p></li><li><p><span style=\"text-decoration: line-through;\">添加管理项</span></p></li><li><p>关注课程模块</p></li><li><p>消息通知</p></li><li><p>搜索栏显示<br/></p></li><li><p>考核信息显示<br/></p></li></ol>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-06 09:03:27', '2017-12-14 07:59:16'), (12, '美国队长', '<p>&nbsp; 美国队长(Captain America)是美国<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E6%BC%AB%E5%A8%81\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">漫威</a>漫画旗下<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E8%B6%85%E7%BA%A7%E8%8B%B1%E9%9B%84\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">超级英雄</a>,初次登场于《<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD%E9%98%9F%E9%95%BF/7217717\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">美国队长</a>》(Captain America Comics)第1期(1941年3月),由<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E4%B9%94%C2%B7%E8%A5%BF%E8%92%99\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">乔·西蒙</a>和<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E6%9D%B0%E5%85%8B%C2%B7%E7%A7%91%E6%AF%94\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">杰克·科比</a>联合创造,被视为<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD%E7%B2%BE%E7%A5%9E\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">美国精神</a>的象征。本名史蒂文·“史蒂夫”·罗杰斯(Steven “Steve” Rogers),1920年7月4日出生于<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD/125486\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">美国</a><a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BA%BD%E7%BA%A6/6230\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">纽约</a><a target=\"_blank\" href=\"https://baike.baidu.com/item/%E5%B8%83%E9%B2%81%E5%85%8B%E6%9E%97%E5%8C%BA\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">布鲁克林区</a>,原本是一名身体瘦弱的新兵,在接受<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD%E6%94%BF%E5%BA%9C\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">美国政府</a>的实验改造后变成了“超级士兵”,这使其力量、速度、耐力等各项体能都远超出于常人,且还被<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD%E6%94%BF%E5%BA%9C\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">美国政府</a>赋予了由世界上最坚硬的金属之一<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E5%90%B8%E9%9F%B3%E9%92%A2\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">吸音钢</a>制成的<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%9B%BE%E7%89%8C\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">盾牌</a>,从此史蒂夫以美国队长的身份,为<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BE%8E%E5%9B%BD/125486\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">美国</a>及世界在<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E4%BA%8C%E6%88%98\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">二战</a>中立下显赫战功,后来在二战尾声的一次行动中,美国队长与宿敌<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%BA%A2%E9%AA%B7%E9%AB%85\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">红骷髅</a>战斗,并掉入大海之中被冰封近70年,直到被<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%A5%9E%E7%9B%BE%E5%B1%80\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">神盾局</a>发现并解冻后才加入了<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E5%A4%8D%E4%BB%87%E8%80%85%E8%81%94%E7%9B%9F\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">复仇者联盟</a>,此后在美国队长的领导下,<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E5%A4%8D%E4%BB%87%E8%80%85%E8%81%94%E7%9B%9F/391050\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">复仇者联盟</a>出生入死,赢得一次又一次近乎不可能的胜利。</p><p>&nbsp; 在2014年的漫画中,原美国队长史蒂夫·罗杰斯因遭反派铁钉(Iron Nail)的袭击导致血清流失而快速衰老,他选择由<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%8C%8E%E9%B9%B0/534739\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">猎鹰</a>(Falcon)山姆·威尔逊(<NAME>)继任美国队长。</p><p><img src=\"/uploads/ueditor/php/upload/image/20171213/1513136360560704.jpeg\" title=\"1513136360560704.jpeg\" alt=\"9f2f070828381f30a9b17728a2014c086f06f083.jpg\"/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-13 03:39:26', '2017-12-13 03:39:26'), (13, '正义联盟', '<p>《正义联盟》是由<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E6%89%8E%E5%85%8B%C2%B7%E6%96%BD%E5%A5%88%E5%BE%B7\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">扎克·施奈德</a>执导,<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E5%85%8B%E9%87%8C%E6%96%AF%C2%B7%E7%89%B9%E9%87%8C%E5%A5%A5\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">克里斯·特里奥</a>、<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E4%B9%94%E6%96%AF%C2%B7%E9%9F%A6%E7%99%BB\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">乔斯·韦登</a>编剧,<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E6%9C%AC%C2%B7%E9%98%BF%E5%BC%97%E8%8E%B1%E5%85%8B\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">本·阿弗莱克</a>,<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E4%BA%A8%E5%88%A9%C2%B7%E5%8D%A1%E7%BB%B4%E5%B0%94\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">亨利·卡维尔</a>,<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%9B%96%E5%B0%94%C2%B7%E5%8A%A0%E6%9C%B5\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">盖尔·加朵</a>等主演的动作科幻奇幻冒险电影。</p><p>改编自<a target=\"_blank\" href=\"https://baike.baidu.com/item/DC%E6%BC%AB%E7%94%BB\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">DC漫画</a>,是<a target=\"_blank\" href=\"https://baike.baidu.com/item/DC%E6%89%A9%E5%B1%95%E5%AE%87%E5%AE%99\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">DC扩展宇宙</a>的第五部影片。故事发生在《<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E8%9D%99%E8%9D%A0%E4%BE%A0%E5%A4%A7%E6%88%98%E8%B6%85%E4%BA%BA%EF%BC%9A%E6%AD%A3%E4%B9%89%E9%BB%8E%E6%98%8E\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">蝙蝠侠大战超人:正义黎明</a>》之后,主要讲述了面对一个全新的世界威胁,<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E8%B6%85%E4%BA%BA/13106\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">超人</a>、<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E8%9D%99%E8%9D%A0%E4%BE%A0/50335\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">蝙蝠侠</a>、<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E7%A5%9E%E5%A5%87%E5%A5%B3%E4%BE%A0/79246\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">神奇女侠</a>、<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E9%97%AA%E7%94%B5%E4%BE%A0/47498\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">闪电侠</a>、<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E6%B5%B7%E7%8E%8B/9093578\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">海王</a>和<a target=\"_blank\" href=\"https://baike.baidu.com/item/%E9%92%A2%E9%AA%A8/2469567\" style=\"color: rgb(19, 110, 194); text-decoration: none;\">钢骨</a>六位英雄聚首,与这股未知的威胁对抗的故事<span style=\"font-size: 12px; line-height: 0; position: relative; vertical-align: baseline; top: -0.5em; margin-left: 2px; color: rgb(51, 102, 204); cursor: default; padding: 0px 2px;\">[1]</span><a class=\"sup-anchor\" style=\"color: rgb(19, 110, 194); position: relative; top: -50px; font-size: 0px; line-height: 0;\">&nbsp;</a>&nbsp;。</p><p>该片于2017年11月16日在中国内地部分影院提前点映,11月17日与北美同步上映</p><p><img src=\"/uploads/ueditor/php/upload/image/20171213/1513139486123131.jpeg\" title=\"1513139486123131.jpeg\" alt=\"5d6034a85edf8db1f5a91ce40223dd54574e74ae.jpg\"/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-13 04:31:31', '2017-12-13 04:31:31'), (14, '33333333333333333333', '<p>去去去去去去群群群群群群群群群群群群</p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-13 05:00:25', '2017-12-13 05:00:25'), (15, '222222222222222222', '<p>的点点滴滴多多多多多多多多多</p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-13 05:00:59', '2017-12-13 05:00:59'), (16, '呃呃呃鹅鹅鹅鹅鹅鹅饿鹅鹅鹅饿', '<p>2222222222222222222222222</p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-13 05:03:01', '2017-12-13 05:03:01'); INSERT INTO `articles` (`id`, `title`, `body`, `user_id`, `comments_count`, `followers_count`, `answers_count`, `close_comment`, `is_hidden`, `is_first`, `created_at`, `updated_at`) VALUES (17, 'Laravel项目环境搭建:VirtualBox-Vagrant-HomeStead', '<p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: inherit; font-weight: 600;\">本文在Windows操作系统下搭建环境,其他操作系统请仅作参考</span></p><h2 style=\"box-sizing: inherit; margin: 20px 0px; font-variant-numeric: inherit; font-weight: 400; font-stretch: inherit; font-size: 24px; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(255, 255, 255);\">一、下载工具</h2><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">1.virtualBox</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">Oracle 公司的虚拟机软件, 能运行在当前大部分流行的系统上</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">网址:<a href=\"http://link.zhihu.com/?target=https%3A//www.virtualbox.org/wiki/Downloads\" class=\" wrap external\" target=\"_blank\" style=\"box-sizing: inherit; color: rgb(34, 85, 153); text-decoration: none; border-bottom: 1px solid rgba(64, 64, 64, 0.721569); word-break: break-all; cursor: pointer;\">Downloads - Oracle VM VirtualBox<span class=\"icon-external\" style=\"box-sizing: inherit; font-size: 24px; speak: none; font-feature-settings: normal; line-height: 1; -webkit-font-smoothing: antialiased; font-family: icomoon !important;\"></span></a></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">2.vagrant</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">命令行接口,提供一种命令行接口, 允许自动化安装虚拟机, 并且因为是脚本编写成的 provision 文本文件, 给共享虚拟机配置提供了可能, Homestead 正是构建在 Vagrant 之上</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">网址:<a href=\"http://link.zhihu.com/?target=https%3A//www.vagrantup.com/downloads.html\" class=\" wrap external\" target=\"_blank\" style=\"box-sizing: inherit; color: rgb(34, 85, 153); text-decoration: none; border-bottom: 1px solid rgba(64, 64, 64, 0.721569); word-break: break-all; cursor: pointer;\">Download - Vagrant by HashiCorp<span class=\"icon-external\" style=\"box-sizing: inherit; font-size: 24px; speak: none; font-feature-settings: normal; line-height: 1; -webkit-font-smoothing: antialiased; font-family: icomoon !important;\"></span></a></p><h2 style=\"box-sizing: inherit; margin: 20px 0px; font-variant-numeric: inherit; font-weight: 400; font-stretch: inherit; font-size: 24px; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(255, 255, 255);\"><img src=\"/uploads/ueditor/php/upload/image/20171214/1513239082697545.jpeg\" title=\"1513239082697545.jpeg\" alt=\"7a406073b512ef16a891127824c7b.jpg\"/></h2><h2 style=\"box-sizing: inherit; margin: 20px 0px; font-variant-numeric: inherit; font-weight: 400; font-stretch: inherit; font-size: 24px; line-height: inherit; font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(255, 255, 255);\">二、安装</h2><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">1.将vagrant和VirtualBox安装完成后打开Gitbash命令窗口进入本地路径<span style=\"box-sizing: inherit; font-weight: 600;\">(没有Git请先下载安装Git)</span></p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">cd&nbsp;~</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">2.克隆 homestead 项目</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">git&nbsp;clone&nbsp;https://github.com/laravel/homestead.git&nbsp;Homestead</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">3.在virtualbox虚拟机中加入 homestead box</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">有两种方法:</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">(1)执行以下命令添加 box,这种方法下载很慢,容易被墙,我即使开着VPN也下不了,所以我果断用第二种</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">vagrant&nbsp;box&nbsp;add&nbsp;laravel/homestead</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">(2)命令行下下载速度太慢的话可以利用工具下载以下链接加速,即先将资源下载到本地,再添加到虚拟机中<span style=\"box-sizing: inherit; font-weight: 600;\">(我用迅雷下载的)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">资源地址:</p><p><a href=\"http://link.zhihu.com/?target=https%3A//atlas.hashicorp.com/laravel/boxes/homestead/versions/2.1.0/providers/virtualbox.box\" class=\" external\" target=\"_blank\" style=\"box-sizing: inherit; color: rgb(34, 85, 153); text-decoration: none; border-bottom: 1px solid rgba(64, 64, 64, 0.721569); word-break: break-all; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\"><span class=\"invisible\" style=\"box-sizing: inherit; font-stretch: normal; font-size: 0px; line-height: 0; font-family: a; color: transparent; text-shadow: none; background-color: transparent;\">https://</span><span class=\"visible\" style=\"box-sizing: inherit;\">atlas.hashicorp.com/lar</span><span class=\"invisible\" style=\"box-sizing: inherit; font-stretch: normal; font-size: 0px; line-height: 0; font-family: a; color: transparent; text-shadow: none; background-color: transparent;\">avel/boxes/homestead/versions/2.1.0/providers/virtualbox.box</span><span class=\"ellipsis\" style=\"box-sizing: inherit;\"></span><span class=\"icon-external\" style=\"box-sizing: inherit; font-size: 24px; speak: none; font-feature-settings: normal; line-height: 1; -webkit-font-smoothing: antialiased; font-family: icomoon !important;\"></span></a><span style=\"color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; background-color: rgb(255, 255, 255);\"></span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">下载完毕我们得到了一个virtualbox.box文件,将它放在C:根目录下<span style=\"box-sizing: inherit; font-weight: 600;\">(环境搭建完后可以删除这个文件)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">创建一个metadata.json文件放置在本地目录下(C:用户/当前用户/)<span style=\"box-sizing: inherit; font-weight: 600;\">(很重要)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">metadata.json内容:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&quot;name&quot;:&nbsp;&quot;laravel/homestead&quot;,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&quot;versions&quot;:&nbsp;[{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;version&quot;:&nbsp;&quot;2.1.0&quot;,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;providers&quot;:&nbsp;[{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;name&quot;:&nbsp;&quot;virtualbox&quot;,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;url&quot;:&nbsp;&quot;file://C:/virtualbox.box&quot;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}]\r\n&nbsp;&nbsp;&nbsp;&nbsp;}]\r\n}</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: inherit; font-weight: 600;\">(我的盒子是2.1.0版所以version是2.1.0,virtualbox,vagrant最好都用最新版避免出现兼容和再更新问题)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">Gitbash:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">cd&nbsp;~\r\nvagrant&nbsp;box&nbsp;add&nbsp;metadata.json</pre><p><br/><span style=\"box-sizing: inherit; font-weight: 600; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; background-color: rgb(255, 255, 255);\">三、配置</span><span style=\"color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; background-color: rgb(255, 255, 255);\"></span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">1.生成配置文件</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">cd&nbsp;homestead\r\nbash&nbsp;init.sh</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">打开Homestead目录,可以找到Homestead.yaml文件</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">这时开始修改Homestead.yaml文件<span style=\"box-sizing: inherit; font-weight: 600;\">(我用的是Sublimt text)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">folders表示主机和虚拟机的共享文件</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">sites表示域名访问虚拟机位置</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">我的修改如下:<span style=\"box-sizing: inherit; font-weight: 600;\">(注意:请在源文件上修改,不要复制代码,yaml文件里多一个空格就会安装失败!)</span></p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">ip:&nbsp;&quot;192.168.10.10&quot;\r\nmemory:&nbsp;2048\r\ncpus:&nbsp;2\r\nprovider:&nbsp;virtualbox\r\n\r\nauthorize:&nbsp;~/.ssh/id_rsa.pub\r\nkeys:\r\n~/.ssh/id_rsa\r\n\r\nfolders:\r\n-&nbsp;map:\r\n~/Code/TaskManager\r\nto:\r\n/home/vagrant/Code/TaskManager\r\n\r\nsites:\r\n-&nbsp;map:\r\ntaskmanager.app\r\nto:\r\n/home/vagrant/Code/TaskManager/public\r\n\r\ndatabases:\r\n-homestead</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">为了对应共享的文件,在本地目录下新建目录Code,在Code下新建子目录TaskManager</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">2.域名重定向</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">修改主机hosts文件添加域重定向</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">位置:C:\\Windows\\System32\\drivers\\etc\\hosts</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">添加两条重定向代码:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">192.168.10.10&nbsp;taskmanager.app</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">(如果保存不了,右键hosts-属性-安全-编辑,给当前用户分配此文件的权限)</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">3.SSH密钥</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">在gitbash窗口输入:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">ssh-keygen</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">根据提示输入你要设置的密码<span style=\"box-sizing: inherit; font-weight: 600;\">(我没设置,全部enter跳过)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">然后打开homestead/scripts/homestead.rb,查看版本限制:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">config.vm.box_version&nbsp;=&nbsp;settings[&quot;version&quot;]&nbsp;||=&nbsp;&quot;&gt;=&nbsp;2.0.0&quot;</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">如果不符则修改</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: inherit; font-weight: 600;\">(注意:不要看网上的执行vagrant init laravel/homestead 命令,否则Vagrantfile会被初始化,vagrant up的时候不会执行yaml配置!)</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">4.安装环境</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">cd&nbsp;homestead\r\nvagrant&nbsp;up</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">等待一段时间安装完成</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: inherit; font-weight: 600;\">(命令执行后,显示信息第二行如果是import...laravel/homeatead才是正确的)</span></p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">vagrant&nbsp;ssh</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">进入虚拟机</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">ls</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">看是否有个Code文件,如果有,则yaml配置文件执行成功了</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: inherit; font-weight: 600;\">四、Box内部署</span></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">1.composer</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">修改虚拟机内composer下载地址到中国镜像</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">composer&nbsp;config&nbsp;-g&nbsp;repo.packagist&nbsp;composer&nbsp;Packagist&nbsp;/&nbsp;Composer</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">下载laravel项目</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">cd&nbsp;Code\r\nsudo&nbsp;composer&nbsp;create-project&nbsp;laravel/laravel&nbsp;TaskManager</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">在主机浏览器输入域名:taskmanager.app</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">访问到Laravel首页则配置成功!</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">2.修改laravel配置</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">修改.env文件内数据库名</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">...</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">3.安装phpmyadmin</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">网址:<a href=\"http://link.zhihu.com/?target=http%3A//www.phpmyadmin.net\" class=\" wrap external\" target=\"_blank\" style=\"box-sizing: inherit; color: rgb(34, 85, 153); text-decoration: none; border-bottom: 1px solid rgba(64, 64, 64, 0.721569); word-break: break-all; cursor: pointer;\">phpMyAdmin<span class=\"icon-external\" style=\"box-sizing: inherit; font-size: 24px; speak: none; font-feature-settings: normal; line-height: 1; -webkit-font-smoothing: antialiased; font-family: icomoon !important;\"></span></a></p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">下载安装解压改名为phpMyAdmin放在主机的Code目录下(注意:phpMyAdmin目录下就是doc、examples等子目录)</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">修改yml文件:</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">在共享文件后添加</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">-&nbsp;map:\r\n~/Code/phpMyAdmin\r\nto:\r\n/home/vagrant/Code/phpMyAdmin</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">在域名重定向后添加:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">-&nbsp;map:\r\nphpmyadmin.app\r\nto:\r\n/home/vagrant/Code/phpMyAdmin</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">在hosts文件添加:</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">192.168.10.10&nbsp;phpmyadmin.app</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">4.重载yaml</p><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">登录虚拟机</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">vagrant&nbsp;up</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">重新加载配置</p><pre style=\"box-sizing: inherit; margin-top: 1em; margin-bottom: 1em; padding: 10px; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; word-wrap: normal; background-color: rgb(246, 246, 246); border-radius: 4px;\">vagrant&nbsp;provision\r\nvagrant&nbsp;ssh</pre><p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: medium; white-space: normal; background-color: rgb(255, 255, 255);\">主机浏览器url输入phpmyadmin.app,出现phpmyadmin页面,部署完成!</p><p><br/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-14 08:07:25', '2017-12-14 08:11:28'), (18, 'Laravel文件存储问题', '<p><span style=\"font-size:19px\">Laravel</span><span style=\"font-size:19px\">有多种文件存储方式,包括:local、public、第三方云存储等,存储方式定义在config/filesystem.php中</span></p><p><span style=\"font-size:19px\">本地存储选择local或者public方式</span></p><p><span style=\"font-size:19px\">旧版本中:</span></p><p><span style=\"font-size:19px\">本地存储磁盘直接放在/public下,用户可以直接访问到</span></p><p><span style=\"font-size:19px\">新版本中:</span></p><p><span style=\"font-size:19px\">本地磁盘在/storage/app/public下,用户上传的文件不会被直接访问到,在项目根目录下执行:</span></p><p style=\"margin: 10px 0 20px;line-height: 200%;vertical-align: middle\"><span style=\"font-size: 19px;line-height: 200%;font-family: 楷体;background: lightgrey\">php artisan storage</span><span style=\"font-size:19px;line-height:200%;font-family:楷体;color:#999999;background:lightgrey;background:lightgrey\">:</span><span style=\"font-size: 19px;line-height: 200%;font-family: 楷体;background: lightgrey\">link</span></p><p><span style=\"font-size:19px\">建立一个/storage/app/public到/public/storage的软链接</span></p><p><span style=\"font-size:19px\">在filesystem中设置url即可</span></p><p><strong><span style=\"font-size:19px\">(但是在virtualbox中出于安全考虑,共享文件夹中禁止建立软链接,这样最好将文件系统部署在云端)</span></strong></p><p><img src=\"/uploads/ueditor/php/upload/image/20171214/1513239218815409.jpeg\" title=\"1513239218815409.jpeg\" alt=\"7a406073b512ef16a891127824c7b.jpg\"/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-14 08:13:42', '2017-12-14 08:13:42'), (19, 'Laravel5.4用户授权-policies/Gate', '<p><img src=\"/uploads/ueditor/php/upload/image/20171214/1513239407896222.jpeg\" title=\"1513239407896222.jpeg\" alt=\"7a406073b512ef16a891127824c7b.jpg\"/></p><p>(1)创建策略类</p><p>映射策略类:注册模型与策略类的映射</p><p>在\\App\\Providers\\AuthServiceProvider.php文件的protected $policies属性中添加映射,如:</p><pre class=\"brush:php;toolbar:false\">\\App\\User::class&nbsp;=&gt;&nbsp;\\App\\Policies\\UserPolicy::class,</pre><p>使用Artisan命令生成改模型的policy文件:</p><pre class=\"brush:bash;toolbar:false\">php&nbsp;artisan&nbsp;make:policy&nbsp;UserPolicy</pre><p>这样我们就可以在这个policy文件中编写对应的授权策略</p><p>(2)编写策略</p><p>创建策略方法,传入当前用户实例和发送实例做为参数,如:在\\App\\Policies\\ UserPolicy.php文件中添加方法</p><pre class=\"brush:php;toolbar:false\">public&nbsp;function&nbsp;update(User&nbsp;$currentUser,User&nbsp;$user)\r\n&nbsp;&nbsp;&nbsp;&nbsp;{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$currentUser-&gt;id&nbsp;===&nbsp;$user-&gt;id;\r\n&nbsp;&nbsp;&nbsp;&nbsp;}</pre><p>这是一个更新用户信息的授权策略</p><p>传入当前用户实例和要更改的用户实例</p><p>返回是一个bool值,当当前登录的用户的id是要更改的用户id时,返回true,这个操作允许进行</p><p>▲当策略为create类型方法时只需要传入当前用户实例一个参数</p><p>(3)使用策略</p><p>策略一般在控制器中使用,如:</p><p>在UsersController控制器的用户信息更改控制器中</p><pre class=\"brush:php;toolbar:false\">$user=User::where(&#39;id&#39;,$request-&gt;get(&#39;userId&#39;))-&gt;first();\r\n$this-&gt;authorize(&#39;update&#39;,&nbsp;$user);</pre><p>$request是用户信息变更的表单请求</p><p>$user是请求中的用户id对应的用户实例</p><p>通过传入User类实例$user找到provider中映射的policy</p><p>用过该policy中的’update’方法,返回的值判断当前用户的操作是否可以继续</p><p>如果返回false,则自动跳转到403页面</p><p>403页面可以在\\resources\\views\\errors\\403.blade.php中自定义编写</p><p>▲create类策略使用时只需要传入模型类,如:</p><pre class=\"brush:php;toolbar:false\">$this-&gt;authorize(&#39;create&#39;,Lesson::class);</pre><p>(4)策略过滤</p><p>在policy类中创建before方法</p><p>在该策略所有方法执行之前都会先执行这个方法,如:</p><p><code><span style=\"font-size:16px\"></span></code></p><pre class=\"brush:php;toolbar:false\">public&nbsp;function&nbsp;before($user,&nbsp;$ability)\r\n{\r\n&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($user-&gt;isSuperAdmin())&nbsp;{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;true;\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n}</pre><p><code><span style=\"font-size:16px\"></span></code></p><p>(5)不虚传入模型实例的策略可以用gate编写</p><p>在AuthServiceProvider文件boot方法中添加策略,如:</p><pre class=\"brush:php;toolbar:false\">Gate::define(&#39;memberShow&#39;,&nbsp;function&nbsp;($user)&nbsp;{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$user-&gt;is_admin&nbsp;===&nbsp;2;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</pre><p>定义策略名,回调函数第一个参数默认为当前登录的用户实例,其他参数自定义</p><p>在blade中调用:</p><pre class=\"brush:html;toolbar:false\">@can(&#39;memberShow&#39;)\r\n&nbsp;&nbsp;&nbsp;&lt;li&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href=&quot;&quot;&gt;管理&lt;/a&gt;\r\n&nbsp;&nbsp;&nbsp;&lt;/li&gt;\r\n@endcan</pre><p><br/></p>', 1, 0, 1, 0, 'F', 'F', 'F', '2017-12-14 08:16:54', '2017-12-14 09:46:04'); -- -------------------------------------------------------- -- -- 表的结构 `article_topic` -- CREATE TABLE `article_topic` ( `id` int(10) UNSIGNED NOT NULL, `article_id` int(10) UNSIGNED NOT NULL, `topic_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `article_topic` -- INSERT INTO `article_topic` (`id`, `article_id`, `topic_id`, `created_at`, `updated_at`) VALUES (1, 1, 12, '2017-06-01 15:21:04', '2017-06-01 15:21:04'), (2, 1, 13, '2017-06-01 15:21:04', '2017-06-01 15:21:04'), (3, 2, 14, '2017-06-01 16:20:20', '2017-06-01 16:20:20'), (4, 2, 15, '2017-06-01 16:20:20', '2017-06-01 16:20:20'), (6, 2, 17, '2017-06-01 18:03:30', '2017-06-01 18:03:30'), (7, 3, 2, '2017-06-02 14:43:31', '2017-06-02 14:43:31'), (8, 3, 3, '2017-06-02 14:43:31', '2017-06-02 14:43:31'), (9, 3, 18, '2017-06-02 14:43:31', '2017-06-02 14:43:31'), (10, 4, 8, '2017-06-20 16:05:56', '2017-06-20 16:05:56'), (11, 4, 19, '2017-06-20 16:05:56', '2017-06-20 16:05:56'), (12, 4, 13, '2017-06-20 16:05:56', '2017-06-20 16:05:56'), (13, 5, 21, '2017-06-20 17:00:49', '2017-06-20 17:00:49'), (14, 6, 21, '2017-06-20 17:01:44', '2017-06-20 17:01:44'), (15, 7, 13, '2017-06-21 15:07:07', '2017-06-21 15:07:07'), (16, 7, 23, '2017-06-21 15:07:07', '2017-06-21 15:07:07'), (17, 7, 17, '2017-06-21 15:07:07', '2017-06-21 15:07:07'), (18, 8, 14, '2017-06-28 22:14:11', '2017-06-28 22:14:11'), (19, 8, 26, '2017-06-28 22:14:11', '2017-06-28 22:14:11'), (20, 9, 21, '2017-07-27 17:46:44', '2017-07-27 17:46:44'), (21, 10, 25, '2017-07-28 07:14:34', '2017-07-28 07:14:34'), (22, 10, 26, '2017-07-28 07:14:34', '2017-07-28 07:14:34'), (23, 10, 27, '2017-07-28 07:14:34', '2017-07-28 07:14:34'), (24, 11, 27, '2017-12-06 09:03:27', '2017-12-06 09:03:27'), (25, 12, 14, '2017-12-13 03:39:26', '2017-12-13 03:39:26'), (26, 12, 16, '2017-12-13 03:39:26', '2017-12-13 03:39:26'), (27, 12, 17, '2017-12-13 03:39:26', '2017-12-13 03:39:26'), (28, 13, 14, '2017-12-13 04:31:31', '2017-12-13 04:31:31'), (29, 13, 17, '2017-12-13 04:31:31', '2017-12-13 04:31:31'), (30, 13, 15, '2017-12-13 04:31:31', '2017-12-13 04:31:31'), (31, 14, 14, '2017-12-13 05:00:25', '2017-12-13 05:00:25'), (32, 15, 14, '2017-12-13 05:00:59', '2017-12-13 05:00:59'), (33, 16, 21, '2017-12-13 05:03:01', '2017-12-13 05:03:01'), (34, 17, 2, '2017-12-14 08:07:25', '2017-12-14 08:07:25'), (35, 17, 28, '2017-12-14 08:07:25', '2017-12-14 08:07:25'), (36, 17, 29, '2017-12-14 08:07:25', '2017-12-14 08:07:25'), (37, 18, 2, '2017-12-14 08:13:42', '2017-12-14 08:13:42'), (38, 18, 30, '2017-12-14 08:13:42', '2017-12-14 08:13:42'), (39, 18, 31, '2017-12-14 08:13:42', '2017-12-14 08:13:42'), (40, 19, 2, '2017-12-14 08:16:54', '2017-12-14 08:16:54'), (41, 19, 30, '2017-12-14 08:16:54', '2017-12-14 08:16:54'), (42, 19, 32, '2017-12-14 08:16:54', '2017-12-14 08:16:54'); -- -------------------------------------------------------- -- -- 表的结构 `comments` -- CREATE TABLE `comments` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `answer_id` int(10) UNSIGNED DEFAULT NULL, `parent_id` int(10) UNSIGNED DEFAULT NULL, `level` smallint(6) NOT NULL DEFAULT '1', `is_hidden` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `comments` -- INSERT INTO `comments` (`id`, `user_id`, `body`, `answer_id`, `parent_id`, `level`, `is_hidden`, `created_at`, `updated_at`) VALUES (7, 1, '11', 1, NULL, 1, 'F', '2017-06-13 16:33:40', '2017-06-13 16:33:40'), (8, 1, '12', 1, NULL, 1, 'F', '2017-06-13 16:37:12', '2017-06-13 16:37:12'), (9, 1, '2', 1, NULL, 1, 'F', '2017-06-13 16:37:20', '2017-06-13 16:37:20'), (10, 1, '111', 1, NULL, 1, 'F', '2017-06-13 16:42:07', '2017-06-13 16:42:07'), (11, 1, '2', 1, NULL, 1, 'F', '2017-06-13 17:06:06', '2017-06-13 17:06:06'), (12, 1, '1', 1, NULL, 1, 'F', '2017-06-13 17:11:20', '2017-06-13 17:11:20'), (13, 1, '1', 1, NULL, 1, 'F', '2017-06-13 17:17:24', '2017-06-13 17:17:24'), (14, 1, '2', 1, NULL, 1, 'F', '2017-06-13 17:17:26', '2017-06-13 17:17:26'), (15, 1, '3', 1, NULL, 1, 'F', '2017-06-13 17:17:45', '2017-06-13 17:17:45'), (16, 1, '1', 1, NULL, 1, 'F', '2017-06-13 17:20:59', '2017-06-13 17:20:59'), (17, 1, '1', 2, NULL, 1, 'F', '2017-06-13 17:21:35', '2017-06-13 17:21:35'), (18, 1, '2', 2, NULL, 1, 'F', '2017-06-13 17:21:41', '2017-06-13 17:21:41'), (19, 1, '2', 2, NULL, 1, 'F', '2017-06-13 17:23:32', '2017-06-13 17:23:32'), (20, 1, '3', 2, NULL, 1, 'F', '2017-06-13 17:23:35', '2017-06-13 17:23:35'), (21, 1, '6', 2, NULL, 1, 'F', '2017-06-13 17:23:46', '2017-06-13 17:23:46'), (22, 1, '胜多负少', 2, NULL, 1, 'F', '2017-06-13 17:23:50', '2017-06-13 17:23:50'), (23, 1, '1', 2, NULL, 1, 'F', '2017-06-13 17:23:57', '2017-06-13 17:23:57'), (24, 1, '2', 2, NULL, 1, 'F', '2017-06-13 17:24:02', '2017-06-13 17:24:02'), (25, 1, '个会', 3, NULL, 1, 'F', '2017-06-13 17:26:14', '2017-06-13 17:26:14'), (26, 1, 'vhhj', 3, NULL, 1, 'F', '2017-06-13 17:26:28', '2017-06-13 17:26:28'), (27, 3, 'hello', 4, NULL, 1, 'F', '2017-06-16 10:39:14', '2017-06-16 10:39:14'), (28, 3, 'jed', 4, NULL, 1, 'F', '2017-06-16 10:39:21', '2017-06-16 10:39:21'), (29, 3, '1', 1, NULL, 1, 'F', '2017-06-21 17:10:59', '2017-06-21 17:10:59'), (30, 3, '2', 1, NULL, 1, 'F', '2017-06-21 17:16:13', '2017-06-21 17:16:13'), (31, 3, '111111111', 5, NULL, 1, 'F', '2017-06-28 22:14:56', '2017-06-28 22:14:56'), (32, 3, '222222222222', 5, NULL, 1, 'F', '2017-06-28 22:14:59', '2017-06-28 22:14:59'), (33, 3, '333333333333', 5, NULL, 1, 'F', '2017-06-28 22:15:02', '2017-06-28 22:15:02'); -- -------------------------------------------------------- -- -- 表的结构 `lessons` -- CREATE TABLE `lessons` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `lessons_sort_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `lessons` -- INSERT INTO `lessons` (`id`, `title`, `body`, `user_id`, `lessons_sort_id`, `created_at`, `updated_at`) VALUES (3, 'Laravel5.4 技术文档', '<p>本文在Windows系统下搭建环境,其他操作系统请仅作参考!</p><p>附件如下:</p><p style=\"line-height: 16px;\"><img src=\"http://machineedusystem.app/laravel-u-editor/dialogs/attachment/fileTypeImages/icon_doc.gif\"/><a style=\"font-size:12px; color:#0066cc;\" href=\"/uploads/ueditor/php/upload/file/20170626/1498462299446469.docx\" title=\"技术文档.docx\">技术文档.docx</a></p><p><br/></p>', 3, 16, '2017-06-26 15:31:44', '2017-06-26 15:31:44'), (4, '1111111111111111111', '<p style=\"text-align:center\"></p><p><br/></p>', 3, 16, '2017-06-26 15:54:16', '2017-06-26 15:54:16'), (5, '麻省理工算法导论公开课', '<p style=\"text-align:center\"><br/></p><p></p><p><br/></p>', 3, 16, '2017-06-27 16:11:11', '2017-06-27 16:11:11'), (6, '111111111111111111111111', '<p>11111111111111111111111</p><p></p>', 3, 16, '2017-06-27 16:12:01', '2017-06-27 16:12:01'), (7, '11111111', '<p>2222222222<br/></p><p>http://swf.ws.126.net/openplayer/v01/-0-2_M6UTT5U0I_M6V2T1JGF-vimg1_ws_126_net//image/snapshot_movie/2011/5/S/8/M72MFOHS8-1430711943278.swf</p>', 3, 16, '2017-06-27 16:16:29', '2017-06-27 16:16:29'), (8, '1111111', '<p><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://swf.ws.126.net/openplayer/v01/-0-2_M6UTT5U0I_M6V2T1JGF-vimg1_ws_126_net//image/snapshot_movie/2011/5/S/8/M72MFOHS8-1430711943278.swf\" width=\"420\" height=\"280\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/></p>', 3, 16, '2017-06-27 17:11:16', '2017-06-27 17:11:16'), (9, '麻省理工算法导论-算法分析', '<p style=\"text-align:center\"><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://swf.ws.126.net/openplayer/v01/-0-2_M6UTT5U0I_M6V2T1JGF-vimg1_ws_126_net//image/snapshot_movie/2011/5/S/8/M72MFOHS8-1430711943278.swf\" width=\"900\" height=\"600\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/></p><p><br/></p>', 3, 16, '2017-06-28 17:40:33', '2017-06-28 17:40:33'), (10, '麻省理工算法导论-分析', '<p>啦啦啦啦啦啦啦啦<br/></p><p style=\"text-align:center\"><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://swf.ws.126.net/openplayer/v01/-0-2_M6UTT5U0I_M6V2T4T2E-vimg1_ws_126_net//image/snapshot_movie/2011/5/C/9/M72MFNQC9-1430711943278.swf\" width=\"900\" height=\"600\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/></p><p><br/></p>', 3, 16, '2017-06-28 22:11:50', '2017-06-28 22:11:50'), (11, 'MIT算法导论-数据结构', '<p><span style=\"color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px;\">本栏目(Algorithms)下</span><span style=\"color: rgb(149, 55, 52);\"><strong><span style=\"font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px; text-decoration: none;\">MIT</span></strong><strong><span style=\"font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px; text-decoration: none;\"></span></strong></span><span style=\"font-family: Arial; line-height: 26px; white-space: normal; widows: 1; font-weight: bold; background-color: rgb(255, 255, 255); font-size: 16px; color: rgb(149, 55, 52);\"><strong>算法</strong><strong><span style=\"font-size: 16px; color: rgb(149, 55, 52);\"></span></strong></span><span style=\"color: rgb(149, 55, 52);\"><strong><span style=\"font-size: 16px; color: rgb(149, 55, 52);\"></span></strong><strong><span style=\"font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px; color: rgb(149, 55, 52); text-decoration: none;\">导论</span></strong><strong><span style=\"font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px; color: rgb(149, 55, 52); text-decoration: none;\"></span></strong></span><span style=\"color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px;\">专题是个人对网易公开课MIT算法导论的学习心得与笔记</span></p><p><span style=\"color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255); font-size: 16px;\">所有内容均来自MIT公开课Introduction to Algorithms中<NAME>和<NAME>老师的讲解</span></p><p style=\"color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\"><span style=\"color: rgb(0, 153, 0); font-size: 18px;\">第一节——课程简介及算法分析 Analysis of algorithm</span></p><p style=\"color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\"><span style=\"font-size: 16px;\">算法分析:关于计算机程序在效率和资源利用方面的理论研究</span></p><p style=\"text-align:center\"><span style=\"font-size: 16px;\"><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://swf.ws.126.net/openplayer/v01/-0-2_M6UTT5U0I_M6V2T4T2E-vimg1_ws_126_net//image/snapshot_movie/2011/5/C/9/M72MFNQC9-1430711943278.swf\" width=\"600\" height=\"600\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/></span></p><p style=\"text-align:center\"></p><p><br/></p>', 3, 11, '2017-07-17 13:47:05', '2017-07-17 13:47:05'), (12, 'MIT算法导论-算法分析', '<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 11px; color: rgb(99, 107, 111); font-family: Raleway, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(245, 248, 250);\"><span style=\"box-sizing: border-box; color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\">本栏目(Algorithms)下</span><span style=\"box-sizing: border-box; color: rgb(149, 55, 52);\"><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\">MIT</span></strong><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\"></span></strong></span><span style=\"box-sizing: border-box; font-family: Arial; line-height: 26px; widows: 1; font-weight: bold; font-size: 16px; color: rgb(149, 55, 52);\"><strong style=\"box-sizing: border-box;\">算法</strong><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box;\"></span></strong></span><span style=\"box-sizing: border-box; color: rgb(149, 55, 52);\"><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; font-size: 16px;\"></span></strong><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\">导论</span></strong><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\"></span></strong></span><span style=\"box-sizing: border-box; color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\">专题是个人对网易公开课MIT算法导论的学习心得与笔记</span></p><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 11px; color: rgb(99, 107, 111); font-family: Raleway, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(245, 248, 250);\"><span style=\"box-sizing: border-box; color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; font-size: 16px;\">所有内容均来自MIT公开课Introduction to Algorithms中<NAME>和<NAME>老师的讲解</span></p><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 11px; font-size: 14px; white-space: normal; color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: border-box; color: rgb(0, 153, 0); font-size: 18px;\">第一节——课程简介及算法分析 Analysis of algorithm</span></p><p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 11px; font-size: 14px; white-space: normal; color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; widows: 1; background-color: rgb(255, 255, 255);\"><span style=\"box-sizing: border-box; font-size: 16px;\">算法分析:关于计算机程序在效率和资源利用方面的理论研究</span></p><p style=\"text-align:center\"><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://swf.ws.126.net/openplayer/v01/-0-2_M6UTT5U0I_M6V2T4T2E-vimg1_ws_126_net//image/snapshot_movie/2011/5/C/9/M72MFNQC9-1430711943278.swf\" width=\"700\" height=\"600\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/></p><p><br/></p>', 3, 11, '2017-07-17 13:48:56', '2017-07-17 13:48:56'), (13, '111', '<p>111111</p>', 1, 16, '2017-12-05 08:47:07', '2017-12-05 08:47:07'), (14, '22222', '<p>22222222222222222</p>', 1, 16, '2017-12-05 08:53:19', '2017-12-05 08:53:19'), (15, 'qqqqqqqqqqqq', '<p>qqqqqqqqqqqqqqqqqqqqq</p>', 1, 16, '2017-12-05 11:16:52', '2017-12-05 11:16:52'), (16, '111111111111111111111', '<p>11111111111111111111111</p>', 1, 16, '2017-12-05 11:21:30', '2017-12-05 11:21:30'), (17, '3333333333333333333333', '<p>333333333333333333333333</p>', 1, 17, '2017-12-06 08:32:31', '2017-12-06 08:32:31'), (18, '第三部分', '<p>1111111111111111111111111111</p>', 1, 17, '2017-12-07 08:00:16', '2017-12-07 08:00:16'), (19, '22222222222222222222', '<p>24444444444444444444444</p>', 1, 17, '2017-12-07 08:08:43', '2017-12-07 08:08:43'), (20, '3333333333333333333', '<p>33333333333333333333333</p>', 1, 17, '2017-12-07 08:09:32', '2017-12-07 08:09:32'); -- -------------------------------------------------------- -- -- 表的结构 `lessons_sorts` -- CREATE TABLE `lessons_sorts` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `thumbnail` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `abstract` text COLLATE utf8mb4_unicode_ci NOT NULL, `type` int(11) NOT NULL DEFAULT '0', `user_id` int(10) UNSIGNED NOT NULL, `lessons_count` int(11) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `lessons_sorts` -- INSERT INTO `lessons_sorts` (`id`, `name`, `thumbnail`, `abstract`, `type`, `user_id`, `lessons_count`, `created_at`, `updated_at`) VALUES (8, '繁华夜色', 'GiOXpXfKJT.jpg', '这是一门都市生活课程!', 0, 3, 0, '2017-06-22 21:09:53', '2017-06-22 21:09:53'), (9, '星际大战', 'opHn6fX5XW.jpg', '这是一门太空作战课程!', 0, 3, 0, '2017-06-22 21:10:28', '2017-06-22 21:10:28'), (10, '红蓝天体', 'bUmeGWBgti.jpg', '这是一门色彩识别课程!', 0, 3, 0, '2017-06-22 21:11:11', '2017-06-22 21:11:11'), (11, '城市荒野', '7hYm84R3H0.jpg', '这是一门描述城市书籍!', 0, 3, 0, '2017-06-22 21:11:41', '2017-06-22 21:11:41'), (12, '钢铁侠', 'k907DZ4Uy4.jpg', '这是一门超级英雄战斗课程!', 0, 3, 0, '2017-06-22 21:12:36', '2017-06-22 21:12:36'), (13, '赤炎天体', 'etPeLCRrkT.jpg', '这是一门太空漂泊课程!', 0, 3, 0, '2017-06-22 21:13:16', '2017-06-22 21:13:16'), (14, '旅行都市', 'pz4vsk1l9M.jpg', '这是一本都市流浪写实!', 0, 3, 0, '2017-06-22 21:13:51', '2017-06-22 21:13:51'), (15, '战场咆哮', 'domV3i1egs.jpg', '这是一门歌唱技巧课程!', 0, 3, 0, '2017-06-22 21:14:33', '2017-06-22 21:14:33'), (16, '学海无涯', 'DZTLVA2eef.jpg', '这是一门算法课程!', 0, 3, 0, '2017-06-22 21:15:23', '2017-06-22 21:15:23'), (17, '2222222222222222222', 'O1d9H1Cg5n.jpg', '33333333333333333333333', 0, 1, 0, '2017-12-06 08:21:47', '2017-12-06 08:21:47'); -- -------------------------------------------------------- -- -- 表的结构 `messages` -- CREATE TABLE `messages` ( `id` int(10) UNSIGNED NOT NULL, `from_user_id` int(10) UNSIGNED NOT NULL, `to_user_id` int(10) UNSIGNED NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `has_read` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F', `read_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `messages` -- INSERT INTO `messages` (`id`, `from_user_id`, `to_user_id`, `body`, `has_read`, `read_at`, `created_at`, `updated_at`) VALUES (1, 2, 1, 'hahaha', 'F', NULL, '2017-06-12 14:56:07', '2017-06-12 14:56:07'), (2, 2, 1, '11111111111111', 'F', NULL, '2017-06-12 14:59:00', '2017-06-12 14:59:00'), (3, 2, 1, '1111111111', 'F', NULL, '2017-06-12 15:02:55', '2017-06-12 15:02:55'), (4, 2, 1, '1111111111111111', 'F', NULL, '2017-06-12 15:04:36', '2017-06-12 15:04:36'), (5, 2, 1, '1', 'F', NULL, '2017-06-12 15:06:51', '2017-06-12 15:06:51'), (6, 2, 1, '2', 'F', NULL, '2017-06-12 15:08:04', '2017-06-12 15:08:04'), (7, 2, 1, '1', 'F', NULL, '2017-06-12 15:08:27', '2017-06-12 15:08:27'), (8, 2, 1, '12', 'F', NULL, '2017-06-12 15:10:50', '2017-06-12 15:10:50'), (9, 2, 1, '23', 'F', NULL, '2017-06-12 15:13:46', '2017-06-12 15:13:46'), (10, 2, 1, '2', 'F', NULL, '2017-06-12 15:16:24', '2017-06-12 15:16:24'), (11, 2, 1, '2', 'F', NULL, '2017-06-12 15:19:32', '2017-06-12 15:19:32'), (12, 2, 1, '2', 'F', NULL, '2017-06-12 15:20:42', '2017-06-12 15:20:42'), (13, 2, 1, '3', 'F', NULL, '2017-06-12 15:22:24', '2017-06-12 15:22:24'), (14, 2, 1, '1', 'F', NULL, '2017-06-12 15:30:47', '2017-06-12 15:30:47'), (15, 2, 1, '1', 'F', NULL, '2017-06-12 15:34:27', '2017-06-12 15:34:27'), (16, 2, 1, '2', 'F', NULL, '2017-06-12 15:34:36', '2017-06-12 15:34:36'); -- -------------------------------------------------------- -- -- 表的结构 `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2017_05_23_173234_create_articles_table', 1), (4, '2017_05_26_120810_create_topics_table', 1), (5, '2017_05_26_122026_create_articles_topics_table', 1), (6, '2017_06_02_150244_create_answers_table', 2), (7, '2017_06_05_162023_add_api_token_to_users', 3), (8, '2017_06_06_143021_create_notifications_table', 4), (9, '2017_06_06_151438_create_votes_table', 5), (10, '2017_06_12_100300_create_messages_table', 6), (12, '2017_06_12_161015_create_comments_table', 7), (13, '2017_06_22_150851_create_lessons_sorts_table', 8), (14, '2017_06_23_152903_create_lessons_table', 9), (15, '2017_06_27_151432_create_works_table', 10), (16, '2017_06_28_153300_create_posts_table', 11), (19, '2017_07_25_160755_create_user_infos_table', 12); -- -------------------------------------------------------- -- -- 表的结构 `notifications` -- CREATE TABLE `notifications` ( `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `notifiable_id` int(10) UNSIGNED NOT NULL, `notifiable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `data` text COLLATE utf8mb4_unicode_ci NOT NULL, `read_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- 表的结构 `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- 表的结构 `topics` -- CREATE TABLE `topics` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `bio` text COLLATE utf8mb4_unicode_ci, `articles_count` int(11) NOT NULL DEFAULT '1', `followers_count` int(11) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `topics` -- INSERT INTO `topics` (`id`, `name`, `bio`, `articles_count`, `followers_count`, `created_at`, `updated_at`) VALUES (1, 'PHP', 'Necessitatibus et nostrum nam molestias nihil repellat. Vel quis qui et vitae neque nihil. Nam soluta rem quidem. Aut ea expedita et non repudiandae voluptatibus voluptatem.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (2, 'Laravel', 'Tenetur quo doloribus quo officia omnis. Omnis esse quia voluptatem magni quia modi ut voluptate. Nihil illo doloremque nisi magni.', 20, 0, '2017-06-01 11:00:05', '2017-12-14 09:46:04'), (3, 'Laravel框架', 'Iste aut voluptatem minus omnis. Eum accusantium in beatae eveniet veritatis quis omnis.', 4, 0, '2017-06-01 11:00:05', '2017-06-09 16:15:39'), (4, '人生', 'Rerum amet voluptatum non sit aut et. Adipisci deserunt reiciendis omnis culpa a illum. Aliquam reprehenderit dolores nobis aut non.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (5, '心理学', 'Nulla nobis qui sed provident numquam velit quas et. Sit tempore assumenda et voluptatibus molestiae occaecati aspernatur. Similique autem deserunt voluptates necessitatibus magnam ipsum perspiciatis sunt. Omnis possimus unde ratione enim.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (6, 'Vue', 'Rem sint optio nulla laborum voluptate. Repudiandae aperiam voluptatem et quod velit. Dolorem consectetur est quasi excepturi nisi ea. Doloribus velit accusantium fugit asperiores odio. Quasi unde ea consequuntur temporibus.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (7, 'JavaScript', 'Voluptas magni nostrum ullam iusto. Harum assumenda similique eaque a rem ut cum eos. Rerum distinctio nam tempore praesentium. Modi qui id est id.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (8, '前端', 'Ea aut ad repellat ducimus. Et amet incidunt maiores molestias culpa dolore magnam.', 2, 0, '2017-06-01 11:00:05', '2017-06-20 16:05:56'), (9, '框架', 'Iusto possimus fugit dolor hic rerum. Occaecati saepe porro at reiciendis unde id. Eos aut libero rem. Eos consequuntur quisquam eum.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (10, 'Web前端', 'Impedit veritatis optio cumque est. Nemo odit necessitatibus est illum dolores omnis. Nobis impedit ipsam voluptas officia culpa.', 1, 0, '2017-06-01 11:00:05', '2017-06-01 11:00:05'), (11, 'React', NULL, 1, 0, '2017-06-01 15:14:51', '2017-06-01 15:14:51'), (12, '视频', NULL, 1, 0, '2017-06-01 15:21:04', '2017-06-01 15:21:04'), (13, '网站', NULL, 5, 0, '2017-06-01 15:21:04', '2017-06-21 17:30:52'), (14, '电影', NULL, 11, 0, '2017-06-01 16:20:20', '2017-12-13 05:00:59'), (15, '英雄', NULL, 8, 0, '2017-06-01 16:20:20', '2017-12-13 04:31:31'), (16, '美国', NULL, 1, 0, '2017-06-01 16:20:20', '2017-06-01 16:20:20'), (17, '科幻', NULL, 7, 0, '2017-06-01 18:03:30', '2017-12-13 04:31:31'), (18, '后端', NULL, 3, 0, '2017-06-02 14:43:31', '2017-06-09 16:15:39'), (19, '组件', NULL, 1, 0, '2017-06-20 16:05:56', '2017-06-20 16:05:56'), (21, '测试', NULL, 4, 0, '2017-06-20 17:00:49', '2017-12-13 05:03:01'), (23, '源码', NULL, 3, 0, '2017-06-21 15:07:07', '2017-06-21 17:30:52'), (24, '平台', NULL, 3, 0, '2017-06-21 15:07:07', '2017-06-21 17:30:52'), (25, '项目', NULL, 3, 0, '2017-07-28 07:14:34', '2017-12-12 01:22:11'), (26, '工作', NULL, 3, 0, '2017-07-28 07:14:34', '2017-12-12 01:22:11'), (27, '计划', NULL, 6, 0, '2017-07-28 07:14:34', '2017-12-14 07:59:16'), (28, '环境搭建', NULL, 2, 0, '2017-12-14 08:07:25', '2017-12-14 08:11:28'), (29, '技术文档', NULL, 2, 0, '2017-12-14 08:07:25', '2017-12-14 08:11:28'), (30, '技术文章', NULL, 13, 0, '2017-12-14 08:13:42', '2017-12-14 09:46:04'), (31, '文件存储', NULL, 1, 0, '2017-12-14 08:13:42', '2017-12-14 08:13:42'), (32, '权限', NULL, 12, 0, '2017-12-14 08:16:54', '2017-12-14 09:46:04'); -- -------------------------------------------------------- -- -- 表的结构 `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `avatar` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `confirmation_token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `is_active` smallint(6) NOT NULL DEFAULT '0', `articles_count` int(10) UNSIGNED NOT NULL DEFAULT '0', `answers_count` int(11) NOT NULL DEFAULT '0', `comments_count` int(11) NOT NULL DEFAULT '0', `favorites_count` int(11) NOT NULL DEFAULT '0', `likes_count` int(11) NOT NULL DEFAULT '0', `followers_count` int(11) NOT NULL DEFAULT '0', `followings_count` int(11) NOT NULL DEFAULT '0', `experience_count` int(11) NOT NULL DEFAULT '0', `setting` json DEFAULT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `is_admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '//是否为管理员', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `api_token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `users` -- INSERT INTO `users` (`id`, `name`, `email`, `password`, `avatar`, `confirmation_token`, `is_active`, `articles_count`, `answers_count`, `comments_count`, `favorites_count`, `likes_count`, `followers_count`, `followings_count`, `experience_count`, `setting`, `remember_token`, `is_admin`, `created_at`, `updated_at`, `api_token`) VALUES (1, '<PASSWORD>', '<EMAIL>', '$2y$10$XqoOcPS/JE1e.TgaM7yHe.pmRdPOvJhXQMh/heUVzWgKl0hPBVkt6', '/images/avatars/5f1bc82e007325f30571dc179cf33534.jpg', 'lDSHMWvG50JvH4js6BRFryP6HSZ3YuOcCiyL7I9I', 1, 1, 6, 28, 0, 0, 0, 0, 100, NULL, 'XLWEz6UQo8aBYe8hAshhdqMOUnhjXSwTXrNE9EqoCnNdK8JG2vRCTpjPKCvV', 2, '2017-05-26 21:19:44', '2017-12-18 06:25:38', 'TfyoWIBhWrqmYiiIjrsaBg1hJWtP9c729JNt9u0s4OfgCZ0tF8lq3XFgV8b3'), (2, 'Query', '<EMAIL>', <PASSWORD>', '/images/avatars/d1b716463f040aef40a6bb5bab971718.jpg', 'qxW8LW2qLEUzrzKBTeljFeRfCGCa7IR2ZeERWbkd', 1, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 'G5BJtLYlcuAMC4M3QuFYjq9gqiy3FLt3avZMbZrjAS0HpUJ65ezORatrdJnH', 0, '2017-06-12 11:12:53', '2017-12-15 08:39:06', 'pR9yDgxlYYU1m3xQdKrtlStoQsXE3JKma6s1ZiSkXsZ0BIvm1xOzwdrDAnGE'), (3, 'SanLey', '<EMAIL>', '$2y$10$EdzL5..mgN39JOfBtnZeKO42zq2GNvK9Umjh0dHnJjMF8tre11Y5m', '/images/avatars/fae4494c012f4ecf647da1d63c6d602a.jpg', 'z7Lzg1LTclCBehyA7aWRio0hHpxucngspbKW0LYU', 1, 0, 2, 7, 0, 0, 0, 0, 0, NULL, 'uLWkOIhetplq135G6vxgK7F8Y7VhFIulumZfpPw6iNblP0ObecskcuRvre76', 1, '2017-06-14 15:27:49', '2017-12-15 08:39:15', 'YHNxQCXAx7wfiF3OAEYYgHsvlOadljVgfwmzIzXVG4vUqrztibMnaITElYGr'), (5, '东东', '<EMAIL>', '$2y$10$zVKLxKHRIip/qxssrAvuPec.5lQhl0BibcfGVEugvxDIsn/gEzlkm', '/images/avatars/f35bdffb1a656f0438f04fe783a6696e.jpg', 'rJuyq0aiLgWuyovbUStjUxlx23DykozTR3X860BO', 1, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 'A5N9V430lK7J6l3utaP1vhxCgqr6Nn5XKCldU1tpycqB8XVbs3WE9xrOZ3Tl', 0, '2017-07-26 16:04:34', '2017-12-15 08:38:34', 'tOctQczg5p8GlsfUWHVKgIqBQ4g0lcAEzXX7pmKJkzyOVlf8rn8UuyxXy4MA'), (6, 'Newman', '<EMAIL>', <PASSWORD>', '/images/avatars/default.png', 'oWtZNQpcfq31CptfV640Fu0j5s1ZalxKIT9QArBU', 1, 0, 0, 0, 0, 0, 0, 0, 0, NULL, '50yrSOFNzYrFK7eDxh2uwteqXxGC0yr5AMtVqDaNi6eGn8yUIrXprnObt1JZ', 0, '2017-07-28 08:26:55', '2017-07-28 08:26:55', 'QV9XMtVvckAWxen9HKb5eOfDkX2ol2z0RXUzMXvO746gDpKhgB0mWulF77rM'), (7, '张涛', '<EMAIL>', <PASSWORD>', '/images/avatars/default.png', 'HRPMVC92G61dfjd43hKVi7xtbN2kBW3Wu7FXpuKF', 1, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 1, '2017-07-31 03:37:32', '2017-12-15 08:40:55', 'G7j4qdTKcrHIVBiFE4KFMgiUm5SEvHIIUF0Cr3ULblfhoHLwANHYXcflkDFp'), (8, '测试1', '1', '$2b$12$ztRwIcN3dHcJjzcl0kSnHuzzTb8Di90BQtWeXlQ9T/iULp5Sb3.US', '', '123', 1, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, NULL, NULL, ''); -- -------------------------------------------------------- -- -- 表的结构 `user_infos` -- CREATE TABLE `user_infos` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `blog` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `github` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `live` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `webchat` varchar(255) 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; -- -- 转存表中的数据 `user_infos` -- INSERT INTO `user_infos` (`id`, `user_id`, `blog`, `github`, `live`, `phone`, `webchat`, `created_at`, `updated_at`) VALUES (1, 3, NULL, NULL, NULL, NULL, NULL, '2017-07-25 19:25:37', '2017-07-25 19:26:29'), (7, 1, 'http://www.uestc1430.iego.cn', 'https://github.com/HuiZist', '成都', '18328407750', '863403035', '2017-07-25 19:39:53', '2017-12-13 07:37:18'), (8, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (9, 5, NULL, NULL, NULL, NULL, NULL, '2017-07-26 16:04:34', '2017-07-26 16:04:34'), (10, 6, NULL, NULL, NULL, NULL, NULL, '2017-07-28 08:26:55', '2017-07-28 08:26:55'), (11, 7, NULL, NULL, NULL, NULL, NULL, '2017-07-31 03:37:32', '2017-07-31 03:37:32'); -- -------------------------------------------------------- -- -- 表的结构 `votes` -- CREATE TABLE `votes` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `answer_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `votes` -- INSERT INTO `votes` (`id`, `user_id`, `answer_id`, `created_at`, `updated_at`) VALUES (17, 3, 3, '2017-06-21 16:58:51', '2017-06-21 16:58:51'), (18, 3, 2, '2017-06-28 22:15:30', '2017-06-28 22:15:30'), (19, 3, 5, '2017-06-29 10:13:14', '2017-06-29 10:13:14'), (23, 1, 1, '2017-12-08 09:19:19', '2017-12-08 09:19:19'); -- -------------------------------------------------------- -- -- 表的结构 `works` -- CREATE TABLE `works` ( `id` int(10) UNSIGNED NOT NULL, `content` text COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `lesson_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `works` -- INSERT INTO `works` (`id`, `content`, `user_id`, `lesson_id`, `created_at`, `updated_at`) VALUES (1, '<p>11111</p>', 3, 3, '2017-06-27 15:36:21', '2017-06-27 15:36:21'); -- -- Indexes for dumped tables -- -- -- Indexes for table `answers` -- ALTER TABLE `answers` ADD PRIMARY KEY (`id`), ADD KEY `answers_user_id_index` (`user_id`), ADD KEY `answers_question_id_index` (`article_id`); -- -- Indexes for table `articles` -- ALTER TABLE `articles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_topic` -- ALTER TABLE `article_topic` ADD PRIMARY KEY (`id`), ADD KEY `article_topic_article_id_index` (`article_id`), ADD KEY `article_topic_topic_id_index` (`topic_id`); -- -- Indexes for table `comments` -- ALTER TABLE `comments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `lessons` -- ALTER TABLE `lessons` ADD PRIMARY KEY (`id`); -- -- Indexes for table `lessons_sorts` -- ALTER TABLE `lessons_sorts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `messages` -- ALTER TABLE `messages` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `notifications` -- ALTER TABLE `notifications` ADD PRIMARY KEY (`id`), ADD KEY `notifications_notifiable_id_notifiable_type_index` (`notifiable_id`,`notifiable_type`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `topics` -- ALTER TABLE `topics` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_name_unique` (`name`), ADD UNIQUE KEY `users_email_unique` (`email`), ADD UNIQUE KEY `users_api_token_unique` (`api_token`); -- -- Indexes for table `user_infos` -- ALTER TABLE `user_infos` ADD PRIMARY KEY (`id`); -- -- Indexes for table `votes` -- ALTER TABLE `votes` ADD PRIMARY KEY (`id`), ADD KEY `votes_user_id_index` (`user_id`), ADD KEY `votes_answer_id_index` (`answer_id`); -- -- Indexes for table `works` -- ALTER TABLE `works` ADD PRIMARY KEY (`id`); -- -- 在导出的表使用AUTO_INCREMENT -- -- -- 使用表AUTO_INCREMENT `answers` -- ALTER TABLE `answers` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- 使用表AUTO_INCREMENT `articles` -- ALTER TABLE `articles` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- 使用表AUTO_INCREMENT `article_topic` -- ALTER TABLE `article_topic` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43; -- -- 使用表AUTO_INCREMENT `comments` -- ALTER TABLE `comments` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; -- -- 使用表AUTO_INCREMENT `lessons` -- ALTER TABLE `lessons` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- 使用表AUTO_INCREMENT `lessons_sorts` -- ALTER TABLE `lessons_sorts` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- 使用表AUTO_INCREMENT `messages` -- ALTER TABLE `messages` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- 使用表AUTO_INCREMENT `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- 使用表AUTO_INCREMENT `topics` -- ALTER TABLE `topics` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; -- -- 使用表AUTO_INCREMENT `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- 使用表AUTO_INCREMENT `user_infos` -- ALTER TABLE `user_infos` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- 使用表AUTO_INCREMENT `votes` -- ALTER TABLE `votes` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- 使用表AUTO_INCREMENT `works` -- ALTER TABLE `works` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;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 */;
-- malloc.test -- -- db eval {INSERT INTO abc VALUES(randstr(100,100), randstr(1000,1000))} INSERT INTO abc VALUES(randstr(100,100), randstr(1000,1000))
-- ============================================= -- Drop extended property -- ============================================= EXEC sp_dropextendedproperty N'<property_name, sysname, n1>', N'<level0type, , user>', N'<level0name, sysname, dbo>', N'<level1type, , table>', N'<level1name, sysname, authors>', N'<level2type, , column>', N'<level2name, sysname, au_id>' GO
<gh_stars>1000+ -- 2017-11-20T12:00:14.710 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET DefaultValue='@SQL=select c_uom_id from m_product where M_product_ID=@M_Product_ID@',Updated=TO_TIMESTAMP('2017-11-20 12:00:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=549286 ;
/* Navicat MySQL Data Transfer Source Server : mysql Source Server Version : 80018 Source Host : localhost:3306 Source Database : oa_db Target Server Type : MYSQL Target Server Version : 80018 File Encoding : 65001 Date: 2020-09-22 08:05:00 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for oa_admin -- ---------------------------- DROP TABLE IF EXISTS `oa_admin`; CREATE TABLE `oa_admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户名', `password` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码', `sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性别', `age` int(4) DEFAULT NULL COMMENT '年龄', `nation` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '民族', `company` varchar(50) DEFAULT NULL COMMENT '单位', `depart` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '部门', `position` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '职位', `outlook` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '政治面貌', `phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '手机', `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of oa_admin -- ---------------------------- INSERT INTO `oa_admin` VALUES ('5', 'admin', '<PASSWORD>606de1fd2af172<PASSWORD>bf3', '男', '18', '汉族', 'nicai', 'nicai', '1', '团员', '110', '<EMAIL>'); INSERT INTO `oa_admin` VALUES ('6', 'admin1', '<PASSWORD>', '男', '123', '汉族', '123', '123', '2', '团员', '123', '<EMAIL>'); -- ---------------------------- -- Table structure for oa_auth_group -- ---------------------------- DROP TABLE IF EXISTS `oa_auth_group`; CREATE TABLE `oa_auth_group` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `title` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户组中文名称', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:为1正常,为0禁用', `rules` char(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户组拥有的规则id, 多个规则","隔开', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of oa_auth_group -- ---------------------------- INSERT INTO `oa_auth_group` VALUES ('1', '超级管理员', '1', ''); INSERT INTO `oa_auth_group` VALUES ('2', '管理员', '1', '1'); -- ---------------------------- -- Table structure for oa_auth_group_access -- ---------------------------- DROP TABLE IF EXISTS `oa_auth_group_access`; CREATE TABLE `oa_auth_group_access` ( `uid` mediumint(8) unsigned NOT NULL COMMENT '用户id', `group_id` mediumint(8) unsigned NOT NULL COMMENT '用户组id', UNIQUE KEY `uid_group_id` (`uid`,`group_id`), KEY `uid` (`uid`), KEY `group_id` (`group_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of oa_auth_group_access -- ---------------------------- INSERT INTO `oa_auth_group_access` VALUES ('5', '1'); INSERT INTO `oa_auth_group_access` VALUES ('6', '2'); -- ---------------------------- -- Table structure for oa_auth_rule -- ---------------------------- DROP TABLE IF EXISTS `oa_auth_rule`; CREATE TABLE `oa_auth_rule` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` char(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则唯一标识', `title` char(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则中文名称', `type` tinyint(1) NOT NULL DEFAULT '1', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:为1正常,为0禁用', `condition` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则表达式,为空表示存在就验证,不为空表示按照条件验证', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of oa_auth_rule -- ---------------------------- INSERT INTO `oa_auth_rule` VALUES ('1', 'admin/Mymes/index', '个人信息维护', '1', '1', ''); INSERT INTO `oa_auth_rule` VALUES ('2', 'admin/Admin/index', '管理员管理', '1', '1', ''); INSERT INTO `oa_auth_rule` VALUES ('3', 'admin/AuthGroup/index', '管理员权限组', '1', '1', ''); INSERT INTO `oa_auth_rule` VALUES ('4', 'admin/AuthRule/index', '管理员规则', '1', '1', ''); -- ---------------------------- -- Table structure for oa_book01 -- ---------------------------- DROP TABLE IF EXISTS `oa_book01`; CREATE TABLE `oa_book01` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `lei` varchar(200) NOT NULL COMMENT '右上角XX类', `hao` int(200) NOT NULL COMMENT '右上角XX号', `ti_jie` varchar(255) DEFAULT NULL COMMENT 'XX届', `ti_ci` int(65) DEFAULT NULL COMMENT 'XX次', `ti_hao` int(65) DEFAULT NULL COMMENT 'XX号', `tian_type` enum('3','2','1') DEFAULT '1' COMMENT '提案类型', `tian_anyou` varchar(255) DEFAULT NULL COMMENT '案由', `tian_ren` varchar(10) DEFAULT NULL COMMENT '第一提案人', `tian_ming` varchar(255) DEFAULT NULL COMMENT '名次', `tian_dang` varchar(20) DEFAULT NULL COMMENT '党派', `tian_zheng` int(65) DEFAULT NULL COMMENT '委员证号', `tian_youzheng` varchar(255) DEFAULT NULL COMMENT '邮政编号', `tian_phone` int(65) DEFAULT NULL COMMENT '联系电话', `tian_dan` varchar(50) DEFAULT NULL COMMENT '单位及职务', `tian_mail` varchar(50) DEFAULT NULL COMMENT '邮箱', `tian_dizhi` varchar(100) DEFAULT '' COMMENT '通讯地址', `tian_wenjian` varchar(255) DEFAULT NULL COMMENT '主题词文件', `tian_content` varchar(255) DEFAULT NULL COMMENT '提案内容', `tian_fujian` varchar(255) DEFAULT NULL COMMENT '附件', `tian_posttime` datetime(6) DEFAULT NULL COMMENT '提交时间', `tian_xiang` enum('2','1') DEFAULT '1' COMMENT '相关情况', `lian_ming` varchar(255) DEFAULT NULL COMMENT '提案联系人姓名', `lian_dan` varchar(255) DEFAULT NULL COMMENT '提案联系人单位', `lian_ren` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='插件表'; -- ---------------------------- -- Records of oa_book01 -- ----------------------------
 CREATE TABLE types ( id serial PRIMARY KEY, name text ); CREATE TABLE products ( id serial PRIMARY KEY, name text, type_id serial REFERENCES types (id), expired_date date, price money ); --1. Написать запрос получение всех продуктов с типом "СЫР" SELECT products.* FROM products, types WHERE products.type_id = (SELECT types.id WHERE types.name = 'СЫР'); --2. Написать запрос получения всех продуктов, у кого в имени -- есть слово "мороженное" SELECT * FROM products p WHERE p.name LIKE '%мороженное%'; --3. Написать запрос, который выводит все продукты, -- срок годности которых заканчивается в следующем месяце. SELECT * FROM products p WHERE p.expired_date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '1 mons'; --4. Написать запрос, который вывод самый дорогой продукт. SELECT products.* FROM products WHERE products.price IN (SELECT max(price) FROM products); --5. Написать запрос, который выводит количество всех продуктов -- определенного типа. SELECT count(*) FROM products, types WHERE products.type_id = (SELECT types.id WHERE types.name = 'МОЛОКО'); --6. Написать запрос получение всех продуктов -- с типом "СЫР" и "МОЛОКО" SELECT * FROM products, types WHERE products.type_id IN (SELECT types.id WHERE types.name = 'МОЛОКО' OR types.name = 'СЫР'); --7. Написать запрос, который выводит тип продуктов, -- которых осталось меньше 10 штук. SELECT types.name FROM types, products WHERE types.id = products.type_id GROUP BY types.name HAVING count(*) < 10; --8. Вывести все продукты и их тип. SELECT products.*, types.name FROM products, types WHERE products.type_id = types.id;
<gh_stars>10-100 startcode PostgreSql_SubscriptionGetSubscribersSql select distinct "Subscriber", "Endpoint" from "public"."EndpointNameSubscriptionData" where "MessageType" in (@type0) endcode
-- Name: GetPatientStatus -- Schema: posda_files -- Columns: ['status'] -- Args: ['patient_id'] -- Tags: ['NotInteractive', 'PatientStatus', 'Update'] -- Description: Get Patient Status select patient_import_status as status from patient_import_status where patient_id = ?
<filename>migrations/20201128074827_view_blocks_hash_btree_index.up.sql CREATE INDEX view_blocks_hash_btree_index ON view_blocks USING btree (hash);
CREATE FUNCTION [dbo].[netsqlazman_DBVersion] () RETURNS nvarchar(200) AS BEGIN return '3.6.0.x' END GO GRANT EXECUTE ON OBJECT::[dbo].[netsqlazman_DBVersion] TO [NetSqlAzMan_Readers] AS [dbo];
<reponame>coryschwartz/nebula-crawler<filename>migrations/000026_create_visits_table.down.sql DROP TABLE visits;
<reponame>databeast/apicore use flypost; BEGIN; CREATE TABLE flyers ( flyer_id INT NOT NULL UNIQUE DEFAULT unique_rowid() PRIMARY KEY , created_unix INT NOT NULL DEFAULT CAST(current_timestamp() AS INT), updated_unix INT NOT NULL DEFAULT CAST(current_timestamp() AS INT), creator_role STRING NOT NULL, scope_uri STRING NOT NULL UNIQUE, image_sha1 STRING NOT NULL, INDEX scope_uri_idx (scope_uri), FAMILY "primary" (flyer_id, created_unix, creator_role, scope_uri), FAMILY "filedata" (updated_unix, image_sha1 ) ); COMMIT;
CREATE TABLE ballots (id BIGINT NOT NULL, results_id BIGINT REFERENCES results (id) NOT NULL, PRIMARY KEY (results_id, id), referendum_id BIGINT, custom_ballot_id BIGINT, write_in BOOLEAN, image_url TEXT);
#standardSQL -- -- Compute the number of all transcripts and mitochondrial transcripts per cell. -- SELECT cell, SUM(trans_cnt) AS alltrans, SUM(IF(gene LIKE "mt-%", trans_cnt, 0)) AS mttrans, COUNT(DISTINCT gene) AS gene_cnt FROM `{{ RAW_DATA_TABLE }}` WHERE trans_cnt > 0 GROUP BY cell
-- -- AGGREGATES -- SELECT avg(four) AS avg_1 FROM onek; SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100; -- In 7.1, avg(float4) is computed using float8 arithmetic. -- Round the result to 3 digits to avoid platform-specific results. SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest; SELECT avg(gpa) AS avg_3_4 FROM ONLY student; SELECT sum(four) AS sum_1500 FROM onek; SELECT sum(a) AS sum_198 FROM aggtest; SELECT sum(b) AS avg_431_773 FROM aggtest; SELECT sum(gpa) AS avg_6_8 FROM ONLY student; SELECT max(four) AS max_3 FROM onek; SELECT max(a) AS max_100 FROM aggtest; SELECT max(aggtest.b) AS max_324_78 FROM aggtest; SELECT max(student.gpa) AS max_3_7 FROM student; SELECT count(four) AS cnt_1000 FROM onek; SELECT count(DISTINCT four) AS cnt_4 FROM onek; select ten, count(*), sum(four) from onek group by ten; select ten, count(four), sum(DISTINCT four) from onek group by ten; SELECT newavg(four) AS avg_1 FROM onek; SELECT newsum(four) AS sum_1500 FROM onek; SELECT newcnt(four) AS cnt_1000 FROM onek;
<reponame>opengauss-mirror/Yat<gh_stars>0 -- @testpoint: 条件语句if ...then ...else drop table if exists table_if_else_006; create table table_if_else_006(id int not null,name varchar2(32),job varchar2(32)); insert into table_if_else_006 values (1,'kobe','player'),(2,'lucy','singer'),(3,'tom','doctors'); create or replace procedure proc_if_else_0006( p_name in varchar2, p_job_code out varchar2 ) as loginid int default 0; begin select id into loginid from table_if_else_006 where name = p_name; if (loginid = 1) then p_job_code:='0001'; raise info 'the job_code is 0001'; elsif (loginid = 2) then p_job_code:='0002'; raise info 'the job_code is 0002'; else p_job_code:='0003'; raise info 'the job_code is 0003'; return; end if; end; / --test调用存储过程 declare v_job_code varchar2(10); begin proc_if_else_0006('kobe',v_job_code); end; / --test调用存储过程 declare v_job_code varchar2(10); begin proc_if_else_0006('lucy',v_job_code); end; / --test调用存储过程 declare v_job_code varchar2(10); begin proc_if_else_0006('tom',v_job_code); end; / drop procedure proc_if_else_0006; drop table if exists table_if_else_006;
drop table if exists entries; create table entries ( id integer primary key autoincrement, time timestamp not null, name text not null, email text not null, position text not null, years text not null, 'task_1' text not null, 'task_2' text not null, 'task_3' text not null, 'sq_1' text not null, 'sq_2' text not null, 'sq_3' text not null, comments text );
SELECT * FROM people LIMIT 10; SELECT * FROM people FETCH FIRST 10 ROWS ONLY;
USE gamebar ALTER TABLE employees MODIFY COLUMN middle_name VARCHAR(100);
<filename>actual/views/temporal_employee.sql CREATE OR REPLACE VIEW temporal_employee AS SELECT id ,departmentid ,locationid ,email ,status ,compensation ,hiredate ,createdate ,tsrange(COALESCE ( (SELECT createdate FROM temporal.employee WHERE modelid = t.id ORDER BY createdate DESC LIMIT 1), createdate ), null) as sys_period FROM employee t UNION ALL SELECT id ,departmentid ,locationid ,email ,status ,compensation ,hiredate ,createdate ,sys_period FROM temporal.vw_employee t ;
<reponame>lucasnapolilapenda/dvd /***** Table studios *****/ IF OBJECT_ID('production.Studios', 'U') is not NULL DROP TABLE production.Studios ; GO /***** Table studios Creation *****/ CREATE TABLE production.Studios ( StID SMALLINT IDENTITY(1,1) NOT NULL PRIMARY KEY, StValue NVARCHAR(20) NOT NULL, )
-- 1 up create table if not exists packages ( id integer primary key autoincrement, arch text, code text, errors text, package text, project text, repository text, updated text not null default current_timestamp, warnings text ); create table if not exists staging ( id integer primary key autoincrement, arch text, code text, errors text, package text, project text, repository text, updated text not null default current_timestamp, warnings text ); -- 1 down drop table if exists packages; drop table if exists staging; -- 2 up alter table packages add column info text; alter table staging add column info text;
SELECT ' pg_dump --table='||table_name||' --data-only --column-inserts sakila >'|| table_name ||'.sql' table_name FROM information_schema.tables WHERE table_schema='public' CREATE EXTENSION plperl select name, default_version, installed_version from pg_available_extensions
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50505 Source Host : localhost:3306 Source Database : house Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2020-06-19 07:48:33 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `accesses` -- ---------------------------- DROP TABLE IF EXISTS `accesses`; CREATE TABLE `accesses` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `roles` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `accessible_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `accessible_id` bigint(20) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `accesses_accessible_type_accessible_id_index` (`accessible_type`,`accessible_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of accesses -- ---------------------------- -- ---------------------------- -- Table structure for `action_events` -- ---------------------------- DROP TABLE IF EXISTS `action_events`; CREATE TABLE `action_events` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `batch_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(10) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `actionable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `actionable_id` int(10) unsigned NOT NULL, `target_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `target_id` int(10) unsigned NOT NULL, `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` int(10) unsigned DEFAULT NULL, `fields` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'running', `exception` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `original` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `changes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `action_events_actionable_type_actionable_id_index` (`actionable_type`,`actionable_id`), KEY `action_events_batch_id_model_type_model_id_index` (`batch_id`,`model_type`,`model_id`), KEY `action_events_user_id_index` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of action_events -- ---------------------------- -- ---------------------------- -- Table structure for `apartments` -- ---------------------------- DROP TABLE IF EXISTS `apartments`; CREATE TABLE `apartments` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci NOT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` bigint(20) unsigned NOT NULL, `city` bigint(20) unsigned NOT NULL, `created_by` bigint(20) unsigned NOT NULL, `rent` double(8,2) NOT NULL, `deposit` double(8,2) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `apartments_type_foreign` (`type`), KEY `apartments_city_foreign` (`city`), KEY `apartments_created_by_foreign` (`created_by`), CONSTRAINT `apartments_city_foreign` FOREIGN KEY (`city`) REFERENCES `cities` (`id`) ON DELETE CASCADE, CONSTRAINT `apartments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `apartments_type_foreign` FOREIGN KEY (`type`) REFERENCES `apartment_types` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of apartments -- ---------------------------- -- ---------------------------- -- Table structure for `apartment_types` -- ---------------------------- DROP TABLE IF EXISTS `apartment_types`; CREATE TABLE `apartment_types` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of apartment_types -- ---------------------------- INSERT INTO `apartment_types` VALUES ('1', 'Apartment', null, null); INSERT INTO `apartment_types` VALUES ('2', 'House', null, null); -- ---------------------------- -- Table structure for `cities` -- ---------------------------- DROP TABLE IF EXISTS `cities`; CREATE TABLE `cities` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=560 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of cities -- ---------------------------- INSERT INTO `cities` VALUES ('1', 'Allinge', null, null); INSERT INTO `cities` VALUES ('2', 'Allingåbro', null, null); INSERT INTO `cities` VALUES ('3', 'Almind', null, null); INSERT INTO `cities` VALUES ('4', 'Anholt', null, null); INSERT INTO `cities` VALUES ('5', 'Ans by', null, null); INSERT INTO `cities` VALUES ('6', 'Ansager', null, null); INSERT INTO `cities` VALUES ('7', 'Arden', null, null); INSERT INTO `cities` VALUES ('8', 'Askeby', null, null); INSERT INTO `cities` VALUES ('9', 'Asnæs', null, null); INSERT INTO `cities` VALUES ('10', 'Asperup', null, null); INSERT INTO `cities` VALUES ('11', 'Assens', null, null); INSERT INTO `cities` VALUES ('12', 'Asaa', null, null); INSERT INTO `cities` VALUES ('13', 'Augustenborg', null, null); INSERT INTO `cities` VALUES ('14', 'Aulum', null, null); INSERT INTO `cities` VALUES ('15', 'Auning', null, null); INSERT INTO `cities` VALUES ('16', 'Bagenkop', null, null); INSERT INTO `cities` VALUES ('17', 'Bagsværd', null, null); INSERT INTO `cities` VALUES ('18', 'Balle', null, null); INSERT INTO `cities` VALUES ('19', 'Ballerup', null, null); INSERT INTO `cities` VALUES ('20', 'Bandholm', null, null); INSERT INTO `cities` VALUES ('21', 'Barrit', null, null); INSERT INTO `cities` VALUES ('22', 'Beder', null, null); INSERT INTO `cities` VALUES ('23', 'Bedsted Thy', null, null); INSERT INTO `cities` VALUES ('24', 'Bevtoft', null, null); INSERT INTO `cities` VALUES ('25', 'Billum', null, null); INSERT INTO `cities` VALUES ('26', 'Billund', null, null); INSERT INTO `cities` VALUES ('27', 'Bindslev', null, null); INSERT INTO `cities` VALUES ('28', 'Birkerød', null, null); INSERT INTO `cities` VALUES ('29', 'Bjerringbro', null, null); INSERT INTO `cities` VALUES ('30', 'Bjert', null, null); INSERT INTO `cities` VALUES ('31', 'Bjæverskov', null, null); INSERT INTO `cities` VALUES ('32', 'Blokhus', null, null); INSERT INTO `cities` VALUES ('33', 'Blommenslyst', null, null); INSERT INTO `cities` VALUES ('34', 'Blåvand', null, null); INSERT INTO `cities` VALUES ('35', 'Boeslunde', null, null); INSERT INTO `cities` VALUES ('36', 'Bogense', null, null); INSERT INTO `cities` VALUES ('37', 'Bogø By', null, null); INSERT INTO `cities` VALUES ('38', 'Bolderslev', null, null); INSERT INTO `cities` VALUES ('39', 'Bording', null, null); INSERT INTO `cities` VALUES ('40', 'Borre', null, null); INSERT INTO `cities` VALUES ('41', 'Borup', null, null); INSERT INTO `cities` VALUES ('42', 'Brabrand', null, null); INSERT INTO `cities` VALUES ('43', 'Bramming', null, null); INSERT INTO `cities` VALUES ('44', 'Brande', null, null); INSERT INTO `cities` VALUES ('45', 'Branderup', null, null); INSERT INTO `cities` VALUES ('46', 'Bredebro', null, null); INSERT INTO `cities` VALUES ('47', 'Bredsten', null, null); INSERT INTO `cities` VALUES ('48', 'Brenderup', null, null); INSERT INTO `cities` VALUES ('49', 'Broager', null, null); INSERT INTO `cities` VALUES ('50', 'Broby', null, null); INSERT INTO `cities` VALUES ('51', 'Brovst', null, null); INSERT INTO `cities` VALUES ('52', 'Bryrup', null, null); INSERT INTO `cities` VALUES ('53', 'Brædstrup', null, null); INSERT INTO `cities` VALUES ('54', 'Brøndby', null, null); INSERT INTO `cities` VALUES ('55', 'Brøndby Strand', null, null); INSERT INTO `cities` VALUES ('56', 'Brønderslev', null, null); INSERT INTO `cities` VALUES ('57', 'Brønshøj', null, null); INSERT INTO `cities` VALUES ('58', 'Brørup', null, null); INSERT INTO `cities` VALUES ('59', 'Bylderup-Bov', null, null); INSERT INTO `cities` VALUES ('60', 'Bække', null, null); INSERT INTO `cities` VALUES ('61', 'Bækmarksbro', null, null); INSERT INTO `cities` VALUES ('62', 'Bælum', null, null); INSERT INTO `cities` VALUES ('63', 'Børkop', null, null); INSERT INTO `cities` VALUES ('64', 'Bøvlingbjerg', null, null); INSERT INTO `cities` VALUES ('65', 'Charlottenlund', null, null); INSERT INTO `cities` VALUES ('66', 'Christiansfeld', null, null); INSERT INTO `cities` VALUES ('67', 'Dalby', null, null); INSERT INTO `cities` VALUES ('68', 'Dalmose', null, null); INSERT INTO `cities` VALUES ('69', 'Dannemare', null, null); INSERT INTO `cities` VALUES ('70', 'Daugård', null, null); INSERT INTO `cities` VALUES ('71', 'Dianalund', null, null); INSERT INTO `cities` VALUES ('72', 'Dragør', null, null); INSERT INTO `cities` VALUES ('73', 'Dronninglund', null, null); INSERT INTO `cities` VALUES ('74', 'Dronningmølle', null, null); INSERT INTO `cities` VALUES ('75', 'Dybvad', null, null); INSERT INTO `cities` VALUES ('76', 'Ebberup', null, null); INSERT INTO `cities` VALUES ('77', 'Ebeltoft', null, null); INSERT INTO `cities` VALUES ('78', 'Egernsund', null, null); INSERT INTO `cities` VALUES ('79', 'Egtved', null, null); INSERT INTO `cities` VALUES ('80', 'Egå', null, null); INSERT INTO `cities` VALUES ('81', 'Ejby', null, null); INSERT INTO `cities` VALUES ('82', 'Ejstrupholm', null, null); INSERT INTO `cities` VALUES ('83', 'Engesvang', null, null); INSERT INTO `cities` VALUES ('84', 'Errindlev', null, null); INSERT INTO `cities` VALUES ('85', 'Erslev', null, null); INSERT INTO `cities` VALUES ('86', 'Esbjerg', null, null); INSERT INTO `cities` VALUES ('87', 'Eskebjerg', null, null); INSERT INTO `cities` VALUES ('88', 'Eskilstrup', null, null); INSERT INTO `cities` VALUES ('89', 'Espergærde', null, null); INSERT INTO `cities` VALUES ('90', 'Fakse', null, null); INSERT INTO `cities` VALUES ('91', 'Fakse Ladeplads', null, null); INSERT INTO `cities` VALUES ('92', 'Fanø', null, null); INSERT INTO `cities` VALUES ('93', 'Farsø', null, null); INSERT INTO `cities` VALUES ('94', 'Farum', null, null); INSERT INTO `cities` VALUES ('95', 'Fejø', null, null); INSERT INTO `cities` VALUES ('96', 'Ferritslev Fyn', null, null); INSERT INTO `cities` VALUES ('97', 'Fjenneslev', null, null); INSERT INTO `cities` VALUES ('98', 'Fjerritslev', null, null); INSERT INTO `cities` VALUES ('99', 'Flemming', null, null); INSERT INTO `cities` VALUES ('100', 'Fredensborg', null, null); INSERT INTO `cities` VALUES ('101', 'Fredericia', null, null); INSERT INTO `cities` VALUES ('102', 'Frederiksberg', null, null); INSERT INTO `cities` VALUES ('103', 'Frederikshavn', null, null); INSERT INTO `cities` VALUES ('104', 'Frederikssund', null, null); INSERT INTO `cities` VALUES ('105', 'Frederiksværk', null, null); INSERT INTO `cities` VALUES ('106', 'Frørup', null, null); INSERT INTO `cities` VALUES ('107', 'Frøstrup', null, null); INSERT INTO `cities` VALUES ('108', 'Fuglebjerg', null, null); INSERT INTO `cities` VALUES ('109', 'Fur', null, null); INSERT INTO `cities` VALUES ('110', 'Føllenslev', null, null); INSERT INTO `cities` VALUES ('111', 'Føvling', null, null); INSERT INTO `cities` VALUES ('112', 'Faaborg', null, null); INSERT INTO `cities` VALUES ('113', 'Fårevejle', null, null); INSERT INTO `cities` VALUES ('114', 'Fårup', null, null); INSERT INTO `cities` VALUES ('115', 'Fårvang', null, null); INSERT INTO `cities` VALUES ('116', 'Gadbjerg', null, null); INSERT INTO `cities` VALUES ('117', 'Gadstrup', null, null); INSERT INTO `cities` VALUES ('118', 'Galten', null, null); INSERT INTO `cities` VALUES ('119', 'Gandrup', null, null); INSERT INTO `cities` VALUES ('120', 'Gedser', null, null); INSERT INTO `cities` VALUES ('121', 'Gedsted', null, null); INSERT INTO `cities` VALUES ('122', 'Gedved', null, null); INSERT INTO `cities` VALUES ('123', 'Gelsted', null, null); INSERT INTO `cities` VALUES ('124', 'Gentofte', null, null); INSERT INTO `cities` VALUES ('125', 'Gesten', null, null); INSERT INTO `cities` VALUES ('126', 'Gilleleje', null, null); INSERT INTO `cities` VALUES ('127', 'Gislev', null, null); INSERT INTO `cities` VALUES ('128', 'Gislinge', null, null); INSERT INTO `cities` VALUES ('129', 'Gistrup', null, null); INSERT INTO `cities` VALUES ('130', 'Give', null, null); INSERT INTO `cities` VALUES ('131', 'Gjerlev', null, null); INSERT INTO `cities` VALUES ('132', 'Gjern', null, null); INSERT INTO `cities` VALUES ('133', 'Glamsbjerg', null, null); INSERT INTO `cities` VALUES ('134', 'Glejbjerg', null, null); INSERT INTO `cities` VALUES ('135', 'Glesborg', null, null); INSERT INTO `cities` VALUES ('136', 'Glostrup', null, null); INSERT INTO `cities` VALUES ('137', 'Glumsø', null, null); INSERT INTO `cities` VALUES ('138', 'Gram', null, null); INSERT INTO `cities` VALUES ('139', 'Gredstedbro', null, null); INSERT INTO `cities` VALUES ('140', 'Grenaa', null, null); INSERT INTO `cities` VALUES ('141', 'Greve', null, null); INSERT INTO `cities` VALUES ('142', 'Greve Strand', null, null); INSERT INTO `cities` VALUES ('143', 'Grevinge', null, null); INSERT INTO `cities` VALUES ('144', 'Grindsted', null, null); INSERT INTO `cities` VALUES ('145', 'Græsted', null, null); INSERT INTO `cities` VALUES ('146', 'Gråsten', null, null); INSERT INTO `cities` VALUES ('147', 'Gudbjerg', null, null); INSERT INTO `cities` VALUES ('148', 'Gudhjem', null, null); INSERT INTO `cities` VALUES ('149', 'Gudme', null, null); INSERT INTO `cities` VALUES ('150', 'Guldborg', null, null); INSERT INTO `cities` VALUES ('151', 'Gørding', null, null); INSERT INTO `cities` VALUES ('152', 'Gørlev', null, null); INSERT INTO `cities` VALUES ('153', 'Gørløse', null, null); INSERT INTO `cities` VALUES ('154', 'Haderslev', null, null); INSERT INTO `cities` VALUES ('155', 'Haderup', null, null); INSERT INTO `cities` VALUES ('156', 'Hadsten', null, null); INSERT INTO `cities` VALUES ('157', 'Hadsund', null, null); INSERT INTO `cities` VALUES ('158', 'Hagersten', null, null); INSERT INTO `cities` VALUES ('159', 'Hals', null, null); INSERT INTO `cities` VALUES ('160', 'Hammel', null, null); INSERT INTO `cities` VALUES ('161', 'Hampen', null, null); INSERT INTO `cities` VALUES ('162', 'Hanstholm', null, null); INSERT INTO `cities` VALUES ('163', 'Harboøre', null, null); INSERT INTO `cities` VALUES ('164', 'Harlev', null, null); INSERT INTO `cities` VALUES ('165', 'Harndrup', null, null); INSERT INTO `cities` VALUES ('166', 'Harpelunde', null, null); INSERT INTO `cities` VALUES ('167', 'Hasle', null, null); INSERT INTO `cities` VALUES ('168', 'Haslev', null, null); INSERT INTO `cities` VALUES ('169', 'Hasselager', null, null); INSERT INTO `cities` VALUES ('170', 'Havdrup', null, null); INSERT INTO `cities` VALUES ('171', 'Havndal', null, null); INSERT INTO `cities` VALUES ('172', 'Hedehusene', null, null); INSERT INTO `cities` VALUES ('173', 'Hedensted', null, null); INSERT INTO `cities` VALUES ('174', 'Hejls', null, null); INSERT INTO `cities` VALUES ('175', 'Hejnsvig', null, null); INSERT INTO `cities` VALUES ('176', 'Hellebæk', null, null); INSERT INTO `cities` VALUES ('177', 'Hellerup', null, null); INSERT INTO `cities` VALUES ('178', 'Helsinge', null, null); INSERT INTO `cities` VALUES ('179', 'Helsingør', null, null); INSERT INTO `cities` VALUES ('180', 'Hemmet', null, null); INSERT INTO `cities` VALUES ('181', 'Henne', null, null); INSERT INTO `cities` VALUES ('182', 'Herfølge', null, null); INSERT INTO `cities` VALUES ('183', 'Herlev', null, null); INSERT INTO `cities` VALUES ('184', 'Herlufmagle', null, null); INSERT INTO `cities` VALUES ('185', 'Herning', null, null); INSERT INTO `cities` VALUES ('186', 'Hesselager', null, null); INSERT INTO `cities` VALUES ('187', 'Hillerød', null, null); INSERT INTO `cities` VALUES ('188', 'Hinnerup', null, null); INSERT INTO `cities` VALUES ('189', 'Hirtshals', null, null); INSERT INTO `cities` VALUES ('190', 'Hjallerup', null, null); INSERT INTO `cities` VALUES ('191', 'Hjerm', null, null); INSERT INTO `cities` VALUES ('192', 'Hjortshøj', null, null); INSERT INTO `cities` VALUES ('193', 'Hjørring', null, null); INSERT INTO `cities` VALUES ('194', 'Hobro', null, null); INSERT INTO `cities` VALUES ('195', 'Holbæk', null, null); INSERT INTO `cities` VALUES ('196', 'Holeby', null, null); INSERT INTO `cities` VALUES ('197', 'Holme-Olstrup', null, null); INSERT INTO `cities` VALUES ('198', 'Holstebro', null, null); INSERT INTO `cities` VALUES ('199', 'Holsted', null, null); INSERT INTO `cities` VALUES ('200', 'Holte', null, null); INSERT INTO `cities` VALUES ('201', 'Horbelev', null, null); INSERT INTO `cities` VALUES ('202', 'Hornbæk', null, null); INSERT INTO `cities` VALUES ('203', 'Hornslet', null, null); INSERT INTO `cities` VALUES ('204', 'Hornsyld', null, null); INSERT INTO `cities` VALUES ('205', 'Horsens', null, null); INSERT INTO `cities` VALUES ('206', 'Horslunde', null, null); INSERT INTO `cities` VALUES ('207', 'Hovborg', null, null); INSERT INTO `cities` VALUES ('208', 'Hovedgård', null, null); INSERT INTO `cities` VALUES ('209', 'Humble', null, null); INSERT INTO `cities` VALUES ('210', 'Humlebæk', null, null); INSERT INTO `cities` VALUES ('211', 'Hundested', null, null); INSERT INTO `cities` VALUES ('212', 'Hundslund', null, null); INSERT INTO `cities` VALUES ('213', 'Hurup Thy', null, null); INSERT INTO `cities` VALUES ('214', 'Hvalsø', null, null); INSERT INTO `cities` VALUES ('215', 'Hvide Sande', null, null); INSERT INTO `cities` VALUES ('216', 'Hvidovre', null, null); INSERT INTO `cities` VALUES ('217', 'Højbjerg', null, null); INSERT INTO `cities` VALUES ('218', 'Højby', null, null); INSERT INTO `cities` VALUES ('219', 'Højer', null, null); INSERT INTO `cities` VALUES ('220', 'Højslev', null, null); INSERT INTO `cities` VALUES ('221', 'Høng', null, null); INSERT INTO `cities` VALUES ('222', 'Hørning', null, null); INSERT INTO `cities` VALUES ('223', 'Hørsholm', null, null); INSERT INTO `cities` VALUES ('224', 'Hørve', null, null); INSERT INTO `cities` VALUES ('225', 'Haarby', null, null); INSERT INTO `cities` VALUES ('226', 'Hårlev', null, null); INSERT INTO `cities` VALUES ('227', 'Idestrup', null, null); INSERT INTO `cities` VALUES ('228', 'Ikast', null, null); INSERT INTO `cities` VALUES ('229', 'Ishøj', null, null); INSERT INTO `cities` VALUES ('230', 'Janderup', null, null); INSERT INTO `cities` VALUES ('231', 'Jelling', null, null); INSERT INTO `cities` VALUES ('232', 'Jerslev', null, null); INSERT INTO `cities` VALUES ('233', 'Jerslev', null, null); INSERT INTO `cities` VALUES ('234', 'Jerup', null, null); INSERT INTO `cities` VALUES ('235', 'Jordrup', null, null); INSERT INTO `cities` VALUES ('236', 'Juelsminde', null, null); INSERT INTO `cities` VALUES ('237', 'Jyderup', null, null); INSERT INTO `cities` VALUES ('238', 'Jyllinge', null, null); INSERT INTO `cities` VALUES ('239', 'Jystrup', null, null); INSERT INTO `cities` VALUES ('240', 'Jægerspris', null, null); INSERT INTO `cities` VALUES ('241', 'Kalundborg', null, null); INSERT INTO `cities` VALUES ('242', 'Kalvehave', null, null); INSERT INTO `cities` VALUES ('243', 'Karby', null, null); INSERT INTO `cities` VALUES ('244', 'Karise', null, null); INSERT INTO `cities` VALUES ('245', 'Karlslunde', null, null); INSERT INTO `cities` VALUES ('246', 'Karrebæksminde', null, null); INSERT INTO `cities` VALUES ('247', 'Karup', null, null); INSERT INTO `cities` VALUES ('248', 'Kastrup', null, null); INSERT INTO `cities` VALUES ('249', 'Kerteminde', null, null); INSERT INTO `cities` VALUES ('250', 'Kettinge', null, null); INSERT INTO `cities` VALUES ('251', 'Kibæk', null, null); INSERT INTO `cities` VALUES ('252', 'Kirke Eskilstrup', null, null); INSERT INTO `cities` VALUES ('253', 'Kirke Hyllinge', null, null); INSERT INTO `cities` VALUES ('254', 'Kirke Såby', null, null); INSERT INTO `cities` VALUES ('255', 'Kjellerup', null, null); INSERT INTO `cities` VALUES ('256', 'Klampenborg', null, null); INSERT INTO `cities` VALUES ('257', 'Klarup', null, null); INSERT INTO `cities` VALUES ('258', 'Klemensker', null, null); INSERT INTO `cities` VALUES ('259', 'Klippinge', null, null); INSERT INTO `cities` VALUES ('260', 'Klovborg', null, null); INSERT INTO `cities` VALUES ('261', 'Knebel', null, null); INSERT INTO `cities` VALUES ('262', 'Kokkedal', null, null); INSERT INTO `cities` VALUES ('263', 'Kolding', null, null); INSERT INTO `cities` VALUES ('264', 'Kolind', null, null); INSERT INTO `cities` VALUES ('265', 'Kongens Lyngby', null, null); INSERT INTO `cities` VALUES ('266', 'Kongerslev', null, null); INSERT INTO `cities` VALUES ('267', 'Korsør', null, null); INSERT INTO `cities` VALUES ('268', 'Kruså', null, null); INSERT INTO `cities` VALUES ('269', 'Kvistgård', null, null); INSERT INTO `cities` VALUES ('270', 'Kværndrup', null, null); INSERT INTO `cities` VALUES ('271', 'København', null, null); INSERT INTO `cities` VALUES ('272', 'Køge', null, null); INSERT INTO `cities` VALUES ('273', 'Langebæk', null, null); INSERT INTO `cities` VALUES ('274', 'Langeskov', null, null); INSERT INTO `cities` VALUES ('275', 'Langå', null, null); INSERT INTO `cities` VALUES ('276', 'Lejre', null, null); INSERT INTO `cities` VALUES ('277', 'Lem', null, null); INSERT INTO `cities` VALUES ('278', 'Lemming', null, null); INSERT INTO `cities` VALUES ('279', 'Lemvig', null, null); INSERT INTO `cities` VALUES ('280', 'Lille Skensved', null, null); INSERT INTO `cities` VALUES ('281', 'Lintrup', null, null); INSERT INTO `cities` VALUES ('282', 'Liseleje', null, null); INSERT INTO `cities` VALUES ('283', 'Lundby', null, null); INSERT INTO `cities` VALUES ('284', 'Lunderskov', null, null); INSERT INTO `cities` VALUES ('285', 'Lynge', null, null); INSERT INTO `cities` VALUES ('286', 'Lystrup', null, null); INSERT INTO `cities` VALUES ('287', 'Læsø', null, null); INSERT INTO `cities` VALUES ('288', 'Løgstrup', null, null); INSERT INTO `cities` VALUES ('289', 'Løgstør', null, null); INSERT INTO `cities` VALUES ('290', 'Løgumkloster', null, null); INSERT INTO `cities` VALUES ('291', 'Løkken', null, null); INSERT INTO `cities` VALUES ('292', 'Løsning', null, null); INSERT INTO `cities` VALUES ('293', 'Låsby', null, null); INSERT INTO `cities` VALUES ('294', 'Malling', null, null); INSERT INTO `cities` VALUES ('295', 'Mariager', null, null); INSERT INTO `cities` VALUES ('296', 'Maribo', null, null); INSERT INTO `cities` VALUES ('297', 'Marslev', null, null); INSERT INTO `cities` VALUES ('298', 'Marstal', null, null); INSERT INTO `cities` VALUES ('299', 'Martofte', null, null); INSERT INTO `cities` VALUES ('300', 'Melby', null, null); INSERT INTO `cities` VALUES ('301', 'Mern', null, null); INSERT INTO `cities` VALUES ('302', 'Mesinge', null, null); INSERT INTO `cities` VALUES ('303', 'Middelfart', null, null); INSERT INTO `cities` VALUES ('304', 'Millinge', null, null); INSERT INTO `cities` VALUES ('305', 'Morud', null, null); INSERT INTO `cities` VALUES ('306', 'Mun<NAME>', null, null); INSERT INTO `cities` VALUES ('307', 'Munkebo', null, null); INSERT INTO `cities` VALUES ('308', 'Møldrup', null, null); INSERT INTO `cities` VALUES ('309', 'Mørke', null, null); INSERT INTO `cities` VALUES ('310', 'Mørkøv', null, null); INSERT INTO `cities` VALUES ('311', 'Måløv', null, null); INSERT INTO `cities` VALUES ('312', 'Mårslet', null, null); INSERT INTO `cities` VALUES ('313', 'Nakskov', null, null); INSERT INTO `cities` VALUES ('314', 'Nexø', null, null); INSERT INTO `cities` VALUES ('315', 'Nibe', null, null); INSERT INTO `cities` VALUES ('316', 'Nimtofte', null, null); INSERT INTO `cities` VALUES ('317', 'Nivå', null, null); INSERT INTO `cities` VALUES ('318', 'Nordborg', null, null); INSERT INTO `cities` VALUES ('319', 'Nyborg', null, null); INSERT INTO `cities` VALUES ('320', 'Nykøbing F', null, null); INSERT INTO `cities` VALUES ('321', 'Nykøbing M', null, null); INSERT INTO `cities` VALUES ('322', 'Nykøbing Sj', null, null); INSERT INTO `cities` VALUES ('323', 'Nyrup', null, null); INSERT INTO `cities` VALUES ('324', 'Nysted', null, null); INSERT INTO `cities` VALUES ('325', 'Nærum', null, null); INSERT INTO `cities` VALUES ('326', 'Næstved', null, null); INSERT INTO `cities` VALUES ('327', 'Nørager', null, null); INSERT INTO `cities` VALUES ('328', 'Nørre Alslev', null, null); INSERT INTO `cities` VALUES ('329', 'Nørre Asmindrup', null, null); INSERT INTO `cities` VALUES ('330', 'Nørre Nebel', null, null); INSERT INTO `cities` VALUES ('331', 'Nørre Snede', null, null); INSERT INTO `cities` VALUES ('332', 'Nørre Aaby', null, null); INSERT INTO `cities` VALUES ('333', 'Nørreballe', null, null); INSERT INTO `cities` VALUES ('334', 'Nørresundby', null, null); INSERT INTO `cities` VALUES ('335', 'Odder', null, null); INSERT INTO `cities` VALUES ('336', 'Odense', null, null); INSERT INTO `cities` VALUES ('337', 'Oksbøl', null, null); INSERT INTO `cities` VALUES ('338', 'Otterup', null, null); INSERT INTO `cities` VALUES ('339', 'Oure', null, null); INSERT INTO `cities` VALUES ('340', 'Outrup', null, null); INSERT INTO `cities` VALUES ('341', 'Padborg', null, null); INSERT INTO `cities` VALUES ('342', 'Pandrup', null, null); INSERT INTO `cities` VALUES ('343', 'Præstø', null, null); INSERT INTO `cities` VALUES ('344', 'Randbøl', null, null); INSERT INTO `cities` VALUES ('345', 'Randers', null, null); INSERT INTO `cities` VALUES ('346', 'Ranum', null, null); INSERT INTO `cities` VALUES ('347', 'Rask Mølle', null, null); INSERT INTO `cities` VALUES ('348', 'Redsted', null, null); INSERT INTO `cities` VALUES ('349', 'Regstrup', null, null); INSERT INTO `cities` VALUES ('350', 'Ribe', null, null); INSERT INTO `cities` VALUES ('351', 'Ringe', null, null); INSERT INTO `cities` VALUES ('352', 'Ringkøbing', null, null); INSERT INTO `cities` VALUES ('353', 'Ringsted', null, null); INSERT INTO `cities` VALUES ('354', 'Risskov', null, null); INSERT INTO `cities` VALUES ('355', 'Roskilde', null, null); INSERT INTO `cities` VALUES ('356', 'Roslev', null, null); INSERT INTO `cities` VALUES ('357', 'Rude', null, null); INSERT INTO `cities` VALUES ('358', 'Rudkøbing', null, null); INSERT INTO `cities` VALUES ('359', 'Ruds Vedby', null, null); INSERT INTO `cities` VALUES ('360', 'Rungsted Kyst', null, null); INSERT INTO `cities` VALUES ('361', 'Ry', null, null); INSERT INTO `cities` VALUES ('362', 'Rynkeby', null, null); INSERT INTO `cities` VALUES ('363', 'Ryomgård', null, null); INSERT INTO `cities` VALUES ('364', 'Ryslinge', null, null); INSERT INTO `cities` VALUES ('365', 'Rødby', null, null); INSERT INTO `cities` VALUES ('366', 'Rødding', null, null); INSERT INTO `cities` VALUES ('367', 'Rødekro', null, null); INSERT INTO `cities` VALUES ('368', 'Rødkærsbro', null, null); INSERT INTO `cities` VALUES ('369', 'Rødovre', null, null); INSERT INTO `cities` VALUES ('370', 'Rødvig Stevns', null, null); INSERT INTO `cities` VALUES ('371', 'Rømø', null, null); INSERT INTO `cities` VALUES ('372', 'Rønde', null, null); INSERT INTO `cities` VALUES ('373', 'Rønne', null, null); INSERT INTO `cities` VALUES ('374', 'Rønnede', null, null); INSERT INTO `cities` VALUES ('375', 'Rørvig', null, null); INSERT INTO `cities` VALUES ('376', 'Sabro', null, null); INSERT INTO `cities` VALUES ('377', 'Sakskøbing', null, null); INSERT INTO `cities` VALUES ('378', 'Saltum', null, null); INSERT INTO `cities` VALUES ('379', 'Samsø', null, null); INSERT INTO `cities` VALUES ('380', 'Sandved', null, null); INSERT INTO `cities` VALUES ('381', 'Sejerø', null, null); INSERT INTO `cities` VALUES ('382', 'Silkeborg', null, null); INSERT INTO `cities` VALUES ('383', 'Sindal', null, null); INSERT INTO `cities` VALUES ('384', 'Sjællands Odde', null, null); INSERT INTO `cities` VALUES ('385', 'Sjølund', null, null); INSERT INTO `cities` VALUES ('386', 'Skagen', null, null); INSERT INTO `cities` VALUES ('387', 'Skals', null, null); INSERT INTO `cities` VALUES ('388', 'Skamby', null, null); INSERT INTO `cities` VALUES ('389', 'Skanderborg', null, null); INSERT INTO `cities` VALUES ('390', 'Skibby', null, null); INSERT INTO `cities` VALUES ('391', 'Skive', null, null); INSERT INTO `cities` VALUES ('392', 'Skjern', null, null); INSERT INTO `cities` VALUES ('393', 'Skodsborg', null, null); INSERT INTO `cities` VALUES ('394', 'Skovlunde', null, null); INSERT INTO `cities` VALUES ('395', 'Skælskør', null, null); INSERT INTO `cities` VALUES ('396', 'Skærbæk', null, null); INSERT INTO `cities` VALUES ('397', 'Skævinge', null, null); INSERT INTO `cities` VALUES ('398', 'Skødstrup', null, null); INSERT INTO `cities` VALUES ('399', 'Skørping', null, null); INSERT INTO `cities` VALUES ('400', 'Skårup', null, null); INSERT INTO `cities` VALUES ('401', 'Slagelse', null, null); INSERT INTO `cities` VALUES ('402', 'Slangerup', null, null); INSERT INTO `cities` VALUES ('403', 'Smørum', null, null); INSERT INTO `cities` VALUES ('404', 'Snedsted', null, null); INSERT INTO `cities` VALUES ('405', 'Snekkersten', null, null); INSERT INTO `cities` VALUES ('406', 'Snertinge', null, null); INSERT INTO `cities` VALUES ('407', 'Solbjerg', null, null); INSERT INTO `cities` VALUES ('408', 'Solrød Strand', null, null); INSERT INTO `cities` VALUES ('409', 'Sommersted', null, null); INSERT INTO `cities` VALUES ('410', 'Sorring', null, null); INSERT INTO `cities` VALUES ('411', 'Sorø', null, null); INSERT INTO `cities` VALUES ('412', 'Spenstrup', null, null); INSERT INTO `cities` VALUES ('413', 'Spjald', null, null); INSERT INTO `cities` VALUES ('414', 'Sporup', null, null); INSERT INTO `cities` VALUES ('415', 'Spøttrup', null, null); INSERT INTO `cities` VALUES ('416', 'Stakroge', null, null); INSERT INTO `cities` VALUES ('417', 'Stege', null, null); INSERT INTO `cities` VALUES ('418', 'Stenderup', null, null); INSERT INTO `cities` VALUES ('419', 'Stenlille', null, null); INSERT INTO `cities` VALUES ('420', 'Stenløse', null, null); INSERT INTO `cities` VALUES ('421', 'Stenstrup', null, null); INSERT INTO `cities` VALUES ('422', 'Stensved', null, null); INSERT INTO `cities` VALUES ('423', 'Stoholm', null, null); INSERT INTO `cities` VALUES ('424', 'Stokkemarke', null, null); INSERT INTO `cities` VALUES ('425', 'Store Fuglede', null, null); INSERT INTO `cities` VALUES ('426', 'Store Heddinge', null, null); INSERT INTO `cities` VALUES ('427', 'Store Merløse', null, null); INSERT INTO `cities` VALUES ('428', 'Storvorde', null, null); INSERT INTO `cities` VALUES ('429', 'Stouby', null, null); INSERT INTO `cities` VALUES ('430', 'Strandby', null, null); INSERT INTO `cities` VALUES ('431', 'Struer', null, null); INSERT INTO `cities` VALUES ('432', 'Strøby', null, null); INSERT INTO `cities` VALUES ('433', 'Stubbekøbing', null, null); INSERT INTO `cities` VALUES ('434', 'Støvring', null, null); INSERT INTO `cities` VALUES ('435', 'Suldrup', null, null); INSERT INTO `cities` VALUES ('436', 'Sulsted', null, null); INSERT INTO `cities` VALUES ('437', 'Sunds', null, null); INSERT INTO `cities` VALUES ('438', 'Svaneke', null, null); INSERT INTO `cities` VALUES ('439', 'Svebølle', null, null); INSERT INTO `cities` VALUES ('440', 'Svendborg', null, null); INSERT INTO `cities` VALUES ('441', 'Svenstrup', null, null); INSERT INTO `cities` VALUES ('442', 'Svinninge', null, null); INSERT INTO `cities` VALUES ('443', 'Sydals', null, null); INSERT INTO `cities` VALUES ('444', 'Sæby', null, null); INSERT INTO `cities` VALUES ('445', 'Søborg', null, null); INSERT INTO `cities` VALUES ('446', 'Søby Ærø', null, null); INSERT INTO `cities` VALUES ('447', 'Søllested', null, null); INSERT INTO `cities` VALUES ('448', 'Sønder Felding', null, null); INSERT INTO `cities` VALUES ('449', 'Sønder Omme', null, null); INSERT INTO `cities` VALUES ('450', 'Sønder Stenderup', null, null); INSERT INTO `cities` VALUES ('451', 'Sønderborg', null, null); INSERT INTO `cities` VALUES ('452', 'Søndersø', null, null); INSERT INTO `cities` VALUES ('453', 'Sørvad', null, null); INSERT INTO `cities` VALUES ('454', 'Tappernøje', null, null); INSERT INTO `cities` VALUES ('455', 'Tarm', null, null); INSERT INTO `cities` VALUES ('456', 'Terndrup', null, null); INSERT INTO `cities` VALUES ('457', 'Them', null, null); INSERT INTO `cities` VALUES ('458', 'Thisted', null, null); INSERT INTO `cities` VALUES ('459', 'Thorsø', null, null); INSERT INTO `cities` VALUES ('460', 'Thyborøn', null, null); INSERT INTO `cities` VALUES ('461', 'Thyholm', null, null); INSERT INTO `cities` VALUES ('462', 'Tikøb', null, null); INSERT INTO `cities` VALUES ('463', 'Tilst', null, null); INSERT INTO `cities` VALUES ('464', 'Tim', null, null); INSERT INTO `cities` VALUES ('465', 'Tinglev', null, null); INSERT INTO `cities` VALUES ('466', 'Tistrup', null, null); INSERT INTO `cities` VALUES ('467', 'Tisvildeleje', null, null); INSERT INTO `cities` VALUES ('468', 'Tjele', null, null); INSERT INTO `cities` VALUES ('469', 'Tjæreborg', null, null); INSERT INTO `cities` VALUES ('470', 'Toftlund', null, null); INSERT INTO `cities` VALUES ('471', 'Tommerup', null, null); INSERT INTO `cities` VALUES ('472', 'Toreby', null, null); INSERT INTO `cities` VALUES ('473', 'Torrig', null, null); INSERT INTO `cities` VALUES ('474', 'Tranbjerg J', null, null); INSERT INTO `cities` VALUES ('475', 'Tranekær', null, null); INSERT INTO `cities` VALUES ('476', 'Trige', null, null); INSERT INTO `cities` VALUES ('477', 'Trustrup', null, null); INSERT INTO `cities` VALUES ('478', 'Tureby', null, null); INSERT INTO `cities` VALUES ('479', 'Tylstrup', null, null); INSERT INTO `cities` VALUES ('480', 'Tølløse', null, null); INSERT INTO `cities` VALUES ('481', 'Tønder', null, null); INSERT INTO `cities` VALUES ('482', 'Tørring', null, null); INSERT INTO `cities` VALUES ('483', 'Tårs', null, null); INSERT INTO `cities` VALUES ('484', 'Taastrup', null, null); INSERT INTO `cities` VALUES ('485', 'Ugerløse', null, null); INSERT INTO `cities` VALUES ('486', 'Uldum', null, null); INSERT INTO `cities` VALUES ('487', 'Ulfborg', null, null); INSERT INTO `cities` VALUES ('488', 'Ullerslev', null, null); INSERT INTO `cities` VALUES ('489', 'Ulstrup', null, null); INSERT INTO `cities` VALUES ('490', 'Vadum', null, null); INSERT INTO `cities` VALUES ('491', 'Valby', null, null); INSERT INTO `cities` VALUES ('492', 'Vallensbæk', null, null); INSERT INTO `cities` VALUES ('493', 'Vallensbæk Strand', null, null); INSERT INTO `cities` VALUES ('494', 'Vamdrup', null, null); INSERT INTO `cities` VALUES ('495', 'Vandel', null, null); INSERT INTO `cities` VALUES ('496', 'Vanløse', null, null); INSERT INTO `cities` VALUES ('497', 'Varde', null, null); INSERT INTO `cities` VALUES ('498', 'Vedbæk', null, null); INSERT INTO `cities` VALUES ('499', 'Veflinge', null, null); INSERT INTO `cities` VALUES ('500', 'Vejby', null, null); INSERT INTO `cities` VALUES ('501', 'Vejen', null, null); INSERT INTO `cities` VALUES ('502', 'Vejers Strand', null, null); INSERT INTO `cities` VALUES ('503', 'Vejle', null, null); INSERT INTO `cities` VALUES ('504', 'Vejle Øst', null, null); INSERT INTO `cities` VALUES ('505', 'Vejstrup', null, null); INSERT INTO `cities` VALUES ('506', 'Veksø Sjælland', null, null); INSERT INTO `cities` VALUES ('507', 'Vemb', null, null); INSERT INTO `cities` VALUES ('508', 'Vemmelev', null, null); INSERT INTO `cities` VALUES ('509', 'Vesløs', null, null); INSERT INTO `cities` VALUES ('510', 'Vestbjerg', null, null); INSERT INTO `cities` VALUES ('511', 'Vester Skerninge', null, null); INSERT INTO `cities` VALUES ('512', 'Vesterborg', null, null); INSERT INTO `cities` VALUES ('513', 'Vestervig', null, null); INSERT INTO `cities` VALUES ('514', 'Viborg', null, null); INSERT INTO `cities` VALUES ('515', 'Viby J', null, null); INSERT INTO `cities` VALUES ('516', 'Viby Sjælland', null, null); INSERT INTO `cities` VALUES ('517', 'Videbæk', null, null); INSERT INTO `cities` VALUES ('518', 'Vig', null, null); INSERT INTO `cities` VALUES ('519', 'Vildbjerg', null, null); INSERT INTO `cities` VALUES ('520', 'Vils', null, null); INSERT INTO `cities` VALUES ('521', 'Vinderup', null, null); INSERT INTO `cities` VALUES ('522', 'Vipperød', null, null); INSERT INTO `cities` VALUES ('523', 'Virum', null, null); INSERT INTO `cities` VALUES ('524', 'Vissenbjerg', null, null); INSERT INTO `cities` VALUES ('525', 'Viuf', null, null); INSERT INTO `cities` VALUES ('526', 'Vodskov', null, null); INSERT INTO `cities` VALUES ('527', 'Vojens', null, null); INSERT INTO `cities` VALUES ('528', 'Vonge', null, null); INSERT INTO `cities` VALUES ('529', 'Vorbasse', null, null); INSERT INTO `cities` VALUES ('530', 'Vordingborg', null, null); INSERT INTO `cities` VALUES ('531', 'Vrå', null, null); INSERT INTO `cities` VALUES ('532', 'Væggerløse', null, null); INSERT INTO `cities` VALUES ('533', 'Værløse', null, null); INSERT INTO `cities` VALUES ('534', 'Ærøskøbing', null, null); INSERT INTO `cities` VALUES ('535', 'Ølgod', null, null); INSERT INTO `cities` VALUES ('536', 'Ølsted', null, null); INSERT INTO `cities` VALUES ('537', 'Ølstykke', null, null); INSERT INTO `cities` VALUES ('538', 'Ørbæk', null, null); INSERT INTO `cities` VALUES ('539', 'Ørnhøj', null, null); INSERT INTO `cities` VALUES ('540', 'Ørsted', null, null); INSERT INTO `cities` VALUES ('541', 'Ørum Djurs', null, null); INSERT INTO `cities` VALUES ('542', 'Østbirk', null, null); INSERT INTO `cities` VALUES ('543', 'Øster Assels', null, null); INSERT INTO `cities` VALUES ('544', 'Øster Ulslev', null, null); INSERT INTO `cities` VALUES ('545', 'Øster Vrå', null, null); INSERT INTO `cities` VALUES ('546', 'Østermarie', null, null); INSERT INTO `cities` VALUES ('547', 'Aabenraa', null, null); INSERT INTO `cities` VALUES ('548', 'Aabybro', null, null); INSERT INTO `cities` VALUES ('549', 'Åbyhøj', null, null); INSERT INTO `cities` VALUES ('550', 'Aakirkeby', null, null); INSERT INTO `cities` VALUES ('551', 'Aalborg', null, null); INSERT INTO `cities` VALUES ('552', 'Ålbæk', null, null); INSERT INTO `cities` VALUES ('553', 'Aalestrup', null, null); INSERT INTO `cities` VALUES ('554', 'Ålsgårde', null, null); INSERT INTO `cities` VALUES ('555', 'Århus', null, null); INSERT INTO `cities` VALUES ('556', 'Årre', null, null); INSERT INTO `cities` VALUES ('557', 'Aars', null, null); INSERT INTO `cities` VALUES ('558', 'Årslev', null, null); INSERT INTO `cities` VALUES ('559', 'Aarup', null, null); -- ---------------------------- -- Table structure for `failed_jobs` -- ---------------------------- DROP TABLE IF EXISTS `failed_jobs`; CREATE TABLE `failed_jobs` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of failed_jobs -- ---------------------------- -- ---------------------------- -- Table structure for `invoices` -- ---------------------------- DROP TABLE IF EXISTS `invoices`; CREATE TABLE `invoices` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `handle` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status_id` int(10) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `subscription_id` bigint(20) unsigned NOT NULL, `amount` int(11) NOT NULL, `amount_ex_vat` int(11) NOT NULL, `amount_vat` int(11) NOT NULL, `currency` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created` datetime NOT NULL, `settled` datetime DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoices_user_id_foreign` (`user_id`), KEY `invoices_subscription_id_foreign` (`subscription_id`), KEY `invoices_status_id_foreign` (`status_id`), CONSTRAINT `invoices_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `invoice_statuses` (`id`), CONSTRAINT `invoices_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE CASCADE, CONSTRAINT `invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of invoices -- ---------------------------- -- ---------------------------- -- Table structure for `invoice_items` -- ---------------------------- DROP TABLE IF EXISTS `invoice_items`; CREATE TABLE `invoice_items` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `invoice_id` bigint(20) unsigned NOT NULL, `text` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `amount` int(11) NOT NULL, `amount_ex_vat` int(11) NOT NULL, `amount_vat` int(11) NOT NULL, `quantity` int(11) NOT NULL, `plan_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoice_items_invoice_id_foreign` (`invoice_id`), CONSTRAINT `invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of invoice_items -- ---------------------------- -- ---------------------------- -- Table structure for `invoice_statuses` -- ---------------------------- DROP TABLE IF EXISTS `invoice_statuses`; CREATE TABLE `invoice_statuses` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of invoice_statuses -- ---------------------------- -- ---------------------------- -- Table structure for `media` -- ---------------------------- DROP TABLE IF EXISTS `media`; CREATE TABLE `media` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) unsigned NOT NULL, `collection_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `file_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `mime_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `disk` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `size` bigint(20) unsigned NOT NULL, `manipulations` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `custom_properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `responsive_images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `order_column` int(10) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `media_model_type_model_id_index` (`model_type`,`model_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of media -- ---------------------------- -- ---------------------------- -- Table structure for `migrations` -- ---------------------------- DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of migrations -- ---------------------------- INSERT INTO `migrations` VALUES ('1', '2013_11_20_110939_create_cities_table', '1'); INSERT INTO `migrations` VALUES ('2', '2014_10_12_000000_create_users_table', '1'); INSERT INTO `migrations` VALUES ('3', '2014_10_12_100000_create_password_resets_table', '1'); INSERT INTO `migrations` VALUES ('4', '2017_05_28_115649_create_gates_table', '1'); INSERT INTO `migrations` VALUES ('5', '2018_01_01_000000_create_action_events_table', '1'); INSERT INTO `migrations` VALUES ('6', '2019_05_10_000000_add_fields_to_action_events_table', '1'); INSERT INTO `migrations` VALUES ('7', '2019_08_19_000000_create_failed_jobs_table', '1'); INSERT INTO `migrations` VALUES ('8', '2019_10_09_143453_create_accesses_table', '1'); INSERT INTO `migrations` VALUES ('9', '2019_11_20_164411_create_apartment_types_table', '1'); INSERT INTO `migrations` VALUES ('10', '2019_11_21_192914_create_apartments_table', '1'); INSERT INTO `migrations` VALUES ('11', '2019_11_27_173801_create_media_table', '1'); INSERT INTO `migrations` VALUES ('12', '2020_01_01_194912_create_social_facebook_accounts_table', '1'); INSERT INTO `migrations` VALUES ('13', '2020_01_04_200000_create_plans_table', '1'); INSERT INTO `migrations` VALUES ('14', '2020_01_25_191725_create_user_payments_table', '1'); INSERT INTO `migrations` VALUES ('15', '2020_01_31_202529_create_user_payment_methods_table', '1'); INSERT INTO `migrations` VALUES ('16', '2020_01_32_201806_create_subscriptions_table', '1'); INSERT INTO `migrations` VALUES ('17', '2020_03_05_180102_create_invoice_statuses_table', '1'); INSERT INTO `migrations` VALUES ('18', '2020_03_05_180103_create_invoices_table', '1'); INSERT INTO `migrations` VALUES ('19', '2020_03_05_180110_create_invoice_items_table', '1'); -- ---------------------------- -- Table structure for `password_resets` -- ---------------------------- DROP TABLE IF EXISTS `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; -- ---------------------------- -- Records of password_resets -- ---------------------------- -- ---------------------------- -- Table structure for `plans` -- ---------------------------- DROP TABLE IF EXISTS `plans`; CREATE TABLE `plans` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `plan_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `is_default` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of plans -- ---------------------------- INSERT INTO `plans` VALUES ('1', 'plan-db6d9', '1', '2020-06-18 05:41:40', '2020-06-18 05:41:43'); -- ---------------------------- -- Table structure for `roles` -- ---------------------------- DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of roles -- ---------------------------- -- ---------------------------- -- Table structure for `role_permission` -- ---------------------------- DROP TABLE IF EXISTS `role_permission`; CREATE TABLE `role_permission` ( `role_id` int(10) unsigned NOT NULL, `permission_slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`role_id`,`permission_slug`), CONSTRAINT `role_permission_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of role_permission -- ---------------------------- -- ---------------------------- -- Table structure for `role_user` -- ---------------------------- DROP TABLE IF EXISTS `role_user`; CREATE TABLE `role_user` ( `role_id` int(10) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`role_id`,`user_id`), KEY `role_user_user_id_foreign` (`user_id`), CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE, CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of role_user -- ---------------------------- -- ---------------------------- -- Table structure for `social_facebook_accounts` -- ---------------------------- DROP TABLE IF EXISTS `social_facebook_accounts`; CREATE TABLE `social_facebook_accounts` ( `user_id` bigint(20) NOT NULL, `provider_user_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `provider` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of social_facebook_accounts -- ---------------------------- -- ---------------------------- -- Table structure for `subscriptions` -- ---------------------------- DROP TABLE IF EXISTS `subscriptions`; CREATE TABLE `subscriptions` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint(20) unsigned NOT NULL, `plan_id` bigint(20) unsigned NOT NULL, `card_id` bigint(20) unsigned NOT NULL, `status` int(11) NOT NULL, `subscription_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `subscription_create` timestamp NULL DEFAULT NULL, `trial_end` timestamp NULL DEFAULT NULL, `next_invoice` timestamp NULL DEFAULT NULL, `change_card_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `subscriptions_user_id_foreign` (`user_id`), KEY `subscriptions_plan_id_foreign` (`plan_id`), KEY `subscriptions_card_id_foreign` (`card_id`), CONSTRAINT `subscriptions_card_id_foreign` FOREIGN KEY (`card_id`) REFERENCES `user_payment_methods` (`id`) ON DELETE CASCADE, CONSTRAINT `subscriptions_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE CASCADE, CONSTRAINT `subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of subscriptions -- ---------------------------- INSERT INTO `subscriptions` VALUES ('1', '1', '1', '1', '1', 'sub-0050', '2020-06-17 21:59:41', '2020-07-01 21:59:41', '2020-07-01 21:59:41', 'https://checkout.reepay.com/#/subscription/pay/da_DK/6317fef916620e26f51497c84715e437/sub-0050', '2020-06-17 22:00:06', '2020-06-17 22:00:06'); -- ---------------------------- -- Table structure for `users` -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `last_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `city` bigint(20) unsigned DEFAULT NULL, `postal_code` bigint(20) DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `password_autogenerated` tinyint(1) NOT NULL DEFAULT 0, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_city_foreign` (`city`), CONSTRAINT `users_city_foreign` FOREIGN KEY (`city`) REFERENCES `cities` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of users -- ---------------------------- INSERT INTO `users` VALUES ('1', 'Aleksandar', 'Gordic', '<EMAIL>', '+381600999999', 'K<NAME> bb 31230 Arilje', '559', '1234', null, null, '$2y$10$pI1XXflHinBr8PZw4.8PEOHoRHUBj4s/U1i/v6U/6zkjuLw4s1jei', '0', null, '2020-06-15 10:29:32', '2020-06-15 10:33:41'); -- ---------------------------- -- Table structure for `user_payments` -- ---------------------------- DROP TABLE IF EXISTS `user_payments`; CREATE TABLE `user_payments` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint(20) unsigned NOT NULL, `handler` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `customer_handler` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_payments_user_id_foreign` (`user_id`), CONSTRAINT `user_payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of user_payments -- ---------------------------- INSERT INTO `user_payments` VALUES ('1', '1', 'cs_4bb590e490faf4cc9e84dff53a27fcbb', 'cust-0034', '2020-06-15 10:34:12', '2020-06-17 21:05:37'); -- ---------------------------- -- Table structure for `user_payment_methods` -- ---------------------------- DROP TABLE IF EXISTS `user_payment_methods`; CREATE TABLE `user_payment_methods` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint(20) unsigned NOT NULL, `handler` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `masked_card` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `card_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `exp_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_payment_methods_user_id_foreign` (`user_id`), CONSTRAINT `user_payment_methods_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of user_payment_methods -- ---------------------------- INSERT INTO `user_payment_methods` VALUES ('1', '1', 'ca_208968d7ecae67b64b969b14717b7657', '411111XXXXXX1111', 'visa', '05-23', '2020-06-15 23:54:16', '2020-06-15 23:54:16'); INSERT INTO `user_payment_methods` VALUES ('2', '1', 'ca_c1da81beea884d7cf3485122396fa1a9', '411111XXXXXX1111', 'visa', '06-22', '2020-06-15 23:55:27', '2020-06-15 23:55:27'); INSERT INTO `user_payment_methods` VALUES ('3', '1', 'ca_6865260a43a7961fefd07d65cd6407e6', '411111XXXXXX1111', 'visa', '02-25', '2020-06-17 21:06:31', '2020-06-17 21:06:31'); INSERT INTO `user_payment_methods` VALUES ('4', '1', 'ca_72fd85a4454e300dd2137cff118435d0', '411111XXXXXX1111', 'visa', '05-22', '2020-06-17 21:08:55', '2020-06-17 21:08:55'); INSERT INTO `user_payment_methods` VALUES ('5', '1', 'ca_c474fc0d434ca4545258c9e909bf1dd5', '411111XXXXXX1111', 'visa', '11-21', '2020-06-17 21:10:47', '2020-06-17 21:10:47'); INSERT INTO `user_payment_methods` VALUES ('6', '1', 'ca_b9414fd11682597e80e902e01990b898', '411111XXXXXX1111', 'visa', '02-22', '2020-06-17 21:47:51', '2020-06-17 21:47:51'); INSERT INTO `user_payment_methods` VALUES ('7', '1', 'ca_cfd8c83db7961cfc9006398b93ddb6cb', '411111XXXXXX1111', 'visa', '11-22', '2020-06-17 21:59:25', '2020-06-17 21:59:25');
<gh_stars>10-100 DROP TABLE if exists ims_new_feature; CREATE TABLE ims_new_feature ( item_code char(18), mps_code varchar(25), grade varchar(20), status varchar(20), body varchar(30), edge varchar(30), surface_type varchar(30), surface_finish varchar(30), surface_application varchar(30), design_style varchar(30), design_look varchar(30), recommended_grout_joint_min varchar(10), recommended_grout_joint_max varchar(10), warranty numeric(4), created_date date, launched_date date, dropped_date date, last_modified_date date, version numeric(15), PRIMARY KEY (item_code), CONSTRAINT new_feature_ims_fkey FOREIGN KEY (item_code) REFERENCES ims (itemcd) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE ); CREATE INDEX ims_new_feature_mps_code_idx ON ims_new_feature USING btree (mps_code); CREATE INDEX ims_new_feature_status_idx ON ims_new_feature USING btree (status); CREATE INDEX ims_new_feature_grade_idx ON ims_new_feature USING btree (grade); COMMIT;
<gh_stars>1-10 ALTER TABLE posts DROP COLUMN IF EXISTS author_id;
<reponame>rahulbelokar/SSIO2017Samples<filename>Chapter 13 - Managing and monitoring SQL Server/12 - Using xevents to detect autogrowth events.sql --############################################################################## -- -- SAMPLE SCRIPTS TO ACCOMPANY "SQL SERVER 2017 ADMINISTRATION INSIDE OUT" -- -- © 2018 <NAME> -- --############################################################################## -- -- CHAPTER 13: MANAGING AND MONITORING SQL SERVER -- T-SQL SAMPLE 1 -- -- Create session to detect autogrowth events CREATE EVENT SESSION [autogrowths] ON SERVER ADD EVENT sqlserver.database_file_size_change( ACTION(package0.collect_system_time, sqlserver.database_id , sqlserver.database_name,sqlserver.sql_text)), ADD EVENT sqlserver.databases_log_file_size_changed( ACTION(package0.collect_system_time, sqlserver.database_id , sqlserver.database_name, sqlserver.sql_text)) ADD TARGET package0.event_file( -- .xel file target SET filename=N'F:\DATA\autogrowths.xel'), ADD TARGET package0.histogram( -- Histogram target, counting events per database_name SET filtering_event_name=N'sqlserver.database_file_size_change' , source = N'database_name', source_type = (0)) --Start session at server startup WITH (STARTUP_STATE=ON); GO -- Start the session now ALTER EVENT SESSION [autogrowths] ON SERVER STATE = START;
<reponame>easydaniel/loan<gh_stars>10-100 CREATE TABLE IF NOT EXISTS users ( username varchar(255) NOT NULL UNIQUE primary key, password varchar(255) NOT NULL );
<reponame>chengwenxin/sqlite-parser<filename>test/sql/official-suite/savepoint5-1.sql -- original: savepoint5.test -- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test SAVEPOINT sp1; CREATE TABLE t1(x); INSERT INTO t1 VALUES(1); SELECT count(*) FROM sqlite_master; SELECT * FROM t1 ;ROLLBACK TO sp1; SELECT count(*) FROM sqlite_master ;CREATE TABLE t1(x); INSERT INTO t1 VALUES(1); SELECT count(*) FROM sqlite_master; SELECT * FROM t1;
<gh_stars>0 -- $Id: acs-sc-msg-types-create.sql,v 1.4 2015/12/04 13:50:05 cvs Exp $ begin acs_object_type.create_type ( supertype => 'acs_object', object_type => 'acs_sc_msg_type', pretty_name => 'ACS SC Message Type', pretty_plural => 'ACS SC Message Types', table_name => 'acs_sc_msg_types', id_column => 'msg_type_id' ); end; / show errors create table acs_sc_msg_types ( msg_type_id integer constraint acs_sc_msg_type_id_fk references acs_objects(object_id) on delete cascade constraint acs_sc_msg_type_pk primary key, msg_type_name varchar2(100) constraint acs_sc_msg_type_name_un unique ); create table acs_sc_msg_type_elements ( msg_type_id integer constraint acs_sc_msg_type_el_mtype_id_fk references acs_sc_msg_types(msg_type_id) on delete cascade, element_name varchar2(100), element_msg_type_id integer constraint acs_sc_msg_type_el_emti_id_fk references acs_sc_msg_types(msg_type_id), element_msg_type_isset_p char(1) constraint acs_msg_type_el_set_p_ck check (element_msg_type_isset_p in ('t', 'f')), element_pos integer ); create or replace package acs_sc_msg_type as function new ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, msg_type_spec in varchar2 ) return acs_sc_msg_types.msg_type_id%TYPE; procedure del ( msg_type_id in acs_sc_msg_types.msg_type_id%TYPE default null, msg_type_name in acs_sc_msg_types.msg_type_name%TYPE default null ); function get_id ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE ) return acs_sc_msg_types.msg_type_id%TYPE; function get_name ( msg_type_id in acs_sc_msg_types.msg_type_id%TYPE ) return acs_sc_msg_types.msg_type_name%TYPE; -- ask nd about name function parse_spec ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, msg_type_spec in varchar2 ) return integer; function new_element ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, element_name in acs_sc_msg_type_elements.element_name%TYPE, element_msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, element_msg_type_isset_p in acs_sc_msg_type_elements.element_msg_type_isset_p%TYPE, element_pos in acs_sc_msg_type_elements.element_pos%TYPE ) return acs_sc_msg_types.msg_type_id%TYPE; end acs_sc_msg_type; / show errors create or replace package body acs_sc_msg_type as function new ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, msg_type_spec in varchar2 ) return acs_sc_msg_types.msg_type_id%TYPE is v_msg_type_id integer; v_spec_parse_level integer; begin v_msg_type_id := acs_object.new( object_type => 'acs_sc_msg_type', title => msg_type_name ); insert into acs_sc_msg_types ( msg_type_id, msg_type_name ) values ( v_msg_type_id, msg_type_name ); v_spec_parse_level := acs_sc_msg_type.parse_spec( msg_type_name, msg_type_spec); return v_msg_type_id; end new; procedure del ( msg_type_id in acs_sc_msg_types.msg_type_id%TYPE default null, msg_type_name in acs_sc_msg_types.msg_type_name%TYPE default null ) is v_msg_type_id acs_sc_msg_types.msg_type_id%TYPE; begin if msg_type_name is not NULL then v_msg_type_id := acs_sc_msg_type.get_id(msg_type_name); elsif msg_type_id is not NULL then v_msg_type_id := msg_type_id; else raise_application_error(-20000, 'no args supplied to sc_msg_type.delete'); end if; delete from acs_sc_msg_types where msg_type_id = v_msg_type_id; end del; function get_id ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE ) return acs_sc_msg_types.msg_type_id%TYPE is v_msg_type_id acs_sc_msg_types.msg_type_id%TYPE; begin select msg_type_id into v_msg_type_id from acs_sc_msg_types where msg_type_name = get_id.msg_type_name; return v_msg_type_id; end get_id; function get_name ( msg_type_id in acs_sc_msg_types.msg_type_id%TYPE ) return acs_sc_msg_types.msg_type_name%TYPE is v_msg_type_name acs_sc_msg_types.msg_type_name%TYPE; begin select msg_type_name into v_msg_type_name from acs_sc_msg_types where msg_type_id = get_name.msg_type_id; return v_msg_type_name; end get_name; -- string processing in pl/sql is so much fun -- i'm sure there is a better way to go about this function parse_spec ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, msg_type_spec in varchar2 ) return integer is v_element_pos integer; v_str_s_idx integer; -- spec str pointers v_str_e_idx integer; v_elem_idx integer; -- element str pointer v_str_len integer; v_element varchar(200); v_element_type varchar(200); v_element_name varchar(200); v_element_msg_type_name varchar(200); v_element_msg_type_isset_p char(1); v_junk_msg_type_id integer; begin -- oracle treats empty strings as nulls if msg_type_spec is null then return 0; end if; v_element_pos := 1; v_str_e_idx := 1; while TRUE loop -- string start check if v_element_pos = 1 then v_str_s_idx := 1; else v_str_s_idx := instr(msg_type_spec, ',', v_str_e_idx); if v_str_s_idx > 0 then v_str_s_idx := v_str_s_idx + 1; end if; end if; v_str_e_idx := instr(msg_type_spec, ',', v_str_s_idx+1)-1; -- end of string check if v_str_s_idx > 0 and v_str_e_idx <= 0 then v_str_e_idx := length(msg_type_spec); end if; -- dbms_output.put_line(v_str_s_idx || ' '|| v_str_e_idx || ' ' || v_element_pos); -- dbms_output.new_line(); if v_str_s_idx > 0 then v_element := substr(msg_type_spec, v_str_s_idx, v_str_e_idx+1 - v_str_s_idx); v_elem_idx := instr(v_element, ':'); if v_elem_idx > 0 then v_element_name := trim( substr(v_element, 1, v_elem_idx-1)); v_element_type := trim( substr(v_element, v_elem_idx+1)); if (instr(v_element_type, '[',1,1) = length(v_element_type)-1) and (instr(v_element_type, ']',1,1) = length(v_element_type)) then v_element_msg_type_isset_p := 't'; v_element_msg_type_name := trim(substr( v_element_type, 1, length(v_element_type)-2)); if v_element_msg_type_name = '' then raise_application_error (-20001, 'Wrong Format: Message Type Specification'); end if; else v_element_msg_type_isset_p := 'f'; v_element_msg_type_name := v_element_type; end if; v_junk_msg_type_id := acs_sc_msg_type.new_element ( msg_type_name =>parse_spec.msg_type_name, element_name => v_element_name, element_msg_type_name => v_element_msg_type_name, element_msg_type_isset_p => v_element_msg_type_isset_p, element_pos => v_element_pos ); else raise_application_error(-20001,'Wrong Format: Message Type Specification'); end if; else -- yippee we're done exit; end if; v_element_pos := v_element_pos + 1; end loop; return v_element_pos - 1; end parse_spec; function new_element ( msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, element_name in acs_sc_msg_type_elements.element_name%TYPE, element_msg_type_name in acs_sc_msg_types.msg_type_name%TYPE, element_msg_type_isset_p in acs_sc_msg_type_elements.element_msg_type_isset_p%TYPE, element_pos in acs_sc_msg_type_elements.element_pos%TYPE ) return acs_sc_msg_types.msg_type_id%TYPE is v_msg_type_id integer; v_element_msg_type_id integer; begin v_msg_type_id := acs_sc_msg_type.get_id(msg_type_name); if v_msg_type_id is null then raise_application_error (-20001, 'Unknown Message Type: ' || msg_type_name); end if; v_element_msg_type_id := acs_sc_msg_type.get_id(element_msg_type_name); if v_element_msg_type_id is null then raise_application_error (-20001, 'Unknown Message Type: ' || element_msg_type_name); end if; insert into acs_sc_msg_type_elements ( msg_type_id, element_name, element_msg_type_id, element_msg_type_isset_p, element_pos ) values ( v_msg_type_id, element_name, v_element_msg_type_id, element_msg_type_isset_p, element_pos ); return v_msg_type_id; end new_element; end acs_sc_msg_type; / show errors -- -- Primitive Message Types -- declare v_msg_type_id acs_sc_msg_types.msg_type_id%TYPE; begin v_msg_type_id := acs_sc_msg_type.new('integer',''); v_msg_type_id := acs_sc_msg_type.new('string',''); v_msg_type_id := acs_sc_msg_type.new('boolean',''); v_msg_type_id := acs_sc_msg_type.new('timestamp',''); v_msg_type_id := acs_sc_msg_type.new('uri',''); v_msg_type_id := acs_sc_msg_type.new('version',''); v_msg_type_id := acs_sc_msg_type.new('float',''); v_msg_type_id := acs_sc_msg_type.new('bytearray',''); end; / show errors
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 20 Des 2020 pada 19.50 -- Versi server: 10.4.16-MariaDB -- Versi PHP: 7.4.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `kejaksaan` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `berita` -- CREATE TABLE `berita` ( `id` int(5) UNSIGNED NOT NULL, `judul` varchar(100) NOT NULL, `ringkasan` varchar(200) NOT NULL, `isi` text NOT NULL, `tanggal` datetime NOT NULL DEFAULT current_timestamp(), `foto` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `berita` -- INSERT INTO `berita` (`id`, `judul`, `ringkasan`, `isi`, `tanggal`, `foto`) VALUES (1, 'Siapa Sangka, Seorang Sri Mulyani Tak Pernah Juara Kelas Waktu SD', '<p>Menteri Keuangan (Menkeu) <a href=\"https://www.detik.com/tag/sri-mulyani\">Sri Mulyani</a> Indrawati mengungkapkan dirinya semasa duduk di bangku sekolah dasar (SD) tidak pernah juara kelas. Berbeda', '<p>Menteri Keuangan (Menkeu) <a href=\"https://www.detik.com/tag/sri-mulyani\">Sri Mulyani</a> Indrawati mengungkapkan dirinya semasa duduk di bangku sekolah dasar (SD) tidak pernah juara kelas. Berbeda dengan adik dan kakaknya yang selalu berprestasi di sekolah.</p>\r\n<p>\"Kebetulan kakak-kakak saya sama adik saya itu pintar banget, di sekolah itu juara kelas. Saya nggak pernah juara kelas waktu SD,\" kata Sri Mulyani dalam webinar, Minggu (20/12/2020).</p>\r\n<p>Menurutnya hal itu bisa saja menjadi alasan dirinya untuk berkecil hati lantaran setiap kali menerima rapor sekolah dirinya lah satu-satunya yang tidak juara kelas. Tapi dia meyakini bahwa setiap orang diciptakan berbeda.</p>\r\n<p>Dibandingkan saudara-saudara kandungnya, dia menilai dirinya memang berbeda. <a href=\"https://www.detik.com/tag/sri-mulyani\">Sri Mulyani</a> cenderung lebih senang dengan aktivitas luar ruangan alias outdoor. Bahkan dia sudah bisa mengendarai motor di saat kakak-kakaknya belum bisa.</p>\r\n<p>\"Orangtua saya punya vespa saya pinjam terus saya belajar saja naik vespa, padahal badan saya masih kurus kecil, sama motornya itu lebih berat motornya dua kali lipat, tapi saya suka outdoor, saya suka kegiatan naik gunung, saya suka kemping waktu kecil. Kakak saya relatif mungkin nggak, lebih kutu buku barangkali kalau bisa dikatakan,\" paparnya.</p>\r\n<p>\"Itu yang membedakan, jadi nggak bisa kalau dibandingkannya adalah rapor dengan rapor karena kita beda,\" sebutnya.</p>', '2020-12-21 00:38:10', 'sri-mulyani_169.jpg'), (2, 'Beda Aturan Rapid Antigen, Pusat-Daerah Tak Kompak? ', '<p>Sejumlah pemerintah daerah memperketat perjalanan keluar masuk daerahnya untuk mencegah penyebaran virus Corona jelang libur Natal dan Tahun Baru. Salah satunya ialah dengan mewajibkan tes', '<p>Sejumlah pemerintah daerah memperketat perjalanan keluar masuk daerahnya untuk mencegah penyebaran virus Corona jelang libur Natal dan Tahun Baru. Salah satunya ialah dengan mewajibkan tes <a href=\"https://www.detik.com/tag/rapid-antigen\">rapid antigen</a> dan PCR.</p>\r\n<p>Namun begitu, pemerintah pusat dalam hal ini Kementerian Perhubungan (Kemenhub) menyatakan kriteria atau syarat perjalanan orang di masa liburan Natal dan Tahun Baru masih mengacu ketentuan lama yang mana syarat berpergian antar kota di semua moda hanya dengan menunjukkan bukti keterangan sehat melalui hasil rapid test atau PCR yang berlaku selama 14 hari.</p>\r\n<p>Kemenhub menyatakan akan mengikuti arahan dari Satuan Tugas Penanganan COVID-19 (Satgas COVID-19).</p>', '2020-12-21 00:40:30', 'infografis-harga-tertinggi-rapid-test-antigen-1_169.jpg'), (3, 'Komnas KIPI Tegaskan Keamanan Vaksin COVID-19 Adalah Prioritas', '<p>Ketua Komisi Nasional Kejadian Ikutan Pasca Imunisasi (Komnas KIPI) Prof. Dr. dr. <NAME> mengatakan dalam setiap fase pengembangan vaksin, keamanan selalu menjadi prioritas utama. Ia ', '<p><strong>Jakarta</strong> -</p>\r\n<p>Ketua Komisi Nasional Kejadian Ikutan Pasca Imunisasi (Komnas KIPI) Prof. Dr. dr. <NAME> mengatakan dalam setiap fase pengembangan vaksin, keamanan selalu menjadi prioritas utama. Ia memaparkan setiap fase uji klinis yang dilakukan, tidak akan dapat maju jika ditemukan ketidakamanan pada proses pengembangan vaksin.</p>\r\n<p>\"Keamanan vaksin sudah dinilai dari sejak vaksin itu dirancang dan sebelum diujicobakan kepada manusia. Meski demikian, vaksin merupakan produk biologi sehingga tingkat keamanannya tidak mungkin mencapai 100%,\" papar Hindra dalam keterangan tertulis, Minggu (20/12/2020).</p>\r\n<p>Ia menuturkan bisa saja ada ikutan pasca pemberian vaksin seperti keluhan nyeri, perdarahan, atau terjadi pembengkakan. Tapi itu semua merupakan reaksi alamiah dari suatu vaksin.</p>\r\n<div>&nbsp;</div>\r\n<div>\r\n<div>\r\n<div>\r\n<div>\r\n<div id=\"div-gpt-ad-1572510743529-0\"></div>\r\n</div>\r\n</div>\r\n</div>\r\n</div>\r\n<p>\"Jika memang terkandung bahan yang berbahaya dalam vaksin, hal tersebut pasti sudah diketahui sejak pengembangan vaksin di fase awal. Selain itu, semua hal terkait vaksin sudah diinformasikan secara transparan dan tidak mungkin disembunyikan,\" papar Hindra.</p>\r\n<p>Untuk itu, Hindra berharap masyarakat mencari dan mendapatkan informasi tentang vaksin melalui informasi resmi. Sehingga tidak terjadi simpang siur terkait keamanan vaksin.</p>', '2020-12-21 00:41:59', 'irawan.jpg'); -- -------------------------------------------------------- -- -- Struktur dari tabel `home` -- CREATE TABLE `home` ( `id` int(10) UNSIGNED NOT NULL, `menu` varchar(100) DEFAULT NULL, `konten` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `home` -- INSERT INTO `home` (`id`, `menu`, `konten`) VALUES (1, 'VISI', '<p><span style=\"color: #e03e2d;\"><strong><span style=\"text-decoration: underline;\">Visi&nbsp;Kejaksaan R.I :</span></strong></span></p>\n<p><strong>\"Menjadi Lembaga Penegak Hukum yang Professional, Proporsional dan Akuntabel\"</strong></p>\n<p>Dengan Penjelasan :</p>\n<ol>\n<li>Lembaga Penegak Hukum: Kejaksaan RI sebagai salah satu lembaga penegak hukum di Indonesia yang mempunyai tugas dan fungsi sebagai penyidik pada tindak pidana tertentu, penuntut umum, pelaksana penetapan hakim, pelaksana putusan pengadilan yang telah memperoleh kekuatan hukum tetap, melakukan pengawasan terhadap pelaksanaan putusan pidana bersyarat, pidana pengawasan dan lepas bersyarat, bertindak sebagai Pengacara Negara serta turut membina ketertiban dan ketentraman umum melalui upaya antara lain : meningkatkan kesadaran hukum masyarakat, Pengamanan kebijakan penegakan hukum dan Pengawasan Aliran Kepercayaan dan penyalahgunaan penodaan agama</li>\n<li>Profesional: Segenap aparatur Kejaksaan RI dalam melaksanakan tugas didasrkan atas nilai luhur TRI KRAMA ADHYAKSA serta kompetensi dan kapabilitas yang ditunjang dengan pengetahuan dan wawasan yang luas serta pengalaman kerja yang memadai dan berpegang teguh pada aturan serta kode etik profesi yang berlaku</li>\n<li>Proporsional: Dalam melaksanakan tugas dan fungsinya Kejaksaan selalu memakai semboyan yakni menyeimbangkan yang tersurat dan tersirat dengan penuh tanggungjawab, taat azas, efektif dan efisien serta penghargaan terhadap hak-hak publik</li>\n<li>Akuntabel: Bahwa kinerja Kejaksaan Republik Indonesia dapat dipertanggungjawabkan sesuai dengan ketentuan yang berlaku</li>\n</ol>\n<p>&nbsp;</p>\n<p>Misi Kejaksaan R.I :</p>\n<p>1.&nbsp;Meningkatkan Peran Kejaksaan Republik Indonesia Dalam Program Pencegahan Tindak Pidana</p>\n<p>2. Meningkatkan Professionalisme Jaksa Dalam Penanganan Perkara Tindak Pidana</p>\n<p>3. Meningkatkan Peran Jaksa Pengacara Negara Dalam Penyelesaian Masalah Perdata dan Tata Usaha Negara&nbsp;</p>\n<p>4. Mewujudkan Upaya Penegakan Hukum Memenuhi Rasa Keadilan Masyarakat</p>\n<p>5. Mempercepat Pelaksanaan Reformasi Birokrasi dan Tata Kelola Kejaksaan Republik Indonesia yang Bersih dan Bebas Korupsi, Kolusi dan Nepotisme</p>\n<div>&nbsp;</div>\n<p>(Sumber: Peraturan Jaksa Agung Nomor: 007/A/JA/08/2016 tentang Perubahan Atas Peraturan Jaksa Agung Republik Indonesia Nomor PER-010/A/JA/06/2015 Tentang Rencana Strategis Kejaksaan Republik Indonesia Tahun 2015-2019 tanggal 4 Agustus 2016)</p>'), (2, 'TUGAS', '<p><strong>TUGAS DAN WEWENANG</strong></p>\n<p>Pimpinan yang memegang adalah&nbsp;</p>'), (3, 'STRUKTUR', NULL), (4, 'PROFIL', NULL), (5, 'SEJARAH', NULL), (6, 'PEMBINAAN', NULL), (7, 'INTELIJEN', NULL), (8, 'TP4D', NULL), (9, '<NAME>', '<p>DATA</p>'), (10, '<NAME>', NULL), (11, 'DATUN', NULL), (12, 'PENGAWASAN', NULL), (13, 'TATA USAHA', NULL); -- -------------------------------------------------------- -- -- Struktur dari tabel `organisasi` -- CREATE TABLE `organisasi` ( `id` int(10) UNSIGNED NOT NULL, `menu` varchar(100) DEFAULT NULL, `konten` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `organisasi` -- INSERT INTO `organisasi` (`id`, `menu`, `konten`) VALUES (1, 'PEMBINAAN', NULL), (2, 'INTELIJEN', NULL), (3, 'TP4D', NULL), (4, '<NAME>', NULL), (5, '<NAME>', NULL), (6, 'DATUN', NULL), (7, 'PENGAWASAN', NULL), (8, '<NAME>', NULL); -- -------------------------------------------------------- -- -- Struktur dari tabel `pengaduan` -- CREATE TABLE `pengaduan` ( `id` int(5) UNSIGNED NOT NULL, `nopengaduan` varchar(100) NOT NULL, `uname` varchar(100) NOT NULL, `namapelapor` varchar(100) NOT NULL, `alamatpelapor` varchar(200) DEFAULT NULL, `emailpelapor` varchar(100) DEFAULT NULL, `telponpelapor` varchar(100) DEFAULT NULL, `namaterlapor` varchar(100) DEFAULT NULL, `jabatanterlapor` varchar(100) DEFAULT NULL, `satuanterlapor` varchar(100) DEFAULT NULL, `subjekaduan` varchar(100) DEFAULT NULL, `tujuan` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `pengaduan` -- INSERT INTO `pengaduan` (`id`, `nopengaduan`, `uname`, `namapelapor`, `alamatpelapor`, `emailpelapor`, `telponpelapor`, `namaterlapor`, `jabatanterlapor`, `satuanterlapor`, `subjekaduan`, `tujuan`) VALUES (1, 'ADUAN-G52FSQ3PYX', 'user', 'Roby', 'Kalteng', '<EMAIL>', '085643221232', 'Tasya', 'Mentri', 'Pendidikan', 'Pencurian Hati', 'barangbukti'); -- -------------------------------------------------------- -- -- Struktur dari tabel `perkara` -- CREATE TABLE `perkara` ( `id` int(10) UNSIGNED NOT NULL, `menu` varchar(100) DEFAULT NULL, `konten` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `perkara` -- INSERT INTO `perkara` (`id`, `menu`, `konten`) VALUES (1, 'PIDANA UMUM', NULL), (2, 'PIDANA KHUSUS', NULL); -- -------------------------------------------------------- -- -- Struktur dari tabel `pesan` -- CREATE TABLE `pesan` ( `id` int(5) UNSIGNED NOT NULL, `pengirim` varchar(100) NOT NULL, `pesan` text NOT NULL, `remark` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `pesan` -- INSERT INTO `pesan` (`id`, `pengirim`, `pesan`, `remark`) VALUES (1, 'user', 'bisa ajaaa', 'bisa ajaaa'), (2, 'user', 'yahooooooooo', 'pidanakhusus'), (3, 'user', 'yahooooooooo', 'pidanakhusus'), (4, 'user', 'sssss', 'pidanaumum'), (5, 'pidanaumum', 'daftar barang bukti', 'barangbukti'); -- -------------------------------------------------------- -- -- Struktur dari tabel `users` -- CREATE TABLE `users` ( `id` int(5) UNSIGNED NOT NULL, `usernm` varchar(20) NOT NULL, `passwd` varchar(200) NOT NULL, `leveluser` enum('admin','pembinaan','intelijen','pidanaumum','pidanakhusus','barangbukti','barangrampasan','user') NOT NULL, `nama` varchar(100) NOT NULL, `alamat` varchar(200) NOT NULL, `email` varchar(50) DEFAULT NULL, `telpon` varchar(20) DEFAULT NULL, `pekerjaan` varchar(100) DEFAULT NULL, `pendidikan` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `users` -- INSERT INTO `users` (`id`, `usernm`, `passwd`, `leveluser`, `nama`, `alamat`, `email`, `telpon`, `pekerjaan`, `pendidikan`) VALUES (1, 'admin', '*4ACFE3202A5FF5CF467898FC58AAB1D615029441', 'admin', '', '', NULL, NULL, NULL, NULL), (2, 'user', '*D5D9F81F5542DE067FFF5FF7A4CA4BDD322C578F', 'user', '', '', NULL, NULL, NULL, NULL), (3, 'pembinaan', '*448F8D72D0010A5D78BA1C9CFBED30852A15B6EC', 'pembinaan', '', '', NULL, NULL, NULL, NULL), (4, 'pidanaumum', '*90B4868A1D75BAE0636D8E118EB074B5647C1A8A', 'pidanaumum', '', '', NULL, NULL, NULL, NULL), (5, 'pidanakhusus', '*1B41CFE940AF145EB0868EAC91BD55869BA14B05', 'pidanakhusus', '', '', NULL, NULL, NULL, NULL), (7, '90', '*B51B3B35B15DBEC35106A773BF9396595F620A17', 'user', '90', '90', '90', '90', '90', '90'), (8, 'barangbukti', '*4C318E5311A702FD1B8142264FFFD33886A35E84', 'barangbukti', '', '', NULL, NULL, NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indeks untuk tabel `berita` -- ALTER TABLE `berita` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `home` -- ALTER TABLE `home` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `organisasi` -- ALTER TABLE `organisasi` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `pengaduan` -- ALTER TABLE `pengaduan` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `perkara` -- ALTER TABLE `perkara` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `pesan` -- ALTER TABLE `pesan` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT untuk tabel yang dibuang -- -- -- AUTO_INCREMENT untuk tabel `berita` -- ALTER TABLE `berita` MODIFY `id` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT untuk tabel `home` -- ALTER TABLE `home` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT untuk tabel `organisasi` -- ALTER TABLE `organisasi` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT untuk tabel `pengaduan` -- ALTER TABLE `pengaduan` MODIFY `id` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT untuk tabel `perkara` -- ALTER TABLE `perkara` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT untuk tabel `pesan` -- ALTER TABLE `pesan` MODIFY `id` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT untuk tabel `users` -- ALTER TABLE `users` MODIFY `id` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; 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 configurationkpi ( id CHAVE NOT NULL, id_shop_group CHAVE, id_shop CHAVE, name CHARACTER VARYING(64) NOT NULL, value TEXT, date_add TIMESTAMP WITH TIME ZONE NOT NULL, date_upd TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT pk_configurationkpi PRIMARY KEY (id) );
<reponame>rrickgauer/api.tasks DELIMITER $$ CREATE FUNCTION `get_start_date_monthly`( starts_on DATE, occurrence_day INT ) RETURNS DATE DETERMINISTIC BEGIN DECLARE firstInterval INT; DECLARE startDate DATE; SET firstInterval = occurrence_day - EXTRACT(DAY FROM starts_on); SET startDate = DATE_ADD(starts_on, INTERVAL firstInterval DAY); RETURN (startDate); END$$ DELIMITER ;
-- MySQL dump 10.13 Distrib 5.1.54, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: opf_ref -- ------------------------------------------------------ -- Server version 5.1.54-1ubuntu4 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `files` -- DROP TABLE IF EXISTS `files`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `files` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `relative_full_path` blob, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `raw_results` -- DROP TABLE IF EXISTS `raw_results`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `raw_results` ( `id` int(11) NOT NULL AUTO_INCREMENT, `raw_result` blob, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=26956 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `results` -- DROP TABLE IF EXISTS `results`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `results` ( `id` varchar(255) NOT NULL, `datestamp` int(11) NOT NULL, `tool_id` int(11) DEFAULT NULL, `file_id` int(11) DEFAULT NULL, `raw_result_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`,`raw_result_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `tools` -- DROP TABLE IF EXISTS `tools`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tools` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, `relative_path` varchar(255) DEFAULT NULL, `date` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `triples` -- DROP TABLE IF EXISTS `triples`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `triples` ( `subject` varchar(255) DEFAULT NULL, `predicate` varchar(255) DEFAULT NULL, `object` varchar(255) DEFAULT NULL, `model` varchar(255) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2011-09-01 10:25:32
USE [master] GO /****** Object: Database [TP-20201C] Script Date: 4/12/2020 9:23:33 PM ******/ --DECLARE @dbname nvarchar(128) --SET @dbname = N'TP-20201C' --IF (EXISTS (SELECT name --FROM master.dbo.sysdatabases --WHERE ('[' + name + ']' = @dbname --OR name = @dbname))) --DROP database [TP-20201C] GO CREATE DATABASE [TP-20201C] GO ALTER DATABASE [TP-20201C] SET COMPATIBILITY_LEVEL = 120 GO IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) begin EXEC [TP-20201C].[dbo].[sp_fulltext_database] @action = 'enable' end GO ALTER DATABASE [TP-20201C] SET ANSI_NULL_DEFAULT OFF GO ALTER DATABASE [TP-20201C] SET ANSI_NULLS OFF GO ALTER DATABASE [TP-20201C] SET ANSI_PADDING OFF GO ALTER DATABASE [TP-20201C] SET ANSI_WARNINGS OFF GO ALTER DATABASE [TP-20201C] SET ARITHABORT OFF GO ALTER DATABASE [TP-20201C] SET AUTO_CLOSE OFF GO ALTER DATABASE [TP-20201C] SET AUTO_SHRINK OFF GO ALTER DATABASE [TP-20201C] SET AUTO_UPDATE_STATISTICS ON GO ALTER DATABASE [TP-20201C] SET CURSOR_CLOSE_ON_COMMIT OFF GO ALTER DATABASE [TP-20201C] SET CURSOR_DEFAULT GLOBAL GO ALTER DATABASE [TP-20201C] SET CONCAT_NULL_YIELDS_NULL OFF GO ALTER DATABASE [TP-20201C] SET NUMERIC_ROUNDABORT OFF GO ALTER DATABASE [TP-20201C] SET QUOTED_IDENTIFIER OFF GO ALTER DATABASE [TP-20201C] SET RECURSIVE_TRIGGERS OFF GO ALTER DATABASE [TP-20201C] SET DISABLE_BROKER GO ALTER DATABASE [TP-20201C] SET AUTO_UPDATE_STATISTICS_ASYNC OFF GO ALTER DATABASE [TP-20201C] SET DATE_CORRELATION_OPTIMIZATION OFF GO ALTER DATABASE [TP-20201C] SET TRUSTWORTHY OFF GO ALTER DATABASE [TP-20201C] SET ALLOW_SNAPSHOT_ISOLATION OFF GO ALTER DATABASE [TP-20201C] SET PARAMETERIZATION SIMPLE GO ALTER DATABASE [TP-20201C] SET READ_COMMITTED_SNAPSHOT OFF GO ALTER DATABASE [TP-20201C] SET HONOR_BROKER_PRIORITY OFF GO ALTER DATABASE [TP-20201C] SET RECOVERY SIMPLE GO ALTER DATABASE [TP-20201C] SET MULTI_USER GO ALTER DATABASE [TP-20201C] SET PAGE_VERIFY CHECKSUM GO ALTER DATABASE [TP-20201C] SET DB_CHAINING OFF GO ALTER DATABASE [TP-20201C] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) GO ALTER DATABASE [TP-20201C] SET TARGET_RECOVERY_TIME = 0 SECONDS GO ALTER DATABASE [TP-20201C] SET DELAYED_DURABILITY = DISABLED GO USE [TP-20201C] GO /****** Object: Table [dbo].[Denuncias] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Denuncias]( [IdDenuncia] [int] IDENTITY(1,1) NOT NULL, [IdNecesidad] [int] NOT NULL, [IdMotivo] [int] NOT NULL, [Comentarios] [nvarchar](300) NOT NULL, [IdUsuario] [int] NOT NULL, [FechaCreacion] [datetime] NOT NULL, [Estado] [int] NOT NULL, CONSTRAINT [PK_Denuncias] PRIMARY KEY CLUSTERED ( [IdDenuncia] 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 /****** Object: Table [dbo].[DonacionesInsumos] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[DonacionesInsumos]( [IdDonacionInsumo] [int] IDENTITY(1,1) NOT NULL, [IdNecesidadDonacionInsumo] [int] NOT NULL, [IdUsuario] [int] NOT NULL, [Cantidad] [int] NOT NULL, [FechaCreacion] [datetime] NOT NULL, CONSTRAINT [PK_DonacionesInsumos] PRIMARY KEY CLUSTERED ( [IdDonacionInsumo] 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 /****** Object: Table [dbo].[DonacionesMonetarias] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[DonacionesMonetarias]( [IdDonacionMonetaria] [int] IDENTITY(1,1) NOT NULL, [IdNecesidadDonacionMonetaria] [int] NOT NULL, [IdUsuario] [int] NOT NULL, [Dinero] [decimal](18, 2) NOT NULL, [ArchivoTransferencia] [nvarchar](200) NOT NULL, [FechaCreacion] [datetime] NOT NULL, CONSTRAINT [PK_DonacionesMonetarias] PRIMARY KEY CLUSTERED ( [IdDonacionMonetaria] 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 /****** Object: Table [dbo].[Necesidades] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Necesidades]( [IdNecesidad] [int] IDENTITY(1,1) NOT NULL, [Nombre] [nvarchar](50) NOT NULL, [Descripcion] [text] NOT NULL, [FechaCreacion] [datetime] NOT NULL, [FechaFin] [datetime] NOT NULL, [TelefonoContacto] [nvarchar](30) NOT NULL, [TipoDonacion] [int] NOT NULL, [Foto] [nvarchar](100) NOT NULL, [IdUsuarioCreador] [int] NOT NULL, [Estado] [int] NOT NULL, [Valoracion] [decimal](18, 0) NULL, CONSTRAINT [PK_Necesidades] PRIMARY KEY CLUSTERED ( [IdNecesidad] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[NecesidadesDonacionesInsumos] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[NecesidadesDonacionesInsumos]( [IdNecesidadDonacionInsumo] [int] IDENTITY(1,1) NOT NULL, [IdNecesidad] [int] NOT NULL, [Nombre] [nvarchar](50) NOT NULL, [Cantidad] [int] NOT NULL, CONSTRAINT [PK_NecesidadesDonacionesInsumos] PRIMARY KEY CLUSTERED ( [IdNecesidadDonacionInsumo] 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 /****** Object: Table [dbo].[NecesidadesDonacionesMonetarias] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[NecesidadesDonacionesMonetarias]( [IdNecesidadDonacionMonetaria] [int] IDENTITY(1,1) NOT NULL, [IdNecesidad] [int] NOT NULL, [Dinero] [decimal](18, 2) NOT NULL, [CBU] [nvarchar](80) NOT NULL, CONSTRAINT [PK_NecesidadesDonacionesMonetarias] PRIMARY KEY CLUSTERED ( [IdNecesidadDonacionMonetaria] 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 /****** Object: Table [dbo].[NecesidadesReferencias] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[NecesidadesReferencias]( [IdReferencia] [int] IDENTITY(1,1) NOT NULL, [IdNecesidad] [int] NOT NULL, [Nombre] [nvarchar](50) NOT NULL, [Telefono] [nvarchar](50) NOT NULL, CONSTRAINT [PK_NecesidadesReferencias] PRIMARY KEY CLUSTERED ( [IdReferencia] 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 /****** Object: Table [dbo].[NecesidadesValoraciones] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[NecesidadesValoraciones]( [IdValoracion] [int] IDENTITY(1,1) NOT NULL, [IdUsuario] [int] NOT NULL, [IdNecesidad] [int] NOT NULL, [Valoracion] [bit] NOT NULL, CONSTRAINT [PK_NecesidadesValoraciones] PRIMARY KEY CLUSTERED ( [IdValoracion] 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 /****** Object: Table [dbo].[Usuarios] Script Date: 4/12/2020 9:23:33 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Usuarios]( [IdUsuario] [int] IDENTITY(1,1) NOT NULL, [Nombre] [nvarchar](50) NULL, [Apellido] [nvarchar](50) NULL, [FechaNacimiento] [datetime] NOT NULL, [UserName] [nvarchar](20) NULL, [Email] [nvarchar](50) NOT NULL, [Password] [nvarchar](50) NOT NULL, [Foto] [nvarchar](100) NULL, [TipoUsuario] [int] NOT NULL, [FechaCreacion] [datetime] NOT NULL, [Activo] [bit] NOT NULL, [Token] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Usuarios] PRIMARY KEY CLUSTERED ( [IdUsuario] 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 CREATE TABLE [dbo].MotivoDenuncia( IdMotivoDenuncia int not null, Descripcion varchar(30) not null, CONSTRAINT PK_MotivoDenuncia PRIMARY KEY(IdMotivoDenuncia) ) GO ALTER TABLE [dbo].[Necesidades] ADD DEFAULT ((0)) FOR [Valoracion] GO ALTER TABLE [dbo].[Denuncias] WITH CHECK ADD CONSTRAINT [FK_Denuncias_Necesidades] FOREIGN KEY([IdNecesidad]) REFERENCES [dbo].[Necesidades] ([IdNecesidad]) GO ALTER TABLE [dbo].[Denuncias] CHECK CONSTRAINT [FK_Denuncias_Necesidades] GO ALTER TABLE [dbo].[Denuncias] WITH CHECK ADD CONSTRAINT [FK_Denuncias_Usuarios] FOREIGN KEY([IdUsuario]) REFERENCES [dbo].[Usuarios] ([IdUsuario]) GO ALTER TABLE [dbo].[Denuncias] CHECK CONSTRAINT [FK_Denuncias_Usuarios] GO ALTER TABLE [dbo].[DonacionesInsumos] WITH CHECK ADD CONSTRAINT [FK_DonacionesInsumos_NecesidadesDonacionesInsumos] FOREIGN KEY([IdNecesidadDonacionInsumo]) REFERENCES [dbo].[NecesidadesDonacionesInsumos] ([IdNecesidadDonacionInsumo]) GO ALTER TABLE [dbo].[DonacionesInsumos] CHECK CONSTRAINT [FK_DonacionesInsumos_NecesidadesDonacionesInsumos] GO ALTER TABLE [dbo].[DonacionesInsumos] WITH CHECK ADD CONSTRAINT [FK_DonacionesInsumos_Usuarios] FOREIGN KEY([IdUsuario]) REFERENCES [dbo].[Usuarios] ([IdUsuario]) GO ALTER TABLE [dbo].[DonacionesInsumos] CHECK CONSTRAINT [FK_DonacionesInsumos_Usuarios] GO ALTER TABLE [dbo].[DonacionesMonetarias] WITH CHECK ADD CONSTRAINT [FK_DonacionesMonetarias_NecesidadesDonacionesMonetarias] FOREIGN KEY([IdNecesidadDonacionMonetaria]) REFERENCES [dbo].[NecesidadesDonacionesMonetarias] ([IdNecesidadDonacionMonetaria]) GO ALTER TABLE [dbo].[DonacionesMonetarias] CHECK CONSTRAINT [FK_DonacionesMonetarias_NecesidadesDonacionesMonetarias] GO ALTER TABLE [dbo].[DonacionesMonetarias] WITH CHECK ADD CONSTRAINT [FK_DonacionesMonetarias_Usuarios] FOREIGN KEY([IdUsuario]) REFERENCES [dbo].[Usuarios] ([IdUsuario]) GO ALTER TABLE [dbo].[DonacionesMonetarias] CHECK CONSTRAINT [FK_DonacionesMonetarias_Usuarios] GO ALTER TABLE [dbo].[Necesidades] WITH CHECK ADD CONSTRAINT [FK_Necesidades_Usuarios] FOREIGN KEY([IdUsuarioCreador]) REFERENCES [dbo].[Usuarios] ([IdUsuario]) GO ALTER TABLE [dbo].[Necesidades] CHECK CONSTRAINT [FK_Necesidades_Usuarios] GO ALTER TABLE [dbo].[NecesidadesDonacionesInsumos] WITH CHECK ADD CONSTRAINT [FK_NecesidadesDonacionesInsumos_Necesidades] FOREIGN KEY([IdNecesidad]) REFERENCES [dbo].[Necesidades] ([IdNecesidad]) GO ALTER TABLE [dbo].[NecesidadesDonacionesInsumos] CHECK CONSTRAINT [FK_NecesidadesDonacionesInsumos_Necesidades] GO ALTER TABLE [dbo].[NecesidadesDonacionesMonetarias] WITH CHECK ADD CONSTRAINT [FK_NecesidadesDonacionesMonetarias_Necesidades] FOREIGN KEY([IdNecesidad]) REFERENCES [dbo].[Necesidades] ([IdNecesidad]) GO ALTER TABLE [dbo].[NecesidadesDonacionesMonetarias] CHECK CONSTRAINT [FK_NecesidadesDonacionesMonetarias_Necesidades] GO ALTER TABLE [dbo].[NecesidadesReferencias] WITH CHECK ADD CONSTRAINT [FK_NecesidadesReferencias_Necesidades] FOREIGN KEY([IdNecesidad]) REFERENCES [dbo].[Necesidades] ([IdNecesidad]) GO ALTER TABLE [dbo].[NecesidadesReferencias] CHECK CONSTRAINT [FK_NecesidadesReferencias_Necesidades] GO ALTER TABLE [dbo].[NecesidadesValoraciones] WITH CHECK ADD CONSTRAINT [FK_NecesidadesValoraciones_Necesidades] FOREIGN KEY([IdNecesidad]) REFERENCES [dbo].[Necesidades] ([IdNecesidad]) GO ALTER TABLE [dbo].[NecesidadesValoraciones] CHECK CONSTRAINT [FK_NecesidadesValoraciones_Necesidades] GO ALTER TABLE [dbo].[NecesidadesValoraciones] WITH CHECK ADD CONSTRAINT [FK_NecesidadesValoraciones_Usuarios] FOREIGN KEY([IdUsuario]) REFERENCES [dbo].[Usuarios] ([IdUsuario]) GO ALTER TABLE [dbo].[NecesidadesValoraciones] CHECK CONSTRAINT [FK_NecesidadesValoraciones_Usuarios] GO USE [master] GO ALTER DATABASE [TP-20201C] SET READ_WRITE GO USE [TP-20201C] GO ALTER TABLE Denuncias ADD CONSTRAINT FK_Denuncia_MotivoDenuncia FOREIGN KEY (IdMotivo) references MotivoDenuncia (IdMotivoDenuncia) GO
SELECT fn_db_add_column('host_device', 'driver', 'VARCHAR(255)');
<reponame>MCZbase/DDL CREATE OR REPLACE FUNCTION "CONCATNAME" (p_key_val in varchar2 ) -- unused? No references in DDL or coldfusion -- given a publication id, obtain a list of last names of authors, in order and year of publication. -- @param p_key_val a publication id for which to lookup author names and year. -- @return a string containing a list of author last names, truncated to the first two with et al. -- followed by the year of publication. return varchar2 as type rc is ref cursor; l_str varchar2(4000); l_sep varchar2(30); t_sep varchar2(30); l_val varchar2(4000); title varchar2(4000); loopcount number; name_cur rc; title_cur rc; year_cur rc; year_val varchar2(30); begin open name_cur for 'select last_name FROM agent_name, person, publication_author_name WHERE agent_name.agent_name_id = publication_author_name.agent_name_id AND agent_name.agent_id = person.person_id AND publication_id=:x ORDER BY author_position' using p_key_val ; loopcount := 1; loop fetch name_cur into l_val; exit when name_cur%notfound; case true when loopcount = 1 then l_str := l_str || l_sep || l_val; l_sep := ''; when loopcount = 2 then l_sep := ' '; l_str := l_str || l_sep || 'et al.'; when loopcount > 2 then l_str := l_str; end case; /* if name_cur%rowcount > 2 then l_sep := ', '; else l_sep := ':: '; end if; */ loopcount := loopcount + 1; end loop; open year_cur for 'select published_year from publication where publication_id=:x' using p_key_val ; fetch year_cur into year_val; l_sep := ' '; l_str := l_str || l_sep || year_val; close year_cur; /* open title_cur for 'select publication_title from publication where publication_id = :x' USING p_key_val; fetch name_cur into title; l_str := l_str || t_sep || title; t_sep := '. '; close title_cur; */ close name_cur; return l_str; end;
SELECT 1101 AS layer_code, 'boundary' AS layer_class, 'admin_level1' AS layer_name, feature_type AS gdal_type, osm_id, osm_way_id, osm_timestamp, all_tags, geometry FROM `openstreetmap-public-data-prod.osm_planet.features` WHERE EXISTS(SELECT 1 FROM UNNEST(all_tags) AS tags WHERE tags.key = 'boundary' AND tags.value='administrative') AND EXISTS(SELECT 1 FROM UNNEST(all_tags) as tags WHERE tags.key = 'admin_level' AND tags.value='1')
<filename>DB_Basics_MS_SQL_Server/Exam Preparation/Washing Machine Service/10. Hard Earners.sql<gh_stars>0 SELECT TOP (3) m.FirstName + ' ' + m.LastName AS Mechanic, COUNT(*) AS Jobs FROM Mechanics AS m JOIN Jobs AS j ON J.MechanicId = M.MechanicId WHERE j.Status <> 'Finished' GROUP BY m.MechanicId, m.FirstName + ' ' + m.LastName HAVING COUNT(*) > 1 ORDER BY Jobs DESC, m.MechanicId
### Schema DROP DATABASE IF EXISTS dogs_db; CREATE DATABASE dogs_db; USE dogs_db; CREATE TABLE dogs ( id int NOT NULL AUTO_INCREMENT, dog_name varchar(255) NOT NULL, petted BOOLEAN DEFAULT false, PRIMARY KEY (id) );
insert into Contact (email, instagram, facebook, phone) values ('<EMAIL>','@pedruxo_fah','@pedruxo_fah','77-9999-8888'), ('<EMAIL>','@ravenna','@ravenna','77 8888-7777'), ('<EMAIL>','@cairinho0','@cairinho0','77 3443-4334'), ('<EMAIL>','@cris_ag','@cris_ag','77 8888-2233'), ('<EMAIL>','@elmes_carpo','@elmes_carpo','77 9090-8989'), ('<EMAIL>','@almagema','@almagema','77 8888-7675'), ('<EMAIL>','@landinho','@landinho','77 8766-3443'), ('<EMAIL>','@henri_oz','@henri_oz','77 6887-4509'), ('<EMAIL>','@vaarpd','@vaarpd','77 8989-3421'); insert into User (name, password,lastname, cpf, birthday, description, avatar, contact_id) values ('Pedro','123','Farias','234.567.987-23','1997-2-28','Pintor ','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/pedro.png?raw=true',1), ('Vena','321','Tesla', '123.234.345-56','2000-12-12','Ilustradora','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/vena.png?raw=true',2); insert into Client (nickname,name, user_id,lastname, cpf, birthday, description, avatar, contact_id) values ('Pedro','Pedro',2,'Farias','234.567.987-23','1997-2-28','Pintor','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/pedro.png?raw=true',1), ('Vena','Vena',1,'Tesla', '123.234.345-56','2000-12-12','Ilustradora','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/vena.png?raw=true',2), ('Miro','Miro',2,'Cairo','098.987.876-54','2001-10-10','Escultor','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/miro.png?raw=true',3), ('Cristina','Cristina',1,'Aguilera','111.222.333-44','1994-7-23','Cantora','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/cristina.png?raw=true',4), ('Elmes','Elmes',2,'Carpo','345.543.444-55','2001-1-01','Cantor','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/elmes.png?raw=true',5), ('Alma','Alma',1,'Gema','111.444.555.-22','2000-3-22','Escritora','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/alma.png?raw=true',6), ('Lando','Lando',2,'Nesto','512.521.333-22','2000-12-13','Pintor','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/lando.png?raw=true',7), ('Henriqueta','Henriqueta',1,'Ozorio','102.203.304-34','1999-9-14','Dançarina','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/henriqueta.png?raw=true',8), ('Varlei','Varlei',2,'Prado','665.445.555-44','1995-5-23','Escultor','https://github.com/filipecancio/lambe-neo4j/blob/main/assets/images/varlei.png?raw=true',9); insert into Product (title,subtitle, description,value) values ('Quadro','Mona Lisa','Um Belo Quadro',44.50), ('Quadro','Maria','Um Belo Quadro',47.90), ('Pintura','Cavernosa','Uma Bela Pintura',50.90), ('Pintura','Rochosa','Uma Bela Pintura',39.90), ('Pintura','Antiga','Uma Bela Pintura',20.90), ('Ilustração','Vetorial','Uma Bela Ilustrção',42.20), ('Ilustração','Naval','Uma Bela Ilustrção',42.80), ('Ilustração','Glacial','Uma Bela Ilustrção',20.25), ('Ilustração','Aerea','Uma Bela Ilustrção',66.80), ('Ilustração','Galática','Uma Bela Ilustrção',60.20); insert into Job (user_id, client_id, product_id, title, subtitle, sheduling, delivery, description) values (1,2,1, 'Comission', 'de Pintura', '2020-12-10', '2020-12-25', 'Nova comission de Pintura' ), (1,2,2, 'Comission', 'de Pintura', '2020-12-11', '2020-12-27', 'Nova comission de Pintura' ), (1,4,3, 'Comission', 'de Pintura', '2020-12-06', '2020-12-25', 'Nova comission de Pintura' ), (1,4,4, 'Comission', 'de Pintura', '2020-12-02', '2020-12-22', 'Nova comission de Pintura' ), (1,8,5, 'Comission', 'de Pintura', '2020-12-13', '2020-12-20', 'Nova comission de Pintura' ), (2,1,6, 'Comission', 'de Arte Digital', '2020-12-10', '2020-12-25', 'Nova comission de Arte' ), (2,1,7, 'Comission', 'de Arte Digital', '2020-12-11', '2020-12-27', 'Nova comission de Arte' ), (2,3,8, 'Comission', 'de Arte Digital', '2020-12-06', '2020-12-25', 'Nova comission de Arte' ), (2,5,9, 'Comission', 'de Arte Digital', '2020-12-02', '2020-12-22', 'Nova comission de Arte' ), (2,7,10,'Comission', 'de Arte Digital', '2020-12-13', '2020-12-20', 'Nova comission de Arte' );
<gh_stars>0 /* admin / pass */ insert into Users(firstname,login,email,userRole,pass) VALUES("Administrator","admin","<EMAIL>","admin","<KEY>"); insert into Users(firstname,login,email,userRole,pass) VALUES("User","user","<EMAIL>","user","<KEY>"); insert into Events(targetDate,description) VALUES(STR_TO_DATE('2019-04-11', '%Y-%m-%d'),"Event 1"); insert into Events(targetDate,description) VALUES(STR_TO_DATE('09/06/2010', '%m/%d/%Y'),"Event 2"); insert into Events(targetDate,description) VALUES(STR_TO_DATE('09/05/2010', '%m/%d/%Y'),"Event 3"); insert into Events(targetDate,description) VALUES(STR_TO_DATE('08/05/2010', '%m/%d/%Y'),"Event 4"); insert into Events(targetDate,description) VALUES(STR_TO_DATE('08/05/2012', '%m/%d/%Y'),"Event 5"); insert into Events(targetDate,description) VALUES(STR_TO_DATE('08/03/1999', '%m/%d/%Y'),"Event 6"); insert into ActivityCategories(name,description) VALUES ("ActivityCategory 1","Description Dptm 1"); insert into ActivityCategories(name,description) VALUES ("ActivityCategory 2","Description Dptm 2"); insert into Activities (categoryId,name,description) VALUES (1,"Activity 1","Description"); insert into Activities (categoryId,name,description) VALUES (1,"Activity 2","Description"); insert into Activities (categoryId,name,description) VALUES (1,"Activity 3","Description"); insert into Activities (categoryId,name,description) VALUES (2,"Activity 1","Description"); insert into Activities (categoryId,name,description) VALUES (2,"Activity 2","Description"); insert into Activities (categoryId,name,description) VALUES (2,"Activity 3","Description"); insert into Resources (name,description) VALUES ("Peter","Description"); insert into Resources (name,description) VALUES ("Anna","Description"); insert into Resources (name,description) VALUES ("Hanna","Description"); insert into Resources (name,description) VALUES ("Songar","Description"); insert into ResourceAssignment (resourceId,eventId,activityId) VALUES (1,1,1); insert into ResourceAssignment (resourceId,eventId,activityId) VALUES (1,2,2);
<reponame>Flibo/discord-bot<gh_stars>0 -- Verify discordbot:botschema on pg BEGIN; SELECT 1/COUNT(*) FROM information_schema.schemata WHERE schema_name = 'bot'; ROLLBACK;
<reponame>diogocapela/isep-bddad --eliminar tabelas (eventualmente) existentes DROP TABLE cd CASCADE CONSTRAINTS PURGE ; DROP TABLE musicas CASCADE CONSTRAINTS PURGE ; DROP TABLE editoras CASCADE CONSTRAINTS PURGE ; --criar tabelas CREATE TABLE editoras ( id_editora INTEGER CONSTRAINT pk_editoras_id_iditora PRIMARY KEY, nome VARCHAR(20) CONSTRAINT nn_editoras_nome NOT NULL ); CREATE TABLE cd ( cod_cd INTEGER CONSTRAINT pk_cd_cod PRIMARY KEY, id_editora INTEGER CONSTRAINT fk_cd_id_editora REFERENCES editoras(id_editora), titulo VARCHAR(40) CONSTRAINT nn_cd_titulo NOT NULL, data_compra DATE, valor_pago NUMERIC(5,2), local_compra VARCHAR(20) ); CREATE TABLE musicas ( nr_musica INTEGER, cod_cd INTEGER, titulo VARCHAR(40) CONSTRAINT nn_musicas_titulo NOT NULL, interprete VARCHAR(30) CONSTRAINT nn_musicas_interprete NOT NULL, duracao NUMERIC(5,2), CONSTRAINT pk_musicas_nr_musica_cod_cd PRIMARY KEY (cod_cd, nr_musica), CONSTRAINT fk_musicas_cod_cd FOREIGN KEY (cod_cd) REFERENCES cd(cod_cd) ); --preencher tabelas INSERT INTO editoras VALUES (1, 'BMG'); INSERT INTO editoras VALUES (2, '4AD'); INSERT INTO editoras VALUES (3, 'Polydor'); INSERT INTO editoras VALUES (4, 'Universal Music'); INSERT INTO editoras VALUES (5, 'Warner Music'); INSERT INTO editoras VALUES (6, 'Island Records'); INSERT INTO editoras VALUES (7, 'Parlaphone'); INSERT INTO editoras VALUES (8, 'ADF'); INSERT INTO editoras VALUES (9, '<NAME>'); INSERT INTO cd VALUES (1, 8, 'Punkzilla', TO_DATE('22/Abril/2011','DD/MON/YY'), 55.00 , 'FNAC'); INSERT INTO cd VALUES (2, 1, 'Classic Duets', TO_DATE('21/Maio/2017','DD/MON/YY'), 30.50, 'Worten'); INSERT INTO cd VALUES (3, 7, 'The Wall', TO_DATE('22/Abril/2011','DD/MON/YY'), 25.80, 'FNAC'); INSERT INTO cd VALUES (4, 1, 'Hits 4', TO_DATE('10/Setembro/2017','DD/MON/YY'), 42.30, 'Worten'); INSERT INTO cd VALUES (5, 6, 'Songs of Experience', TO_DATE('1/Janeiro/2018','DD/MON/YY'), 10.99, NULL); INSERT INTO cd VALUES (6, 5, 'Giesta 2', TO_DATE('15/Junho/2017','DD/MON/YY'), 9.10, NULL); INSERT INTO cd VALUES (7, 4, 'O Mundo ao Contrário', TO_DATE('01/Janeiro/2004','DD/MON/YY'), 12.90, 'FNAC'); INSERT INTO cd VALUES (8, 3, 'Born to Die', TO_DATE('27/Janeiro/2012','DD/MON/YY'), 9.90, 'iTunes'); INSERT INTO musicas VALUES (1, 1, 'Dream of Waking', 'AFI', 3.05); INSERT INTO musicas VALUES (2, 1, 'Still', 'Rufio', 3.02); INSERT INTO musicas VALUES (3, 1, 'Behind the Music', 'The Vandals', 2.41); INSERT INTO musicas VALUES (4, 1, 'Why Are You Alive', 'The Vandals', 2.34); INSERT INTO musicas VALUES (5, 1, 'Vandals', 'The Vandals', 4.01); INSERT INTO musicas VALUES (6, 1, 'Days of the Phoenix', 'AFI', 3.28); INSERT INTO musicas VALUES (7, 1, 'Wester', 'AFI', 3.02); INSERT INTO musicas VALUES (8, 1, 'Blue Jeans', 'Lana Del Rey', 3.29); INSERT INTO musicas VALUES (1, 2, 'Bizet: Les pécheurs de perles...', 'Orquestra Filarmónica Real', 5.24); INSERT INTO musicas VALUES (2, 2, 'Verdi: Otello/Act 2', 'Orquestra Sinfónica Chicago', 6.47); INSERT INTO musicas VALUES (3, 2, 'Verdi: Aida/Act 4', 'Loring Maazel', 4.38); INSERT INTO musicas VALUES (4, 2, 'Puccini: Turandot', 'Zubin Mehta', 3.08); INSERT INTO musicas VALUES (1, 3, 'In the Flesh', 'Pink Floyd', 3.02); INSERT INTO musicas VALUES (2, 3, 'The Thin Lee', 'Pink Floyd', 2.30); INSERT INTO musicas VALUES (3, 3, 'Mother', 'Pink Floyd', 5.34); INSERT INTO musicas VALUES (4, 3, 'Don''t Leave Me Now', 'Pink Floyd', 4.21); INSERT INTO musicas VALUES (5, 3, 'Young Lust', 'Pink Floyd', 3.19); INSERT INTO musicas VALUES (1, 4, 'It''s Alright(Baby''s Coming Back)', 'Eurythmics', 3.05); INSERT INTO musicas VALUES (2, 4, 'Hounds of Love' , 'Kate Bush', 3.02); INSERT INTO musicas VALUES (3, 4, 'Calling America', 'Electric Light Orchestra', 2.41); INSERT INTO musicas VALUES (4, 4, 'Suspicious Minds', 'Fine Young Cannibals', 2.34); INSERT INTO musicas VALUES (5, 4, 'I''m Your Man', 'Wham!', 3.28); INSERT INTO musicas VALUES (6, 4, 'Blue Jeans', 'Lana Del Rey', 3.29); INSERT INTO musicas VALUES (1, 5, 'Love is All We Have Left', 'U2', 2.41); INSERT INTO musicas VALUES (2, 5, 'Lights of Home' , 'U2', 4.16); INSERT INTO musicas VALUES (3, 5, 'You''re the Best Thing About Me', 'U2', 3.45); INSERT INTO musicas VALUES (4, 5, 'Get Out of Your Own Way', 'U2', 3.58); INSERT INTO musicas VALUES (5, 5, 'American Soul', 'U2', 4.21); INSERT INTO musicas VALUES (6, 5, 'Summer of Love', 'U2', 3.24); INSERT INTO musicas VALUES (7, 5, 'Red Flag Day', 'U2', 3.19); INSERT INTO musicas VALUES (8, 5, 'The Showman', 'U2', 3.23); INSERT INTO musicas VALUES (1, 6, 'Valsa em Espiral', '<NAME>', 3.34); INSERT INTO musicas VALUES (2, 6, '1987' , '<NAME>', 4.12); INSERT INTO musicas VALUES (3, 6, '<NAME>', '<NAME>', 3.13); INSERT INTO musicas VALUES (4, 6, 'Via Norte', '<NAME>', 3.35); INSERT INTO musicas VALUES (5, 6, 'Sangemil', '<NAME>', 4.03); INSERT INTO musicas VALUES (6, 6, '<NAME> Lenta', '<NAME>', 4.41); INSERT INTO musicas VALUES (7, 6, '<NAME>', '<NAME>', 5.03); INSERT INTO musicas VALUES (8, 6, '20% Mais', '<NAME>', 1.20); INSERT INTO musicas VALUES (9, 6, 'Vândalo', '<NAME>', 4.45); INSERT INTO musicas VALUES (10, 6, '<NAME>', '<NAME>', 4.45); INSERT INTO musicas VALUES (1, 7, 'Desejo', 'Xutos e Pontapés', 3.25); INSERT INTO musicas VALUES (2, 7, 'Diz-me' , 'Xutos e Pontapés', 4.37); INSERT INTO musicas VALUES (3, 7, 'Ai Se Ele Cai', 'Xutos e Pontapés', 3.12); INSERT INTO musicas VALUES (4, 7, 'Pequeno Pormenor', 'Xutos e Pontapés', 2.58); INSERT INTO musicas VALUES (5, 7, 'Zona Limite', 'Xutos e Pontapés', 3.27); INSERT INTO musicas VALUES (6, 7, 'Fim de Semana', 'Xutos e Pontapés', 5.27); INSERT INTO musicas VALUES (7, 7, 'Gota a Gota', 'Xutos e Pontapés', 2.35); INSERT INTO musicas VALUES (8, 7, 'Teimosia', 'Xutos e Pontapés', 4.13); INSERT INTO musicas VALUES (9, 7, 'O Mundo ao Contrário', 'Xutos e Pontapés', 4.18); INSERT INTO musicas VALUES (10, 7, 'Sombra Colorida', 'Xutos e Pontapés', 2.38); INSERT INTO musicas VALUES (1, 8, 'Born to Die', 'Lana Del Rey', 4.46); INSERT INTO musicas VALUES (2, 8, 'Off the Races' , 'Lana Del Rey', 4.59); INSERT INTO musicas VALUES (3, 8, 'Blue Jeans', 'Lana Del Rey', 3.29); INSERT INTO musicas VALUES (4, 8, 'Video Games', 'Lana Del Rey', 4.41); INSERT INTO musicas VALUES (5, 8, 'Diet Mountain Dew', 'Lana Del Rey', 3.42); INSERT INTO musicas VALUES (6, 8, 'National Anthen', 'Lana Del Rey', 3.50); INSERT INTO musicas VALUES (7, 8, 'Dark Paradise', 'Lana Del Rey', 4.03); INSERT INTO musicas VALUES (8, 8, 'Radio', 'Lana Del Rey', 3.34); INSERT INTO musicas VALUES (9, 8, 'Carmen', 'Lana Del Rey', 4.08); INSERT INTO musicas VALUES (10, 8, 'Million Dollar Man', 'Lana Del Rey', 3.50); INSERT INTO musicas VALUES (11, 8, 'Summertime Sadness', 'Lana Del Rey', 4.24); INSERT INTO musicas VALUES (12, 8, 'This Is What Make Us Girls', 'Lana Del Rey', 4.00); -- 1) Mostrar, numa coluna, o título de cada CD e de cada uma das músicas; select titulo from cd union select titulo from musicas -- 2) Copiar e alterar o comando da alínea anterior, de modo a não mostrar os registos repetidos; select distinct(titulo) from cd union select distinct(titulo) from musicas -- 3) Copiar e alterar o comando da alínea anterior, de modo a apresentar também o comprimento de cada título e por ordem decrescente; select distinct(titulo), length(titulo) from cd union select distinct(titulo), length(titulo) from musicas -- 4) Mostrar a duração das músicas dos Pink Floyd que são iguais à duração de músicas de outros intérpretes; select * from musicas where interprete = 'Pink Floyd' intersect select * from musicas where interprete != 'Pink Floyd' -- 5) Alterar o comando da alínea anterior, de modo a mostrar a duração das músicas por ordem decrescente; select * from musicas where interprete = 'Pink Floyd' intersect select * from musicas where interprete != 'Pink Floyd' order by duracao desc -- 6) Mostrar o id das editoras que não estão relacionadas com qualquer CD; select id_editora from editoras minus select id_editora from cd -- 7) Alterar o comando da alínea anterior, de modo a mostrar o resultado por ordem decrescente. select id_editora from editoras minus select id_editora from cd order by id_editora desc -- 1) Mostrar apenas a quantidade de CD comprados por local de compra; select count(*) from cd group by local_compra -- 2) Alterar o comando da alínea anterior, de forma a não mostrar registos duplicados; select distinct count(*) from cd group by local_compra -- 3) Mostrar a quantidade de CD comprados por local de compra e o respetivo local de compra; select count(*), local_compra from cd where local_compra is not null group by local_compra -- 4) Copiar e alterar o comando da alínea anterior, de forma a mostrar o resultado por ordem crescente da quantidade de CD comprados; select count(*) as quantidade, local_compra from cd where local_compra is not null group by local_compra order by quantidade -- 12) Mostrar os locais de compra, cujo média do valor pago por CD é inferior a 10, juntamente com o respetivo total do valor pago. select local_compra, avg(valor_pago) as media_valor_pago, sum(valor_pago) as total_valor_pago from cd group by local_compra having media_valor_pago < 10 -- 13) Mostrar o valor total pago nos locais de compra, cuja quantidade de CD comprados é inferior a 2. O local de compra também deve ser visualizado; select count(*), local_compra from cd group by local_compra having count(*) < 2 -- 14) Mostrar o interprete e o código do CD em que o interprete participa apenas em 1 música. -- Oresultado deve ser apresentado por ordem crescente do código do CD e, em caso de igualdade, por ordem alfabética do interprete; select interprete, cod_cd from musicas group by interprete, cod_cd having count(*) = 1 -- 15) Copiar e alterar o comando da alínea anterior, de modo a mostrar apenas os intérpretes e sem duplicados; select distinct(interprete) from musicas group by interprete, cod_cd having count(*) = 1 order by interprete
<reponame>HHeyhat/module-whmcs -- -- Table structure for table `pw_delivery_data` -- CREATE TABLE IF NOT EXISTS `pw_delivery_data` ( `id` int(11) NOT NULL, `reference_id` varchar(50) DEFAULT NULL, `username` varchar(50) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `invoice_id` int(11) DEFAULT NULL, `order_id` int(11) DEFAULT NULL, `package_id` int(11) DEFAULT NULL, `status` varchar(25) DEFAULT 'unsent', `data` text, `created_date` int(11) DEFAULT NULL, `updated_date` int(11) DEFAULT NULL ) ENGINE=InnoDB; -- -- Indexes for table `pw_delivery_data` -- ALTER TABLE `pw_delivery_data` ADD PRIMARY KEY (`id`); -- -- table `pw_delivery_data` -- ALTER TABLE `pw_delivery_data` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=0; CREATE TABLE IF NOT EXISTS `pw_payment_token` ( `id` int(11) NOT NULL PRIMARY KEY, `user_id` int(11) DEFAULT NULL, `gateway_id` varchar(50) DEFAULT NULL, `token` text DEFAULT NULL, `card_type` varchar(255) DEFAULT NULL, `card_last_four` varchar(255) DEFAULT NULL, `expiry_month` varchar(255) DEFAULT NULL, `expiry_year` varchar(255) DEFAULT NULL, `created_date` int(11) DEFAULT NULL, `updated_date` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0;
USE [DataQualityDB] GO IF EXISTS (SELECT 1 FROM [INFORMATION_SCHEMA].[ROUTINES] WHERE SPECIFIC_NAME = 'sExecuteStandAloneRule' AND SPECIFIC_SCHEMA = 'DQ') BEGIN DROP PROC [DQ].[sExecuteStandAloneRule] END GO CREATE PROC [DQ].[sExecuteStandAloneRule] @RuleEntityAssociationCode VARCHAR (10) = 29 , @ParentLoadId VARCHAR (10) = 1 , @Debug INT = 0 as /****************************************************************************** ** Author: Dartec Systems (<NAME>) ** Created Date: 15/11/2015 ** Desc: Debugging proc. ** Runs a single specified rule (based on the incoming @RuleEntityAssociationCode ) ** ** Return values: ** ** Called by: ** ** Parameters: ** Input ** ---------- -- @RuleEntityAssociationCode - The rule identifier used to return all of information used to create, log and execute the rule ** ** Output ** ---------- -- Success: None -- Failure: RaiseError ** ******************************************************************************* ** Change History ******************************************************************************* ** By: Date: Description: ** --- -------- ----------------------------------------------------------- ** MG 01/03/2016 Release 1.0.3 *******************************************************************************/ SET NOCOUNT ON declare @RoutineName VARCHAR (255) , @SqlStmt VARCHAR (MAX) , @ExecutionSequenceNumber varchar (10) = 1 , @DatabaseName VARCHAR (255) , @SchemaName VARCHAR (255) , @EntityName VARCHAR (255) , @LoadId VARCHAR (255) , @ExecutionId UNIQUEIDENTIFIER = newid() , @RoutineId UNIQUEIDENTIFIER = newId() , @PackageName NVARCHAR (250) = OBJECT_NAME(@@PROCID) , @Error VARCHAR(MAX) , @ErrorNumber INT , @ErrorSeverity VARCHAR (255) , @ErrorState VARCHAR (255) , @ErrorMessage VARCHAR(MAX) , @LoadProcess VARCHAR (255) = NULL BEGIN TRY SET @LoadProcess = 'StandAloneExecution || ' + @RuleEntityAssociationCode EXEC [Audit].[sStartRoutineLoad] @ParentLoadId = @ParentLoadId, @ExecutionId= @ExecutionId, @RoutineId = @RoutineId, @PackageName = @PackageName , @RoutineType = 'Stored Procedure' , @LoadProcess = @LoadProcess, @LoadId = @LoadId OUTPUT SELECT @RoutineName = CASE WHEN RuleType_Name = 'RuleExpression' THEN '[DQ].[sApplyDQRuleExpression]' WHEN RuleType_Name = 'RuleHarmonization' THEN '[DQ].[sApplyDQRuleHarmonization]' WHEN RuleType_Name = 'RuleProfiling' THEN '[DQ].[sApplyDQRuleProfiling]' WHEN RuleType_Name = 'RuleReference' THEN '[DQ].[sApplyDQRuleReferences]' WHEN RuleType_Name = 'RuleValueCorrection' THEN '[DQ].[sApplyDQRuleValueCorrect]' WHEN RuleType_Name = 'RuleTransformation' THEN '[DQ].[sApplyDQRuleTransformation]' ELSE 'No rule type' END , @DatabaseName = AE.[Database] , @SchemaName = AE.[Schema] , @EntityName = AE.EntityName FROM MDS.DQRuleEntityAssociation REA INNER JOIN MDS.DQAppEntity AE ON REA.DQEntity_Code = AE.Code WHERE REA.Code= @RuleEntityAssociationCode SET @SqlStmt = 'EXEC ' + @RoutineName + ' ' +@RuleEntityAssociationCode +', ' + @LoadId + ', ' + @ExecutionSequenceNumber IF @Debug =1 BEGIN PRINT @RoutineName PRINT @RuleEntityAssociationCode PRINT @LoadId PRINT @ExecutionSequenceNumber PRINT @SqlStmt END EXEC [DQ].[sInsertRuleExecutionHistory] @DatabaseName = @DatabaseName, @SchemaName = @SchemaName, @EntityName= @EntityName, @RuleId = @RuleEntityAssociationCode, @RuleType = 'StandAloneRule1', @RuleSQL = @SQLStmt, @ParentLoadId = @LoadId, @RuleSQLDescription = 'Execution - StandAlone Rule.', @Debug =1 EXEC (@SQLStmt) PRINT @SqlStmt EXEC [Audit].[sEndRoutineLoad] @LoadId = @LoadId, @LoadStatusShortName = 'SUCCESS' END TRY BEGIN CATCH SET @ErrorSeverity = '10' --CONVERT(VARCHAR(255), ERROR_SEVERITY()) -- Setting as ten allows the other executions to continue whilst flagging this one as failed SET @ErrorState = CONVERT(VARCHAR(255), ERROR_STATE()) SET @ErrorNumber = CONVERT(VARCHAR(255), ERROR_NUMBER()) SET @Error = '(Proc: ' + OBJECT_NAME(@@PROCID) + ' Line: ' + CONVERT(VARCHAR(255), ERROR_LINE()) + ' Number: ' + CONVERT(VARCHAR(255), ERROR_NUMBER()) + ' Severity: ' + CONVERT(VARCHAR(255), ERROR_SEVERITY()) + ' State: ' + CONVERT(VARCHAR(255), ERROR_STATE()) + ') ' + CONVERT(VARCHAR(255), ERROR_MESSAGE()) /* Create a tidy error message*/ SET @Error = @Error /* Stamp the routine load value as failure*/ EXEC [Audit].[sEndRoutineLoad] @LoadId = @LoadId, @LoadStatusShortName = 'FAILURE' /* Record the nature of the failure*/ EXEC [Audit].[sRoutineErrorStamp] @LoadId = @LoadId, @ErrorCode = @ErrorNumber, @ErrorDescription = @Error, @SourceName= @PackageName /*Raise an error*/ RAISERROR (@Error, @ErrorSeverity, @ErrorState) WITH NOWAIT END CATCH
<reponame>seijim/cloud-robotics-azure-platform-v1-sdk -- -- Conversation API (Conversation State) -- CREATE TABLE [RBApp].[ConversationState] ( [SeqId] int IDENTITY NOT NULL, [DeviceId] NVARCHAR(100) NOT NULL, [AppId] NVARCHAR(100) NOT NULL, [State] VARCHAR(MAX) NULL, [Description] NVARCHAR(1000) NULL, [Registered_DateTime] DATETIME NULL, CONSTRAINT [PK_ConversationState] PRIMARY KEY CLUSTERED ( [DeviceId] ASC, [AppId] ASC )) WITH (DATA_COMPRESSION=PAGE)
<reponame>RoseRocket/db-muffler<filename>example/sample.sql -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.13 -- Dumped by pg_dump version 9.6.13 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; -- -- Data for Name: users; Type: TABLE DATA; -- INSERT INTO public.users (id, created_at, updated_at, email, password, onboarding_state, deleted_at, activated, days_online, user_avatar) VALUES ('b16a0c48-77e1-492e-8c1a-a357848edde1', '2019-10-07 03:13:17.01177+00', '2019-10-07 03:13:17.01177+00', '<EMAIL>', <PASSWORD>', '', '2019-10-07 03:13:17.01177+00', TRUE, 100, ''); INSERT INTO public.users (id, created_at, updated_at, email, password, onboarding_state, deleted_at, activated, days_online, user_avatar) VALUES ('13286188-e618-4e76-b2af-d64b0fef06fc', '2019-10-07 03:18:08.89563+00', '2019-10-07 03:18:08.89563+00', '<EMAIL>', <PASSWORD>', '', NULL, TRUE, 200, ''); INSERT INTO public.users (id, created_at, updated_at, email, password, onboarding_state, deleted_at, activated, days_online, user_avatar) VALUES ('8622620f-9d85-4106-87dc-17abdc26e77e', '2019-10-10 01:19:08.992745+00', '2019-10-10 01:19:08.992745+00', '<EMAIL>', <PASSWORD>', '', NULL, TRUE, 300, ''); INSERT INTO public.users (id, created_at, updated_at, email, password, onboarding_state, deleted_at, activated, days_online, user_avatar) VALUES ('00000000-0000-0000-0000-000000000002', '2019-10-07 01:38:44.189809+00', '2019-10-28 20:22:15.940933+00', '<EMAIL>', <PASSWORD>', '', NULL, FALSE, 0, ''); INSERT INTO public.users (id, created_at, updated_at, email, password, onboarding_state, deleted_at, activated, days_online, user_avatar) VALUES ('00000000-0000-0000-0000-000000000003', '2019-10-07 01:38:44.189809+00', '2019-10-28 20:22:15.940933+00', '<EMAIL>', <PASSWORD>', '', NULL, FALSE, 0, ''); INSERT INTO public.users (id, created_at, updated_at, email, password, onboarding_state, deleted_at, activated, days_online, user_avatar) VALUES ('00000000-0000-0000-0000-000000000001', '2019-10-07 01:38:44.189809+00', '2019-10-28 20:22:15.940933+00', '<EMAIL>', <PASSWORD>', '', NULL, FALSE, 0, ''); -- -- PostgreSQL database dump complete --
<reponame>aviv/sqlfluff<filename>test/fixtures/dialects/mysql/delete_multitable.sql DELETE a FROM a JOIN b USING (id) WHERE b.name = 'example'; DELETE FROM somelog WHERE user = 'jcole' ORDER BY timestamp_column LIMIT 1; DELETE LOW_PRIORITY QUICK IGNORE a FROM a JOIN b USING (id) WHERE b.name = 'example'; DELETE FROM a PARTITION (p) WHERE b.name = 'example'; -- Multiple-Table Syntax 1 DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; DELETE LOW_PRIORITY QUICK IGNORE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; -- Multiple-Table Syntax 2 DELETE FROM t1, t2 USING t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; DELETE LOW_PRIORITY QUICK IGNORE FROM t1, t2 USING t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; DELETE a1, a2 FROM t1 AS a1 INNER JOIN t2 AS a2 WHERE a1.id=a2.id;
<filename>Databases/Commerce.Database/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/GetOutstandingPartnerRedeemedDealRecords.sql -- -- Copyright (c) Microsoft Corporation. All rights reserved. -- Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. -- CREATE PROCEDURE GetOutstandingPartnerRedeemedDealRecords @partnerId INT AS set nocount on; DECLARE @st datetime = getUTCdate() ,@Milliseconds int ,@SP varchar(100) = 'GetOutstandingPartnerRedeemedDealRecords'; declare @outstandingTransactions table (RedeemedDealId uniqueidentifier, PartnerMerchantId nvarchar(255), PartnerDealId nvarchar(255), PartnerReferenceNumber nvarchar(255), PartnerCardId varchar(100), DiscountAmount int, PurchaseDateTime datetime2 , TransactionReferenceNumber int, MerchantName nvarchar(100), MerchantId varchar(100), SettlementAmount int, GlobalId uniqueidentifier, ParentDealId uniqueidentifier, PartnerData xml, ReimbursementTenderId int, GlobalUserId uniqueidentifier, PartnerRedeemedDealScopeId nvarchar(255) ); EXECUTE sp_getapplock 'GetOutstandingPartnerRedeemedDealRecords_Lock', 'exclusive' --find all transactions for the partner for which clearing message is received and insert them into @outstandingTransactions INSERT @outstandingTransactions SELECT RD.Id AS RedeemedDealId, PartnerRD.PartnerMerchantId ,'' AS PartnerDealId ,PartnerRD.PartnerReferenceNumber ,CASE WHEN @partnerId = 1 THEN C.FDCToken ELSE C.PartnerToken END AS PartnerCardId ,RD.DiscountAmount ,RD.PurchaseDateTime ,PartnerRD.TransactionReferenceNumber ,MN.Name AS MerchantName ,MN.Id AS MerchantId ,RD.SettlementAmount ,D.GlobalId ,D.GlobalId AS ParentDealId ,PartnerRD.PartnerData ,D.OfferType + 2 AS ReimbursementTenderId ,U.GlobalID AS GlobalUserId ,PartnerRD.PartnerRedeemedDealScopeId AS PartnerRedeemedDealScopeId FROM dbo.PartnerRedeemedDeals PartnerRD JOIN dbo.RedeemedDeals RD ON RD.Id = PartnerRD.RedeemedDealId JOIN dbo.TransactionLinks CD ON CD.Id = RD.ClaimedDealId JOIN dbo.Offers D ON D.Id = CD.DealId JOIN dbo.Merchants MN ON MN.Id = RD.MerchantNameId JOIN dbo.Cards C ON C.Id = CD.CardId JOIN dbo.Users U ON CD.UserId = U.Id WHERE CD.PartnerId = @partnerId AND D.OfferType = 1 -- Burn AND RD.CreditStatusId = 5 -- ClearingReceived AND RD.ReviewStatusId IN (0, 2) -- Unnecessary or ResolvedAccept -- TODO - remove the following FDCToken check when we remove FDC calls -- AND ((@partnerId = 3 and C.FDCToken <> '') or @partnerId <> 3) -- Visa cards must have FDC Token to have FDC issue a statement credit. AND RD.DiscountAmount > 0; -- Must have an actual burn coming. (This stops us from spamming our partners with dead transactions, and stops them from spamming us in turn.) -- update CreditStatusId in RedeemedDeals table and set to GeneratingStatementCreditRequest for all rows selected. This will prevent other process from selecting the same rows again UPDATE RD SET RD.CreditStatusId = 10 --GeneratingStatementCreditRequest FROM dbo.RedeemedDeals RD JOIN @outstandingTransactions OT ON RD.Id = OT.RedeemedDealId; SELECT * FROM @outstandingTransactions ORDER BY PartnerMerchantId; SET @Milliseconds = datediff(millisecond,@st,getUTCdate()); EXECUTE dbo.LogEvent @Process=@SP,@Status='Info',@Milliseconds=@Milliseconds; GO
-- IFS-8980 remove state aid column ALTER TABLE competition DROP COLUMN state_Aid;
<gh_stars>1-10 -- APR-2654 - Increase website domain length from upto 5 to upto 13 in Question YO-41 -- WORKFLOW: ROATP -- DATE: 2021-08-10 UPDATE appSection SET appSection.QnAData = REPLACE(appSection.QnAData, '.[a-z]{2,5}(:[0-9]{1,5})', '.[a-z]{2,13}(:[0-9]{1,5})') FROM ApplicationSections appSection INNER JOIN Applications app ON app.Id = appSection.ApplicationId INNER JOIN Workflows wf ON wf.Id = app.WorkflowId WHERE appSection.SequenceNo = 1 AND appSection.SectionNo = 2 AND wf.Type = 'roatp';
<reponame>danieldiamond/gitlab-analytics<filename>transform/snowflake-dbt/models/staging/gitlab_dotcom/xf/gitlab_dotcom_label_states_xf.sql WITH resource_label_events AS ( SELECT * FROM {{ref('gitlab_dotcom_resource_label_events')}} WHERE label_id IS NOT NULL ), aggregated AS ( SELECT label_id, epic_id, issue_id, merge_request_id, MAX(CASE WHEN action_type='added' THEN created_at END) AS max_added_at, MAX(CASE WHEN action_type='removed' THEN created_at END) AS max_removed_at FROM resource_label_events {{ dbt_utils.group_by(n=4) }} ), final AS ( -- Leave removed_at NULL if less than added_at. SELECT label_id, epic_id, issue_id, merge_request_id, max_added_at AS added_at, CASE WHEN max_removed_at > max_added_at THEN max_removed_at WHEN max_added_at IS NULL THEN max_removed_at END AS removed_at, IFF(removed_at IS NULL, 'added', 'removed') AS latest_state FROM aggregated ) SELECT * FROM final
<filename>Databases Advanced - Entity Framework Core/DB Apps Introduction/ADO.NET Fetching Resultsets/SQL/SelectVillainIdByName.sql SELECT Id FROM Villains WHERE Name = @name;
<reponame>vdvorak83/2021-11-otus-spring-Vaselev<filename>07_DAO_Spring_JDBC/src/main/resources/schema.sql<gh_stars>1-10 DROP TABLE IF EXISTS author CASCADE; CREATE TABLE author( id BIGSERIAL, name CHARACTER VARYING(255), CONSTRAINT author_pk PRIMARY KEY (id) ); DROP TABLE IF EXISTS genre CASCADE; CREATE TABLE genre( id BIGSERIAL, name CHARACTER VARYING(50), CONSTRAINT genre_pk PRIMARY KEY (id) ); DROP TABLE IF EXISTS book; CREATE TABLE book( id BIGSERIAL, author_id BIGINT NOT NULL, genre_id BIGINT NOT NULL, name CHARACTER VARYING(50), CONSTRAINT book_pk PRIMARY KEY (id) ); ALTER TABLE book ADD CONSTRAINT book_fk_01 FOREIGN KEY (author_id) REFERENCES author (id); ALTER TABLE book ADD CONSTRAINT book_fk_02 FOREIGN KEY (genre_id) REFERENCES genre (id);
<reponame>EuPathDB/ApiCommonData create table ApiDBUserDatasets.InstalledUserDataset ( user_dataset_id number(20) not null, name varchar(100) not null, is_invalid number(1), invalid_reason varchar2(1000), primary key (user_dataset_id) ); GRANT insert, select, update, delete ON ApiDBUserDatasets.InstalledUserDataset TO gus_w; GRANT select ON ApiDBUserDatasets.InstalledUserDataset TO gus_r; -------------------------------------------------------------------------------- create table ApiDBUserDatasets.UserDatasetOwner ( user_id number(12) not null, user_dataset_id number(20) not null, primary key (user_id, user_dataset_id), FOREIGN KEY (user_dataset_id) REFERENCES ApiDBUserDatasets.InstalledUserDataset ); GRANT insert, select, update, delete ON ApiDBUserDatasets.UserDatasetOwner TO gus_w; GRANT select ON ApiDBUserDatasets.UserDatasetOwner TO gus_r; --------------------------------------------------------------------------------- create table ApiDBUserDatasets.UserDatasetSharedWith ( owner_user_id number(12) not null, recipient_user_id number(12) not null, user_dataset_id number(20) not null, primary key (owner_user_id, recipient_user_id, user_dataset_id), FOREIGN KEY (user_dataset_id) REFERENCES ApiDBUserDatasets.InstalledUserDataset ); GRANT insert, select, update, delete ON ApiDBUserDatasets.UserDatasetSharedWith TO gus_w; GRANT select ON ApiDBUserDatasets.UserDatasetSharedWith TO gus_r; create index udshareix_01 on ApiDBUserDatasets.UserDatasetSharedWith (user_dataset_id, owner_user_id, recipient_user_id) tablespace indx; --------------------------------------------------------------------------------- create view ApiDBUserDatasets.UserDatasetAccessControl as select USER_ID,USER_DATASET_ID from ApiDBUserDatasets.UserDatasetOwner union select RECIPIENT_USER_ID AS USER_ID,USER_DATASET_ID from ApiDBUserDatasets.UserDatasetSharedWith; GRANT select ON ApiDBUserDatasets.UserDatasetAccessControl TO gus_r; --------------------------------------------------------------------------------- CREATE TABLE ApiDBUserDatasets.UserDatasetEvent ( event_id NUMBER(20) NOT NULL PRIMARY KEY, event_type VARCHAR(16) NOT NULL, status VARCHAR2(18) NOT NULL, user_dataset_id NUMBER(20) NOT NULL, user_dataset_type_name VARCHAR2(256) NOT NULL, user_dataset_type_version VARCHAR2(256) NOT NULL, handled_time TIMESTAMP WITH TIME ZONE NOT NULL ); GRANT insert, select, update, delete ON ApiDBUserDatasets.UserDatasetEvent TO gus_w; GRANT select ON ApiDBUserDatasets.UserDatasetEvent TO gus_r; exit;
SELECT * FROM VIEW_HISTORIES ORDER BY INSERT_DATETIME %s LIMIT ? OFFSET ?;
-- DISCLAIMER: -- This script is provided for educational purposes only. It is -- NOT supported by Oracle World Wide Technical Support. -- The script has been tested and appears to work as intended. -- You should always run new scripts initially -- on a test instance. set timing off set echo off set lines 400 pages 1000 set feedback 1 set pause off set echo on set autotrace off column plan_table_output format a150 set trims on PROMPT Connect to the Attribute Clusters/Zone Map Schema connect aczm12c/oracle_4U -- PROMPT Delete operations do not invalidate zones or partitions PROMPT because they will not invalidate MIN/MAX value ranges. -- DELETE FROM sales_p WHERE order_id = 10 / COMMIT / PROMPT Observe that the state remains "0" for all zones and partitions SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; PROMPT The zone map is not made stale... SELECT stale FROM user_zonemaps WHERE zonemap_name = 'ZMAP$_SALES_P' / -- PROMPT Conventional path insert will invalidate PROMPT relevant zones and partitions unless PROMPT the zone map is set to refresh on commit. -- INSERT INTO sales_p SELECT 10,1,TO_DATE('01-JAN-2000','DD-MON-YYYY'),TO_DATE('02-JAN-2000','DD-MON-YYYY'),'JANE',23,20,2,67,'<NAME>' FROM dual / COMMIT / PROMPT Individual zones are now invalidated... SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; PROMPT But the zone map is not stale... SELECT stale FROM user_zonemaps WHERE zonemap_name = 'ZMAP$_SALES_P' / PROMPT If the zone map itself is not stale, PROMPT a fast refresh is possible. PROMPT Only stale zones are scanned to refresh PROMPT the zone map. EXECUTE dbms_mview.refresh('ZMAP$_SALES_P', 'f'); PROMPT The zones are valid (0) again... SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; PROMPT Remove the "test" row. Zones will remain valid. DELETE FROM sales_p WHERE order_id = 10 / COMMIT / PROMPT Direct path operations will maintain the zone map INSERT /*+ APPEND */ INTO sales_p SELECT 10,1,TO_DATE('01-JAN-2000','DD-MON-YYYY'),TO_DATE('02-JAN-2000','DD-MON-YYYY'),'JANE',23,20,2,67,'<NAME>' FROM dual / COMMIT / PROMPT All zones still valid... SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; -- PROMPT Updates to non-zone map columns (and columns not PROMPT used to join with dimension tables) PROMPT do not invalidate the zones or partitions PROMPT (unless there is row movement when a PROMPT partition key is updated) -- UPDATE sales_p SET amount = amount + 100 WHERE location_id < 20 / COMMIT / PROMPT All zones are still valid... SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; PROMPT Remove the "test" row. Zones will remain valid. DELETE FROM sales_p WHERE order_id = 10 / COMMIT / PROMPT A conventional path insert will invalidate zones... INSERT INTO sales_p SELECT 10,1,TO_DATE('01-JAN-2000','DD-MON-YYYY'),TO_DATE('02-JAN-2000','DD-MON-YYYY'),'JANE',23,20,2,67,'WINSTON SALEM' FROM dual / COMMIT / PROMPT Note invalid zones (marked with "1")... SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; PROMPT Even if some zones are stale, PROMPT queries will continue to use the zone map where possible. PROMPT The primary effect of zones being markes as stale PROMPT is that these zones cannot be skipped: stale zones PROMPT and partitions will always be scanned. SELECT SUM(amount) FROM sales_p WHERE delivered between TO_DATE('18-SEP-2000', 'DD-MON-YY') and TO_DATE('19-SEP-2000', 'DD-MON-YY') / SELECT * FROM TABLE(dbms_xplan.display_cursor); PROMPT Data movement can maintain zone maps PROMPT and attribute clusters. ALTER TABLE sales_p MOVE PARTITION p1 / PROMPT All zones are valid (0)... SELECT zone_id$ , zone_level$, zone_state$ , zone_rows$ FROM ZMAP$_SALES_P; PROMPT Remove the "test" row. Zones will remain valid. DELETE FROM sales_p WHERE order_id = 10 / COMMIT /
--+ holdcas on; set names utf8; CREATE TABLE Çç_Ğğ_İı_Öö_Şş_Üü(col INT NOT NULL AUTO_INCREMENT); CREATE TABLE Sevinç(col INT NOT NULL AUTO_INCREMENT); CREATE TABLE _Şükran(col INT NOT NULL AUTO_INCREMENT); CREATE TABLE İlhan(col INT NOT NULL AUTO_INCREMENT); --test SHOW FULL TABLES LIKE '%Çç%'; --test SHOW FULL TABLES LIKE '%Şü%'; --test SHOW FULL TABLES LIKE '%İ%'; --test SHOW FULL TABLES LIKE '_İ%'; --test SHOW TABLES LIKE '_İ%'; --test SHOW TABLES LIKE '%Sev_n_' ; drop table Çç_Ğğ_İı_Öö_Şş_Üü; drop table Sevinç; drop table _Şükran; drop table İlhan; set names iso88591; commit; --+ holdcas off;
--TEST: test with tables with triggers create table variance_trigger( col1 bit(20), col2 bit varying, col3 blob, col4 clob, col5 short ); create table variance_action( id int auto_increment, str char(20) ); --create trigger create trigger aft_ins after insert on variance_trigger execute insert into variance_action(str) values ('INSERTED'); insert into variance_trigger values(B'1011', X'abc', X'0', 'cubrid', 333); insert into variance_trigger values(B'1011', x'bcd', X'1', 'cubrid', 123); insert into variance_trigger values(B'1011', X'abc', X'2', 'cubrid', 888); insert into variance_trigger values(B'1011', x'bcd', X'3', 'cubrid', 666); insert into variance_trigger values(B'1011', X'abc', X'4', 'cubrid', 222); insert into variance_trigger values(B'1001', x'bcd', X'5', 'cubrid', 777); insert into variance_trigger values(B'1001', X'abc', X'6', 'cubrid', 999); insert into variance_trigger values(B'1001', X'abc', X'7', 'cubrid', 444); insert into variance_trigger values(B'1001', X'cde', X'8', 'cubrid', 321); insert into variance_trigger values(B'0011', X'abc', X'9', 'cubrid', 987); insert into variance_trigger values(B'0011', X'abc', X'10', 'mysql', 555); insert into variance_trigger values(B'0011', X'cde', X'11', 'mysql', 666); insert into variance_trigger values(B'1010', X'abc', X'12', 'mysql', 777); insert into variance_trigger values(B'1111', X'abc', X'13', 'mysql', 999); insert into variance_trigger values(B'1111', x'bcd', X'14', 'mysql', 123); insert into variance_trigger values(B'1111', X'abc', X'15', 'mysql', 555); insert into variance_trigger values(B'1111', X'abc', X'16', 'mysql', 444); insert into variance_trigger values(B'1111', X'cde', X'17', 'mysql', 888); insert into variance_trigger values(B'1111', X'abc', X'18', 'mysql', 923); insert into variance_trigger values(B'1111', X'abc', X'19', 'mysql', 234); --TEST: OVER() clause --TEST: bit(n) select col1, col2, variance(col5) over() from variance_trigger order by 1, 2; --TEST: bit varying, with alias+all select col2, blob_to_bit(col3), variance(all col5) over() variance from variance_trigger order by 1, blob_to_bit(col3); --TEST: blob, with where clause select blob_to_bit(col3), clob_to_char(col4), variance(col5) over() variance from variance_trigger where col1 > B'1011' order by blob_to_bit(col3), clob_to_char(col4); --TEST: clob, distinct select clob_to_char(col4), col1, variance(distinct col5) over() variance from variance_trigger order by clob_to_char(col4), 2; --TEST: syntax error select col1, blob_to_bit(col3), clob_to_char(distinct col5), variance(*) over variance from variance_trigger; select col1, blob_to_bit(col3), col2, variance(col5) over(1) variance from variance_trigger; --TEST: trigger action table select id, str, variance(id) over() variance from variance_action order by id; --TEST: OVER(PARTITION BY) clause --TEST: partition by bit(n) select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(unique col5) over(partition by col1) variance from variance_trigger order by 1, 2, blob_to_bit(col3), clob_to_char(col4); --TEST: partition by bit varying select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(distinct col5) over(partition by col2) variance from variance_trigger order by 2, 1, blob_to_bit(col3), clob_to_char(col4); --TEST: partition by blob select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(distinctrow col5) over(partition by 3) variance from variance_trigger order by blob_to_bit(col3), 1, 2, clob_to_char(col4); --TEST: partition by clob select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(all col5) over(partition by 4) variance from variance_trigger order by clob_to_char(col4), 1, 2, blob_to_bit(col3), 5; --TEST: trigger action table, partition by int select id, str, variance(id) over(partition by id) variance from variance_action order by id; --TEST: trigger action table, partition by string select id, str, variance(id) over(partition by str) variance from variance_action order by 1; --TEST: OVER(ORDER BY) clause --TEST: order by 1 column name select col1, variance(col5) over(order by col1) variance from variance_trigger order by 1; --TEST: order by 2 column names select col2, blob_to_bit(col3), variance(all col5) over(order by col2, blob_to_bit(col3) asc) variance from variance_trigger order by 1; --TEST: order by more than 2 column names select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(unique col5) over(order by col1, col2 desc, blob_to_bit(col3), clob_to_char(col4) asc) variance from variance_trigger order by 1; --TEST: order by columns not selected select blob_to_bit(col3), variance(distinct col5) over(order by clob_to_char(col4) desc, col2, col1 asc) variance from variance_trigger order by 1; --TEST: order by 1 position select clob_to_char(col4), variance(all col5) over(order by 1) variance from variance_trigger order by 1; --TEST: order by 3 positions select blob_to_bit(col3), col2, variance(col5) over(order by blob_to_bit(col3), 2 desc, 3 asc) variance from variance_trigger order by 1; --TEST: order by more than 3 positions select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(col5) over(order by blob_to_bit(col3), 2 asc, 1 desc, clob_to_char(col4)) variance from variance_trigger order by 1; --TEST: order by positions not existed select col2, variance(distinct col5) over(order by 2) variance from variance_trigger order by 1; select col1, variance(all col5) over(order by 3, 4, 1 desc) variance, col2, clob_to_char(col4) from variance_trigger order by 1; select blob_to_bit(col3), clob_to_char(col4), variance(col5) over(order by 5) variance from variance_trigger; select blob_to_bit(col3), col1, variance(col5) over(order by 100) variance from variance_trigger; --TEST: order by column names and positions select col1, col2, blob_to_bit(col3), clob_to_char(col4), variance(col5) over(order by 1, col2 desc, 3, clob_to_char(col4) asc) variance from variance_trigger order by 1; --TEST: trigger action table select id, str, variance(id) over(order by id) variance from variance_action order by 1; --TEST: OVER(PARTITION BY ORDER BY) clause --TEST: partition by bit(n) select col1, col2, blob_to_bit(col3), variance(distinct col5) over(partition by col1 order by 1, 2, blob_to_bit(col3)) from variance_trigger; --TEST: partition by bit varying select col2, clob_to_char(col4), col1, variance(col5) over(partition by col2 order by col2, clob_to_char(col4), col1 desc) from variance_trigger; --TEST: partition by blob select blob_to_bit(col3), variance(all col5) over(partition by 1 order by blob_to_bit(col3), clob_to_char(col4), 3) variance, col2 from variance_trigger; --TEST: partition by clob select clob_to_char(col4), col1, variance(unique col5) over(partition by 1 order by clob_to_char(col4), 2 desc) variance from variance_trigger; --TEST: syntax error select col1, col2, variance(distinct col5) over(order by col1, col2 partition by col2) from variance_trigger; --TEST: trigger action table, partition by int select str, variance(id) over(partition by id order by id), id from variance_action order by 3; --TEST: trigger action table, partition by str select id, str, variance(id) over(partition by str order by id) from variance_action order by id; delete from variance_trigger; drop trigger aft_ins; drop table variance_trigger, variance_action;
/* SQLyog Community v13.1.5 (64 bit) MySQL - 10.1.38-MariaDB : Database - absensi ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!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 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`absensi` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `absensi`; /*Table structure for table `absen` */ DROP TABLE IF EXISTS `absen`; CREATE TABLE `absen` ( `no` int(20) NOT NULL AUTO_INCREMENT, `nim` varchar(10) DEFAULT NULL, `nama_lengkap` varchar(50) DEFAULT NULL, `prodi` varchar(30) DEFAULT NULL, `tanggal` date DEFAULT NULL, `matkul` varchar(30) DEFAULT NULL, `keterangan` varchar(100) DEFAULT NULL, PRIMARY KEY (`no`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*Data for the table `absen` */ insert into `absen`(`no`,`nim`,`nama_lengkap`,`prodi`,`tanggal`,`matkul`,`keterangan`) values (1,'1931733076','Alisia Firda S','Manajemen Informatika','2021-02-05','B.Indonesia','Hadir'); /*Table structure for table `admin` */ DROP TABLE IF EXISTS `admin`; CREATE TABLE `admin` ( `id_user` int(20) NOT NULL AUTO_INCREMENT, `nama_admin` varchar(50) DEFAULT NULL, `ttl` varchar(30) DEFAULT NULL, `jenis_kelamin` varchar(12) DEFAULT NULL, `alamat_lengkap` longtext, `agama` varchar(12) DEFAULT NULL, PRIMARY KEY (`id_user`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*Data for the table `admin` */ insert into `admin`(`id_user`,`nama_admin`,`ttl`,`jenis_kelamin`,`alamat_lengkap`,`agama`) values (1,'Maudy ','Kediri, 24 Februari 1991','Perempuan','Pare','Islam'); /*Table structure for table `dosen` */ DROP TABLE IF EXISTS `dosen`; CREATE TABLE `dosen` ( `nidn` varchar(20) NOT NULL, `nama_dosen` varchar(50) DEFAULT NULL, `matkul` varchar(30) DEFAULT NULL, `ttl` varchar(30) DEFAULT NULL, `jenis_kelamin` varchar(12) DEFAULT NULL, `alamat_lengkap` longtext, `agama` varchar(12) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`nidn`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `dosen` */ insert into `dosen`(`nidn`,`nama_dosen`,`matkul`,`ttl`,`jenis_kelamin`,`alamat_lengkap`,`agama`,`updated_at`,`created_at`) values ('1','Aqila coba edit','1 edit','1 ed','1 eee','1','Islam','2021-06-08 00:00:00',NULL), ('22222','nanaaa','n','n','n','n','n','2021-05-08 00:00:00','2021-05-05 05:19:38'), ('5432112345','Rahman','B.Inggris','Surabaya, 27 April 1993','Perempuan','KEDIRI','Islam',NULL,NULL), ('65645','Rahman','gfgdf','gfdg','gfdg','gfgdf','gdfg',NULL,NULL), ('987654321','Aqila','B.Inggris','Surabaya, 27 April 1993','Perempuan','Kunjang','Islam',NULL,NULL), ('98765432100','Bella','Desain Antarmuka','Lamongan, 20 Agustus 1991','Perempuan','kediri','Islam',NULL,NULL), ('9898989898','q','q','q','q','q','q','2021-05-08 12:43:48','2021-05-08 12:43:48'), ('999','<NAME>','Desain Antarmuka','Surabaya, 27 April 1993','a','a','a','2021-04-05 00:00:00',NULL); /*Table structure for table `jadwal` */ DROP TABLE IF EXISTS `jadwal`; CREATE TABLE `jadwal` ( `id_jadwal` int(11) NOT NULL AUTO_INCREMENT, `id_semester` int(11) NOT NULL, `id_kelas` int(11) NOT NULL, `kode_matkul` varchar(11) NOT NULL, `hari` varchar(10) NOT NULL, `jam_mulai` varchar(25) NOT NULL, `jam_selesai` time NOT NULL, PRIMARY KEY (`id_jadwal`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*Data for the table `jadwal` */ insert into `jadwal`(`id_jadwal`,`id_semester`,`id_kelas`,`kode_matkul`,`hari`,`jam_mulai`,`jam_selesai`) values (1,1,1,'MK001','senin','09:00:00','09:05:00'); /*Table structure for table `kelas` */ DROP TABLE IF EXISTS `kelas`; CREATE TABLE `kelas` ( `id_kelas` int(11) NOT NULL AUTO_INCREMENT, `nama_kelas` varchar(15) NOT NULL, `id_semester` int(11) DEFAULT NULL, PRIMARY KEY (`id_kelas`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; /*Data for the table `kelas` */ insert into `kelas`(`id_kelas`,`nama_kelas`,`id_semester`) values (1,'A',1), (2,'B',1), (3,'C',1), (4,'D',1), (5,'E',1), (6,'A',2), (7,'B',2), (8,'C',2); /*Table structure for table `mahasiswa` */ DROP TABLE IF EXISTS `mahasiswa`; CREATE TABLE `mahasiswa` ( `id` int(20) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `id_kelas` int(11) NOT NULL, `id_semester` int(11) NOT NULL, `nim` varchar(10) DEFAULT NULL, `nama_mhs` varchar(50) DEFAULT NULL, `prodi` varchar(30) DEFAULT NULL, `semester` varchar(2) DEFAULT NULL, `ttl` varchar(30) DEFAULT NULL, `jenis_kelamin` varchar(12) DEFAULT NULL, `alamat_lengkap` longtext, `agama` varchar(12) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; /*Data for the table `mahasiswa` */ insert into `mahasiswa`(`id`,`user_id`,`id_kelas`,`id_semester`,`nim`,`nama_mhs`,`prodi`,`semester`,`ttl`,`jenis_kelamin`,`alamat_lengkap`,`agama`,`updated_at`,`created_at`) values (2,2,0,0,'1931733087','<NAME>','Manajemen Informatika','7','Kediri, 03 Januari 2000','Perempuan','Bujel, Kota Kediri','Islam','2021-04-05 00:00:00',NULL), (3,3,0,0,'1931733082','Virginia Abrinsa','Manajemen Informatika','5','Kediri, 23 September 1999','Perempuan','Gurah, Kab. Kediri','Islam',NULL,NULL), (10,5,0,0,'1931733057','Yeni','MI','6','Kediri, 12','P','kediri','islam','2021-05-30 04:41:53','2021-05-30 04:41:53'); /*Table structure for table `matkul` */ DROP TABLE IF EXISTS `matkul`; CREATE TABLE `matkul` ( `kode_matkul` varchar(20) NOT NULL, `nama_matkul` varchar(50) DEFAULT NULL, `sks` varchar(20) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`kode_matkul`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `matkul` */ insert into `matkul`(`kode_matkul`,`nama_matkul`,`sks`,`updated_at`,`created_at`) values ('MK001','B.indonesia','4',NULL,NULL), ('MK002','B.Inggris','4',NULL,NULL), ('MK003','Kewarganegaraan','8',NULL,NULL), ('MK05','S','S','2021-04-04 12:06:36','2021-04-04 12:06:36'), ('MK06','AAA','A','2021-05-05 01:11:43','2021-05-05 01:11:43'); /*Table structure for table `migrations` */ DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `migrations` */ /*Table structure for table `pengumuman` */ DROP TABLE IF EXISTS `pengumuman`; CREATE TABLE `pengumuman` ( `id` int(20) NOT NULL AUTO_INCREMENT, `judul` varchar(50) DEFAULT NULL, `pengumuman` longtext, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=latin1; /*Data for the table `pengumuman` */ insert into `pengumuman`(`id`,`judul`,`pengumuman`,`updated_at`,`created_at`) values (1,'Mata Kuliah diundur','mata kuliah B.Inggris sementara diundur',NULL,NULL), (2,'Pengumuman','Bahasa Inggris pertemuan ke-4 akan di adakan Quiz',NULL,NULL), (111,'berita baru akuuu','edittt','2021-05-21 00:00:00','2021-05-08 13:02:31'); /*Table structure for table `semester` */ DROP TABLE IF EXISTS `semester`; CREATE TABLE `semester` ( `id_semester` int(11) NOT NULL AUTO_INCREMENT, `semester` varchar(15) NOT NULL, PRIMARY KEY (`id_semester`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; /*Data for the table `semester` */ insert into `semester`(`id_semester`,`semester`) values (1,'Ganjil'), (2,'Genap'); /*Table structure for table `users` */ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `level` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `username` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `mahasiswa_id` int(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*Data for the table `users` */ insert into `users`(`id`,`level`,`name`,`username`,`email`,`email_verified_at`,`password`,`remember_token`,`created_at`,`updated_at`,`mahasiswa_id`) values (3,'mahasiswa','a','<PASSWORD>','<EMAIL>',NULL,'$2y$10$QJT/b4WE1By83WMK6iEm8ONHRfdNw10fk4AolWcEWPaReIGzsM46u','B4dElkFQ3vzyfUyD2CXY8p3M1cW6piHd1KpLq9UtO4OP9FZkPX3wtU1ccQNO','2021-05-23 07:43:38','2021-05-23 07:43:38',NULL), (5,'mahasiswa','w','','<EMAIL>',NULL,'$2y$10$EU5YOJUkjlA.jmsQezzIleGLP9vWMrCB6xk.2xKAEAK/I1phdzbrO','YJQnaiJQMQtvY7nKnCwu4aEka1e8ZphJY2cua13VA2FDmw4XnWyxADP1wjh6','2021-05-23 07:57:53','2021-05-23 07:57:53',NULL), (6,'mahasiswa','Yeni','1931733057',NULL,NULL,'$2y$10$elzKAdFRSCUm89tBH2b9SeibOftHkMJwYYqGW9x00QxEY5fEstK7u',NULL,'2021-05-30 04:43:28','2021-05-30 04:43:28',NULL), (7,'mahasiswa',NULL,'12',NULL,NULL,'$2y$10$B8KjvGymjJl8kWiTmvwKle0astcwSs1BBjvLJi5uSYdiQrHIs3zn6',NULL,'2021-05-30 05:24:55','2021-05-30 05:24:55',NULL), (8,'mahasiswa',NULL,'13',NULL,NULL,'$2y$10$fyq9uobE4jr7fhwZlL4jhO1rXDAE87VrptGVdArb5sGdN8hn6giAi',NULL,'2021-05-30 05:25:46','2021-05-30 05:25:46',NULL), (10,'admin','firda safira','safira','<EMAIL>',NULL,'$2y$10$Uyqj1Cvl87KYvWB3cjJGD.uyZkAtBCa1pyuaQyqFa.Aqy2EM6rgJu',NULL,'2021-06-05 06:39:10','2021-06-07 00:00:00',NULL), (11,'admin','admin firda','adminp','<EMAIL>',NULL,'$2y$10$4GjGBTpT7n/JT9QFfcpv7e.O5hhB7aoaiAN9LXDAyZ4mwdJO4pN4O',NULL,'2021-06-05 06:51:33','2021-06-07 00:00:00',NULL), (13,'admin','firda','<EMAIL>day','<EMAIL>',NULL,'$2y$10$YqAOvVqKVD14YITjAzHMN.UWj5bfmzbaLYHGp4cTP8qTjYDQR6WyW',NULL,NULL,'2021-06-07 00:00:00',NULL); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;