sql
stringlengths
6
1.05M
<gh_stars>100-1000 -- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com -- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions. SET PAGESIZE 5000 LINESIZE 1000 TRIMSPOOL ON TRIMOUT ON TAB OFF DEF sqlset_name="GPN_MON18" VAR dbid NUMBER VAR inst_id NUMBER COL bdate NEW_VALUE def_bdate COL edate NEW_VALUE def_edate SET TERMOUT OFF SELECT TO_CHAR(SYSDATE-1/24, 'YYYY-MM-DD HH24:MI') bdate , TO_CHAR(SYSDATE , 'YYYY-MM-DD HH24:MI') edate FROM dual / SET TERMOUT ON ACCEPT sqlid CHAR FORMAT A13 DEFAULT '%' PROMPT "Enter SQL ID [ % ]: " SPOOL sql_activity_&sqlid..txt ACCEPT bdate DATE FORMAT 'YYYY-MM-DD HH24:MI' DEFAULT '&def_bdate' PROMPT "Enter begin time [&def_bdate]: " ACCEPT edate DATE FORMAT 'YYYY-MM-DD HH24:MI' DEFAULT '&def_edate' PROMPT "Enter end time [&def_edate]: " PROMPT Spooling into sql_activity_&sqlid..txt BEGIN SELECT inst_id, dbid INTO :inst_id, :dbid FROM gv$database; END; / SELECT TO_CHAR(sample_time, 'YYYY-MM-DD HH24')||':00' sample_hour , sql_id , sql_plan_hash_value , COUNT(*) * 10 seconds , ROUND(COUNT(*) * 10 / 3600, 2) AAS , COUNT(DISTINCT sql_exec_start||sql_exec_id) sampled_execs FROM dba_hist_active_sess_history WHERE dbid = :dbid -- AND instance_number = :inst_id AND sample_time BETWEEN TO_DATE('&bdate', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('&edate', 'YYYY-MM-DD HH24:MI:SS') AND sql_id LIKE '&sqlid' GROUP BY TO_CHAR(sample_time, 'YYYY-MM-DD HH24')||':00' , sql_id , sql_plan_hash_value ORDER BY sample_hour , sql_id / SET PAGESIZE 0 HEADING OFF PROMPT PROMPT ======================================================================================================= PROMPT =========================================== DISPLAY_SQLSET ============================================ PROMPT ======================================================================================================= PROMPT SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_SQLSET('&sqlset_name', '&sqlid', null, 'TYPICAL +ALIAS +MEMSTATS +NOTE')); PROMPT PROMPT ======================================================================================================= PROMPT ============================================= DISPLAY_AWR ============================================= PROMPT ======================================================================================================= PROMPT SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_AWR('&sqlid', null, null, 'ALL')) / PROMPT PROMPT ======================================================================================================= PROMPT =============================== ASH Report for SQL ID &sqlid =================================== PROMPT ======================================================================================================= PROMPT SET VERIFY ON -- Oracle 10.2 requires the :inst_id to be present (and not NULL) SELECT * FROM TABLE(DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:dbid, :inst_id, TO_DATE('&bdate', 'YYYY-MM-DD HH24:MI'), TO_DATE('&edate', 'YYYY-MM-DD HH24:MI'), null, null, null, DECODE('&sqlid', '%', NULL, '&sqlid'))) WHERE exists (SELECT version FROM v$instance WHERE version LIKE '10%') UNION ALL SELECT * FROM TABLE(DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:dbid, NULL, TO_DATE('&bdate', 'YYYY-MM-DD HH24:MI'), TO_DATE('&edate', 'YYYY-MM-DD HH24:MI'), null, null, null, DECODE('&sqlid', '%', NULL, '&sqlid'))) WHERE exists (SELECT version FROM v$instance WHERE version LIKE '11%') / SET VERIFY OFF SPOOL OFF SET TERMOUT ON PAGESIZE 5000 HEADING ON PROMPT Done. Output file: sql_activity_&sqlid..txt
<filename>migrate/migrations/20180821150330-deferable-status-cm.sql -- +migrate Up ALTER TABLE users ALTER CONSTRAINT users_alert_status_log_contact_method_id_fkey DEFERRABLE; -- +migrate Down ALTER TABLE users ALTER CONSTRAINT users_alert_status_log_contact_method_id_fkey NOT DEFERRABLE;
<reponame>iamhuwjones/hermes CREATE TABLE sfrm_message_segment ( message_id varchar(200) NOT NULL, message_box varchar(200) NOT NULL, segment_no int NOT NULL, segment_type varchar(200) NOT NULL, segment_start bigint, segment_end bigint, retried int DEFAULT -1, md5_value varchar(200), status varchar(200), created_timestamp timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, proceed_timestamp timestamp, completed_timestamp timestamp, PRIMARY KEY (message_id, message_box, segment_no, segment_type) );
CREATE TABLE info_vars ( info_var_id INTEGER NOT NULL CONSTRAINT info_vars_pk PRIMARY KEY ASC AUTOINCREMENT, patch_version_id INTEGER NOT NULL CONSTRAINT info_vars_patch_versions REFERENCES patch_versions ON DELETE CASCADE, var_name TEXT NOT NULL, var_value TEXT NOT NULL, time_stamp TEXT DEFAULT CURRENT_TIMESTAMP NOT NULL ); CREATE INDEX info_vars_patch_versions ON info_vars(patch_version_id);
<reponame>XanaduNWH/dlxx -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.3 -- Dumped by pg_dump version 9.6.3 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; -- -- Name: adminpack; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS adminpack WITH SCHEMA pg_catalog; -- -- Name: EXTENSION adminpack; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION adminpack IS 'administrative functions for PostgreSQL'; -- -- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public; -- -- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: auth_assignment; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE auth_assignment ( item_name character varying(64) NOT NULL, user_id integer NOT NULL, created_at timestamp with time zone DEFAULT now() ); ALTER TABLE auth_assignment OWNER TO yii; -- -- Name: auth_item; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE auth_item ( name character varying(64) NOT NULL, type integer NOT NULL, description text, rule_name character varying(64), data text, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone ); ALTER TABLE auth_item OWNER TO yii; -- -- Name: auth_item_child; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE auth_item_child ( parent character varying(64) NOT NULL, child character varying(64) NOT NULL ); ALTER TABLE auth_item_child OWNER TO yii; -- -- Name: auth_rule; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE auth_rule ( name character varying(64) NOT NULL, data text, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone ); ALTER TABLE auth_rule OWNER TO yii; -- -- Name: comments; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE comments ( id integer NOT NULL, thread_id integer NOT NULL, author_id integer DEFAULT '-1'::integer NOT NULL, author_email character varying NOT NULL, author_ip character varying(50), created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone, approve_status integer, reply_to integer, content text NOT NULL ); ALTER TABLE comments OWNER TO yii; -- -- Name: COLUMN comments.author_email; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN comments.author_email IS '回复者邮箱'; -- -- Name: COLUMN comments.author_ip; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN comments.author_ip IS '回复者地址'; -- -- Name: COLUMN comments.created_at; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN comments.created_at IS '创建日期'; -- -- Name: COLUMN comments.updated_at; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN comments.updated_at IS '更新日期'; -- -- Name: COLUMN comments.approve_status; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN comments.approve_status IS '审核状态'; -- -- Name: COLUMN comments.content; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN comments.content IS '内容'; -- -- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: yii -- CREATE SEQUENCE comments_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE comments_id_seq OWNER TO yii; -- -- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: yii -- ALTER SEQUENCE comments_id_seq OWNED BY comments.id; -- -- Name: country; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE country ( code character varying(2) NOT NULL, name character varying(25) NOT NULL, population integer DEFAULT 0 NOT NULL ); ALTER TABLE country OWNER TO yii; -- -- Name: message; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE message ( id integer NOT NULL, language character varying(16) NOT NULL, translation text ); ALTER TABLE message OWNER TO yii; -- -- Name: migration; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE migration ( version character varying(180) NOT NULL, apply_time integer ); ALTER TABLE migration OWNER TO yii; -- -- Name: source_message; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE source_message ( id integer NOT NULL, category character varying(255), message text ); ALTER TABLE source_message OWNER TO yii; -- -- Name: source_message_id_seq; Type: SEQUENCE; Schema: public; Owner: yii -- CREATE SEQUENCE source_message_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE source_message_id_seq OWNER TO yii; -- -- Name: source_message_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: yii -- ALTER SEQUENCE source_message_id_seq OWNED BY source_message.id; -- -- Name: thread; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE thread ( id integer NOT NULL, author_id integer, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone, status smallint, title character varying(64) NOT NULL, content text NOT NULL, comment_count integer, updated_by integer DEFAULT '-1'::integer, lastcomment_at timestamp with time zone ); ALTER TABLE thread OWNER TO yii; -- -- Name: COLUMN thread.author_id; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.author_id IS '创建人'; -- -- Name: COLUMN thread.created_at; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.created_at IS '创建时间'; -- -- Name: COLUMN thread.updated_at; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.updated_at IS '更新时间'; -- -- Name: COLUMN thread.status; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.status IS '状态'; -- -- Name: COLUMN thread.title; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.title IS '标题'; -- -- Name: COLUMN thread.content; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.content IS '内容'; -- -- Name: COLUMN thread.comment_count; Type: COMMENT; Schema: public; Owner: yii -- COMMENT ON COLUMN thread.comment_count IS '回复数'; -- -- Name: thread_id_seq; Type: SEQUENCE; Schema: public; Owner: yii -- CREATE SEQUENCE thread_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE thread_id_seq OWNER TO yii; -- -- Name: thread_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: yii -- ALTER SEQUENCE thread_id_seq OWNED BY thread.id; -- -- Name: user; Type: TABLE; Schema: public; Owner: yii -- CREATE TABLE "user" ( id integer NOT NULL, username character varying(255) NOT NULL, auth_key character varying(32) NOT NULL, password_hash character varying(255) NOT NULL, password_reset_token character varying(255), email character varying(255) NOT NULL, status smallint DEFAULT 10 NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone ); ALTER TABLE "user" OWNER TO yii; -- -- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: yii -- CREATE SEQUENCE user_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE user_id_seq OWNER TO yii; -- -- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: yii -- ALTER SEQUENCE user_id_seq OWNED BY "user".id; -- -- Name: comments id; Type: DEFAULT; Schema: public; Owner: yii -- ALTER TABLE ONLY comments ALTER COLUMN id SET DEFAULT nextval('comments_id_seq'::regclass); -- -- Name: source_message id; Type: DEFAULT; Schema: public; Owner: yii -- ALTER TABLE ONLY source_message ALTER COLUMN id SET DEFAULT nextval('source_message_id_seq'::regclass); -- -- Name: thread id; Type: DEFAULT; Schema: public; Owner: yii -- ALTER TABLE ONLY thread ALTER COLUMN id SET DEFAULT nextval('thread_id_seq'::regclass); -- -- Name: user id; Type: DEFAULT; Schema: public; Owner: yii -- ALTER TABLE ONLY "user" ALTER COLUMN id SET DEFAULT nextval('user_id_seq'::regclass); -- -- Data for Name: auth_assignment; Type: TABLE DATA; Schema: public; Owner: yii -- COPY auth_assignment (item_name, user_id, created_at) FROM stdin; author 2 2017-02-14 20:15:03.836536+08 admin 1 2017-02-14 20:15:03.839948+08 author 4 2017-02-14 20:15:23.195861+08 author 5 2017-02-14 20:17:23.043728+08 author 21 2017-02-16 15:08:13.675215+08 deletePost 1 2017-02-20 13:39:17.510091+08 moderator 2 2017-02-20 15:52:39.296352+08 \. -- -- Data for Name: auth_item; Type: TABLE DATA; Schema: public; Owner: yii -- COPY auth_item (name, type, description, rule_name, data, created_at, updated_at) FROM stdin; createPost 2 Create a post \N \N 2017-02-14 20:15:03.73877+08 \N updatePost 2 Update post \N \N 2017-02-14 20:15:03.791268+08 \N author 1 \N \N \N 2017-02-14 20:15:03.805263+08 \N admin 1 \N \N \N 2017-02-14 20:15:03.821128+08 \N updateOwnPost 2 Update own post isAuthor \N 2017-02-14 20:15:03.854037+08 \N deletePost 2 Delete post \N \N 2017-02-20 13:39:17.482718+08 \N deleteOwnPost 2 Delete own post \N \N 2017-02-20 13:39:17.484737+08 \N moderator 1 \N \N \N 2017-02-20 15:52:39.262589+08 \N \. -- -- Data for Name: auth_item_child; Type: TABLE DATA; Schema: public; Owner: yii -- COPY auth_item_child (parent, child) FROM stdin; author createPost admin updatePost admin author updateOwnPost updatePost author updateOwnPost admin deletePost deleteOwnPost deletePost moderator author moderator deletePost moderator updatePost \. -- -- Data for Name: auth_rule; Type: TABLE DATA; Schema: public; Owner: yii -- COPY auth_rule (name, data, created_at, updated_at) FROM stdin; isAuthor O:29:"common\\models\\rbac\\AuthorRule":3:{s:4:"name";s:8:"isAuthor";s:9:"createdAt";i:1487074503;s:9:"updatedAt";i:1487074503;} 2017-02-14 20:15:03.851706+08 \N \. -- -- Data for Name: comments; Type: TABLE DATA; Schema: public; Owner: yii -- COPY comments (id, thread_id, author_id, author_email, author_ip, created_at, updated_at, approve_status, reply_to, content) FROM stdin; 30 4 4 <EMAIL> 127.0.0.1 2017-02-24 10:42:33.785488+08 \N 10 \N <p><strong>回复</strong><em>测试</em></p>\r\n\r\n<p>You have successfully created your Yii-powered application.</p>\r\n 31 4 4 <EMAIL> 127.0.0.1 2017-02-24 11:03:20.027179+08 \N 10 \N <p><span class="marker">Test</span> me</p>\r\n 32 4 4 <EMAIL> 127.0.0.1 2017-02-24 11:19:40.003696+08 \N 10 \N <h1>Reply to this thread</h1>\r\n 33 2 2 回复测试 127.0.0.1 2017-02-27 12:20:36.380096+08 \N 10 \N <p>回复</p>\r\n 34 9 2 <EMAIL> 127.0.0.1 2017-02-27 12:21:07.093236+08 \N 10 \N <p>再回复一个</p>\r\n 35 4 2 <EMAIL> 127.0.0.1 2017-02-27 14:53:44.043384+08 \N 10 \N <p>无内容</p>\r\n 36 9 2 <EMAIL> 127.0.0.1 2017-02-27 15:23:29.524269+08 \N 10 \N <p>回复</p>\r\n 37 9 2 <EMAIL> 127.0.0.1 2017-02-27 16:52:54.66626+08 \N 10 \N <p>回复测试</p>\r\n 38 11 2 <EMAIL> 127.0.0.1 2017-02-27 16:59:28.833432+08 \N 10 \N <p>测试</p>\r\n 39 11 2 <EMAIL> 127.0.0.1 2017-02-27 17:07:05.96339+08 \N 10 \N <p>测试</p>\r\n 40 8 2 <EMAIL> 127.0.0.1 2017-02-27 17:40:32.409906+08 \N 10 \N <p>默认邮件测试</p>\r\n 41 4 2 <EMAIL> 127.0.0.1 2017-02-27 18:19:49.040362+08 \N 10 \N <p>回复测试</p>\r\n 42 11 2 <EMAIL> 127.0.0.1 2017-02-27 18:23:25.630989+08 \N 10 \N <p>回复</p>\r\n 43 11 2 <EMAIL> 127.0.0.1 2017-02-27 18:26:05.580863+08 \N 10 \N <p>About</p>\r\n 44 4 2 <EMAIL> 127.0.0.1 2017-03-01 10:50:06.450813+08 \N 10 \N <p>多回复几个</p>\r\n 45 4 2 <EMAIL> 127.0.0.1 2017-03-01 10:50:29.926387+08 \N 10 \N <p>测试</p>\r\n 46 4 2 <EMAIL> 127.0.0.1 2017-03-01 11:46:13.972353+08 \N 10 \N <p><span class="marker">Reply</span></p>\r\n 47 4 4 <EMAIL> 127.0.0.1 2017-03-02 10:43:30.834312+08 \N 10 \N <p>提示信息测试</p>\r\n 48 4 4 <EMAIL> 127.0.0.1 2017-03-02 13:56:39.351501+08 \N 10 \N <p>回复测试</p>\r\n \. -- -- Name: comments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: yii -- SELECT pg_catalog.setval('comments_id_seq', 49, true); -- -- Data for Name: country; Type: TABLE DATA; Schema: public; Owner: yii -- COPY country (code, name, population) FROM stdin; AU Australia 24016400 BR Brazil 205722000 CA Canada 35985751 DE Germany 81459000 FR France 64513242 GB United Kingdom 65097000 IN India 1285400000 RU Russia 146519759 US United States 322976000 CN 中国 1375210000 JP 日本 111 XX Test Country 100000 X1 Test country2 100000 X2 API Updated Country 200000 AX 接口创建 123456 \. -- -- Data for Name: message; Type: TABLE DATA; Schema: public; Owner: yii -- COPY message (id, language, translation) FROM stdin; 3 zh_CN \N 4 zh_CN \N 5 zh_CN \N 6 zh_CN \N 7 zh_CN \N 8 zh_CN \N 9 zh_CN \N 10 zh_CN \N 11 zh_CN \N 12 zh_CN \N 13 zh_CN \N 14 zh_CN \N 15 zh_CN \N 16 zh_CN \N 17 zh_CN \N 18 zh_CN \N 19 zh_CN \N 20 zh_CN \N 21 zh_CN \N 22 zh_CN \N 23 zh_CN \N 24 zh_CN \N 25 zh_CN \N 26 zh_CN \N 27 zh_CN \N 28 zh_CN \N 29 zh_CN \N 30 zh_CN \N 31 zh_CN \N 32 zh_CN \N 33 zh_CN \N 34 zh_CN \N 35 zh_CN \N 36 zh_CN \N 37 zh_CN \N 38 zh_CN \N 39 zh_CN \N 40 zh_CN \N 41 zh_CN \N 42 zh_CN \N 43 zh_CN \N 44 zh_CN \N 45 zh_CN \N 46 zh_CN \N 47 zh_CN \N 48 zh_CN \N 49 zh_CN \N 50 zh_CN \N 51 zh_CN \N 52 zh_CN \N 53 zh_CN \N 54 zh_CN \N 55 zh_CN \N 56 zh_CN \N 57 zh_CN \N 58 zh_CN \N 59 zh_CN \N 60 zh_CN \N 61 zh_CN \N 62 zh_CN \N 63 zh_CN \N 64 zh_CN \N 65 zh_CN \N 66 zh_CN \N 67 zh_CN \N 68 zh_CN \N 69 zh_CN \N 70 zh_CN \N 71 zh_CN \N 72 zh_CN \N 73 zh_CN \N 74 zh_CN \N 75 zh_CN \N 76 zh_CN \N 77 zh_CN \N 78 zh_CN \N 79 zh_CN \N 80 zh_CN \N 81 zh_CN \N 82 zh_CN \N 83 zh_CN \N 84 zh_CN \N 85 zh_CN \N 86 zh_CN \N 87 zh_CN \N 88 zh_CN \N 89 zh_CN \N 90 zh_CN \N 91 zh_CN \N 92 zh_CN \N 93 zh_CN \N 94 zh_CN \N 95 zh_CN \N 96 zh_CN \N 97 zh_CN \N 98 zh_CN \N 99 zh_CN \N 100 zh_CN \N 101 zh_CN \N 102 zh_CN \N 103 zh_CN \N 104 zh_CN \N 105 zh_CN \N 106 zh_CN \N 107 zh_CN \N 108 zh_CN \N 109 zh_CN \N 110 zh_CN \N 111 zh_CN \N 112 zh_CN \N \. -- -- Data for Name: migration; Type: TABLE DATA; Schema: public; Owner: yii -- COPY migration (version, apply_time) FROM stdin; m000000_000000_base 1470884390 m130524_201442_init 1470884394 m140506_102106_rbac_init 1486626315 m170217_073424_addrule 1487559952 m170217_073424_delete_permission 1487569157 m170220_032303_moderator_role 1487577159 m150207_210500_i18n_init 1488527183 \. -- -- Data for Name: source_message; Type: TABLE DATA; Schema: public; Owner: yii -- COPY source_message (id, category, message) FROM stdin; 3 yii {attribute} is invalid. 4 yii The file "{file}" is not an image. 5 yii The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}. 6 yii The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}. 7 yii The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}. 8 yii The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}. 9 yii {attribute} must be equal to "{compareValueOrAttribute}". 10 yii {attribute} must not be equal to "{compareValueOrAttribute}". 11 yii {attribute} must be greater than "{compareValueOrAttribute}". 12 yii {attribute} must be greater than or equal to "{compareValueOrAttribute}". 13 yii {attribute} must be less than "{compareValueOrAttribute}". 14 yii {attribute} must be less than or equal to "{compareValueOrAttribute}". 15 yii {attribute} is not a valid email address. 16 yii {attribute} is not a valid URL. 17 yii {attribute} must be a string. 18 yii {attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}. 19 yii {attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}. 20 yii {attribute} should contain {length, number} {length, plural, one{character} other{characters}}. 21 yii {attribute} must be a valid IP address. 22 yii {attribute} must not be an IPv6 address. 23 yii {attribute} must not be an IPv4 address. 24 yii {attribute} contains wrong subnet mask. 25 yii {attribute} must be an IP address with specified subnet. 26 yii {attribute} must not be a subnet. 27 yii {attribute} is not in the allowed range. 28 yii {attribute} must be an integer. 29 yii {attribute} must be a number. 30 yii {attribute} must be no less than {min}. 31 yii {attribute} must be no greater than {max}. 32 yii {attribute} must be either "{true}" or "{false}". 33 yii The combination {values} of {attributes} has already been taken. 34 yii {attribute} "{value}" has already been taken. 35 yii The format of {attribute} is invalid. 36 yii File upload failed. 37 yii Please upload a file. 38 yii You can upload at most {limit, number} {limit, plural, one{file} other{files}}. 39 yii Only files with these extensions are allowed: {extensions}. 40 yii The file "{file}" is too big. Its size cannot exceed {formattedLimit}. 41 yii The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}. 42 yii Only files with these MIME types are allowed: {mimeTypes}. 43 yii the input value 44 yii {attribute} cannot be blank. 45 yii {attribute} must be "{requiredValue}". 46 yii Unknown alias: -{name} 47 yii Unknown option: --{name} 48 yii Missing required arguments: {params} 49 yii The verification code is incorrect. 50 yii Home 51 yii No results found. 52 yii Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}. 53 yii Total <b>{count, number}</b> {count, plural, one{item} other{items}}. 54 yii An internal server error occurred. 55 yii Login Required 56 yii Page not found. 57 yii Invalid data received for parameter "{param}". 58 yii Missing required parameters: {params} 59 yii Unable to verify your data submission. 60 yii Error 61 yii The requested view "{name}" was not found. 62 yii You are not allowed to perform this action. 63 yii and 64 yii Please fix the following errors: 65 yii Are you sure you want to delete this item? 66 yii View 67 yii Update 68 yii Delete 69 yii No 70 yii Yes 71 yii (not set) 72 yii in {delta, plural, =1{a year} other{# years}} 73 yii in {delta, plural, =1{a month} other{# months}} 74 yii in {delta, plural, =1{a day} other{# days}} 75 yii in {delta, plural, =1{an hour} other{# hours}} 76 yii in {delta, plural, =1{a minute} other{# minutes}} 77 yii just now 78 yii in {delta, plural, =1{a second} other{# seconds}} 79 yii {delta, plural, =1{a year} other{# years}} ago 80 yii {delta, plural, =1{a month} other{# months}} ago 81 yii {delta, plural, =1{a day} other{# days}} ago 82 yii {delta, plural, =1{an hour} other{# hours}} ago 83 yii {delta, plural, =1{a minute} other{# minutes}} ago 84 yii {delta, plural, =1{a second} other{# seconds}} ago 85 yii {delta, plural, =1{1 year} other{# years}} 86 yii {delta, plural, =1{1 month} other{# months}} 87 yii {delta, plural, =1{1 day} other{# days}} 88 yii {delta, plural, =1{1 hour} other{# hours}} 89 yii {delta, plural, =1{1 minute} other{# minutes}} 90 yii {delta, plural, =1{1 second} other{# seconds}} 91 yii {nFormatted} B 92 yii {nFormatted} KiB 93 yii {nFormatted} MiB 94 yii {nFormatted} GiB 95 yii {nFormatted} TiB 96 yii {nFormatted} PiB 97 yii {nFormatted} KB 98 yii {nFormatted} MB 99 yii {nFormatted} GB 100 yii {nFormatted} TB 101 yii {nFormatted} PB 102 yii {nFormatted} {n, plural, =1{byte} other{bytes}} 103 yii {nFormatted} {n, plural, =1{kibibyte} other{kibibytes}} 104 yii {nFormatted} {n, plural, =1{mebibyte} other{mebibytes}} 105 yii {nFormatted} {n, plural, =1{gibibyte} other{gibibytes}} 106 yii {nFormatted} {n, plural, =1{tebibyte} other{tebibytes}} 107 yii {nFormatted} {n, plural, =1{pebibyte} other{pebibytes}} 108 yii {nFormatted} {n, plural, =1{kilobyte} other{kilobytes}} 109 yii {nFormatted} {n, plural, =1{megabyte} other{megabytes}} 110 yii {nFormatted} {n, plural, =1{gigabyte} other{gigabytes}} 111 yii {nFormatted} {n, plural, =1{terabyte} other{terabytes}} 112 yii {nFormatted} {n, plural, =1{petabyte} other{petabytes}} \. -- -- Name: source_message_id_seq; Type: SEQUENCE SET; Schema: public; Owner: yii -- SELECT pg_catalog.setval('source_message_id_seq', 112, true); -- -- Data for Name: thread; Type: TABLE DATA; Schema: public; Owner: yii -- COPY thread (id, author_id, created_at, updated_at, status, title, content, comment_count, updated_by, lastcomment_at) FROM stdin; 3 5 2017-02-14 20:19:08.832269+08 \N 10 Created By author2 No text \N \N \N 5 4 2017-02-24 14:41:24.792007+08 \N 10 Heading <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>\r\n \N \N \N 7 2 2017-02-27 10:27:15.558283+08 \N 10 测试一下 <p>测试文本</p>\r\n \N -1 \N 2 4 2017-02-14 15:22:58.320639+08 2017-02-27 12:20:36.393332+08 10 test1 abcdef 1 2 2017-02-27 12:20:36.393332+08 9 2 2017-02-27 10:51:46.393706+08 2017-02-27 16:52:54.67423+08 10 默认值测试 <p>beforesave</p>\r\n\r\n<p>再更新一下</p>\r\n 3 2 2017-02-27 16:52:54.67423+08 10 2 2017-02-27 11:01:57.875334+08 2017-02-27 17:26:42.926935+08 10 新建测试 <p>无内容</p>\r\n\r\n<p><strong>更新一下</strong></p>\r\n \N 2 2017-02-27 17:26:42.926935+08 8 2 2017-02-27 10:29:33.754512+08 \N 10 测试 <p>一下</p>\r\n 1 2 2017-02-27 17:40:32.414722+08 11 2 2017-02-27 11:03:07.976804+08 2017-02-27 18:25:08.068643+08 10 再新建一个 <p>测试更新1</p>\r\n 3 2 2017-02-27 18:26:05.588476+08 4 4 2017-02-21 10:18:38.979238+08 \N 10 CKEdtor test <p><strong>Bold</strong> font</p>\r\n\r\n<p><strong><em>中文</em></strong>测试</p>\r\n\r\n<p><a href="https://blog.xanadunwh.com" target="_blank">中暑山庄</a></p>\r\n 10 4 2017-03-02 13:56:39.371116+08 12 4 2017-03-02 15:41:16.075433+08 \N 10 自定义验证器 <p>测试</p>\r\n \N \N \N 15 2 2017-03-07 15:47:01.307942+08 \N 10 testdate <p>testload</p>\r\n \N \N \N \. -- -- Name: thread_id_seq; Type: SEQUENCE SET; Schema: public; Owner: yii -- SELECT pg_catalog.setval('thread_id_seq', 15, true); -- -- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: yii -- COPY "user" (id, username, auth_key, password_hash, password_reset_token, email, status, created_at, updated_at) FROM stdin; 9 author5 LrnhWGDMNOObWn4LHM0ijDIm-T6H7jp2 $2y$13$/94JmLy6om4I.1.NOWcNAOd10hhGbAiDhFmmRuVcpj0RMpY.smR7a \N <EMAIL> 10 2017-02-13 19:32:16.94175+08 2017-02-13 19:32:16.94175+08 10 author6 O_2rxUvTVaJwR5eRhwqRzxfLmssB8Jg4 $2y$13$2lz4CYfOGqyyaZyRx2vZ9eNp0PnIDK3lcOqD8SCpmbBkthAYD009i \N <EMAIL> 10 2017-02-13 21:05:41.375875+08 2017-02-13 21:05:41.375875+08 11 author7 aUDms4IX8w6AWjhh3M9I_50Pn7FP3bJ8 $2y$13$XkSSnKf6NYHiH1mkXHVHLe/Kkn6P3f6oGleZXBjABsBN0LOHEDlSm \N <EMAIL> 10 2017-02-13 21:06:47.111871+08 2017-02-13 21:06:47.111871+08 12 author8 aHG7pvRznbKkZt0ZqmjI6_ij4YFYGVv0 $2y$13$op8nXhpNP1iB5uvpgsp9CueEmsrPq3tl679qM4Dx4fmQfW9q1Q3z2 \N <EMAIL> 10 2017-02-13 21:20:58.201435+08 2017-02-13 21:20:58.201435+08 13 author9 BP2PCzYwFzkZGZfhHaP81wsAB-DigQuX $2y$13$sl1TC1ILPISIcg0UJXPO8uAo3XDIldxX8FRzpiU85U69OOw19.WXm \N <EMAIL> 10 2017-02-13 21:47:59.329439+08 2017-02-13 21:47:59.329439+08 14 author10 FkpaXWAUYL1DwSLHEG-_nDL5T_QzaSRj $2y$13$VGP4/eChxueVRrLpfPDwJOFtEMslQ3LJYMMS3zRfUnZsuTPltMr3u \N <EMAIL> 10 2017-02-14 10:19:24.081345+08 2017-02-14 10:19:24.081345+08 3 testuser2 pnF63pngYaRh_1gp8C22cTPiTf7H4Qv6 $2y$13$yLr0pCYOjDd751od2ZT1ZeNcLxtOht5m/pfb1cDQJ0j9Zj4Acz3.6 \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N 4 author1 8mqkSye4rKFDA-Qmc8Nuevak5OczDpI5 $2y$13$oHtBuqxRcgKPgF4bkInRBeVitEPaTYb8LIQ3vtl/wHL2GZTsJQ.u. \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N 5 author2 IJMRf-y8Ne4NXRoS-C_8uFg0W00tLPQc $2y$13$3aT1rsVvOgtowvSYNFbVru8SikRYidfMM8.l9BCDIKOypjykU39ym \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N 6 author3 y0fLXZgzXO_D09th_9ZypKGzhGt_CuTu $2y$13$C8m/ZC//c4797fEh7KBI5OrI8grYZeRAVXY4IeQuYhOq3dxtjxuSC \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N 7 author4 GbJoLcOcvM7vQ8Gb0jUICjzERYaJrjBm $2y$13$2BuRW5qtUOCwXZOYk0l7tuVi3qqk8ex/ZmCw65hAkSPGJUUu3MtAS \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N 21 author11 Bc_TDBFF2EIaNBF8qTMQ9bM0ZB7u2APk $2y$13$lWQThbK/FvLdatXAJMco9ON.nnJIaIt71yx5.W9XYilMIvj00FEsq \N <EMAIL> 10 2017-02-16 15:08:13.636209+08 2017-02-16 15:08:13.636209+08 -1 deleted aMsnbYlRJzrJ1amqjf8i_GZk7f22wGpP $2y$13$GxNKCNs8iIKRa3lwLKTVZubqkbVxo0)93ncEAyL.cRUVYWYI8QoNe \N deleted 10 2017-02-27 10:24:19.629802+08 \N 1 admin aMsnbYlRJzrJ1amqZZVyBGZk7f22wGpP $2y$13$GxNKCNs8iIKRa3lwLKTVZubqkbVxM6OV5ncEAyL.cRUVYWYI8QoNe \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N 2 hades _5bsMukGscfsozQxC0x6X99kGtIBvvS5 $2y$13$7VqrzUhaoZl6TWLNv8nVV.kRRshYh/D8JBPQn1O8q5P5Fvpoq1ST. \N <EMAIL> 10 2017-02-15 15:36:29.774606+08 \N \. -- -- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: yii -- SELECT pg_catalog.setval('user_id_seq', 23, true); -- -- Name: auth_assignment auth_assignment_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_assignment ADD CONSTRAINT auth_assignment_pkey PRIMARY KEY (item_name, user_id); -- -- Name: auth_item_child auth_item_child_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_item_child ADD CONSTRAINT auth_item_child_pkey PRIMARY KEY (parent, child); -- -- Name: auth_item auth_item_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_item ADD CONSTRAINT auth_item_pkey PRIMARY KEY (name); -- -- Name: auth_rule auth_rule_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_rule ADD CONSTRAINT auth_rule_pkey PRIMARY KEY (name); -- -- Name: country code; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY country ADD CONSTRAINT code PRIMARY KEY (code); -- -- Name: comments comments_id_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY comments ADD CONSTRAINT comments_id_pkey PRIMARY KEY (id); -- -- Name: migration migration_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY migration ADD CONSTRAINT migration_pkey PRIMARY KEY (version); -- -- Name: message pk_message_id_language; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY message ADD CONSTRAINT pk_message_id_language PRIMARY KEY (id, language); -- -- Name: source_message source_message_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY source_message ADD CONSTRAINT source_message_pkey PRIMARY KEY (id); -- -- Name: thread thread_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY thread ADD CONSTRAINT thread_pkey PRIMARY KEY (id); -- -- Name: user user_email_key; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY "user" ADD CONSTRAINT user_email_key UNIQUE (email); -- -- Name: user user_password_reset_token_key; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY "user" ADD CONSTRAINT user_password_reset_token_key UNIQUE (password_reset_token); -- -- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY "user" ADD CONSTRAINT user_pkey PRIMARY KEY (id); -- -- Name: user user_username_key; Type: CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY "user" ADD CONSTRAINT user_username_key UNIQUE (username); -- -- Name: fki_thread_fkey; Type: INDEX; Schema: public; Owner: yii -- CREATE INDEX fki_thread_fkey ON thread USING btree (author_id); -- -- Name: fki_thread_updated_by_fkey; Type: INDEX; Schema: public; Owner: yii -- CREATE INDEX fki_thread_updated_by_fkey ON thread USING btree (updated_by); -- -- Name: idx-auth_item-type; Type: INDEX; Schema: public; Owner: yii -- CREATE INDEX "idx-auth_item-type" ON auth_item USING btree (type); -- -- Name: idx_message_language; Type: INDEX; Schema: public; Owner: yii -- CREATE INDEX idx_message_language ON message USING btree (language); -- -- Name: idx_source_message_category; Type: INDEX; Schema: public; Owner: yii -- CREATE INDEX idx_source_message_category ON source_message USING btree (category); -- -- Name: auth_assignment auth_assignment_item_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_assignment ADD CONSTRAINT auth_assignment_item_name_fkey FOREIGN KEY (item_name) REFERENCES auth_item(name) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: auth_assignment auth_assignment_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_assignment ADD CONSTRAINT auth_assignment_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: auth_item_child auth_item_child_child_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_item_child ADD CONSTRAINT auth_item_child_child_fkey FOREIGN KEY (child) REFERENCES auth_item(name) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: auth_item_child auth_item_child_parent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_item_child ADD CONSTRAINT auth_item_child_parent_fkey FOREIGN KEY (parent) REFERENCES auth_item(name) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: auth_item auth_item_rule_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY auth_item ADD CONSTRAINT auth_item_rule_name_fkey FOREIGN KEY (rule_name) REFERENCES auth_rule(name) ON UPDATE CASCADE ON DELETE SET NULL; -- -- Name: comments comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY comments ADD CONSTRAINT comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE SET DEFAULT; -- -- Name: comments comments_thread_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY comments ADD CONSTRAINT comments_thread_id_fkey FOREIGN KEY (thread_id) REFERENCES thread(id) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: message fk_message_source_message; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY message ADD CONSTRAINT fk_message_source_message FOREIGN KEY (id) REFERENCES source_message(id) ON UPDATE RESTRICT ON DELETE CASCADE; -- -- Name: thread thread_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY thread ADD CONSTRAINT thread_author_id_fkey FOREIGN KEY (author_id) REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE SET DEFAULT; -- -- Name: thread thread_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: yii -- ALTER TABLE ONLY thread ADD CONSTRAINT thread_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE SET DEFAULT; -- -- PostgreSQL database dump complete --
--- PKEYS ALTER TABLE ONLY oauth_client ADD CONSTRAINT oauth_client_obj_id_pkey PRIMARY KEY (id); ALTER TABLE ONLY oauth_scope ADD CONSTRAINT oauth_scope_obj_id_pkey PRIMARY KEY (id); ALTER TABLE ONLY oauth_access_token ADD CONSTRAINT oauth_access_token_id_pkey PRIMARY KEY (id); ALTER TABLE ONLY oauth_refresh_token ADD CONSTRAINT oauth_refresh_token_id_pkey PRIMARY KEY (id); ALTER TABLE ONLY oauth_authorization_code ADD CONSTRAINT oauth_authorization_code_id_pkey PRIMARY KEY (id); --- OAUTH_CLIENT ALTER TABLE ONLY oauth_client ADD CONSTRAINT oauth_client_client_id_uniq UNIQUE (client_id); --- OAUTH_SCOPE ALTER TABLE ONLY oauth_scope ADD CONSTRAINT oauth_scope_scope_uniq UNIQUE (scope); --- OAUTH_ACCESS_TOKEN ALTER TABLE ONLY oauth_access_token ADD CONSTRAINT oauth_access_token_access_token_uniq UNIQUE (access_token); ALTER TABLE ONLY oauth_access_token ADD CONSTRAINT oauth_access_token_client_id_fkey FOREIGN KEY (client_id) REFERENCES oauth_client (client_id) ON UPDATE CASCADE ON DELETE RESTRICT; --- OAUTH_REFRESH_TOKEN ALTER TABLE ONLY oauth_refresh_token ADD CONSTRAINT oauth_refresh_token_refresh_token_uniq UNIQUE (refresh_token); ALTER TABLE ONLY oauth_refresh_token ADD CONSTRAINT oauth_refresh_token_client_id_fkey FOREIGN KEY (client_id) REFERENCES oauth_client (client_id) ON UPDATE CASCADE ON DELETE RESTRICT; --- OAUTH_AUTHORIZATION_CODE ALTER TABLE ONLY oauth_authorization_code ADD CONSTRAINT oauth_authorization_code_authorization_code_uniq UNIQUE (authorization_code); ALTER TABLE ONLY oauth_authorization_code ADD CONSTRAINT oauth_authorization_code_client_id_fkey FOREIGN KEY (client_id) REFERENCES oauth_client (client_id) ON UPDATE CASCADE ON DELETE RESTRICT;
<reponame>PREngineer/Event-Manager-Global<filename>dummy data/event_change_log.sql<gh_stars>0 INSERT INTO `Event Change Log` (`ID`, `Event_ID`, `Changed_By_ID`, `Type`, `Reason`, `Timestamp`) VALUES (1, 26, 'poc', 'Create', 'New Event Creation Form', '2018-04-14 06:52:47');
<reponame>JonesSteel/visor -- -------------------------------------------------------- -- Host: 127.0.0.1 -- Versión del servidor: 5.7.33 - MySQL Community Server (GPL) -- SO del servidor: Win64 -- HeidiSQL Versión: 11.2.0.6213 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- Volcando datos para la tabla usuarios_dgrpt.aplicativos: ~7 rows (aproximadamente) /*!40000 ALTER TABLE `aplicativos` DISABLE KEYS */; INSERT INTO `aplicativos` (`cve_aplicativo`, `aplicativo`) VALUES (1, 'CAMBIO DE SEMÁFORO 2022'), (2, 'PRE-REGISTRO 2020'), (3, 'TAXI SUSTITUCIÓN 2020'), (4, 'CUAUTEPEC FASE 1'), (5, 'MANO ALZADA'), (6, 'TAXI SUSTITUCIÓN 2021 (PERITAJE, TÍTULOS Y CONVENIOS DE ADHESIÓN)'), (7, 'VELÓDROMO'); /*!40000 ALTER TABLE `aplicativos` ENABLE KEYS */; -- Volcando datos para la tabla usuarios_dgrpt.areas: ~6 rows (aproximadamente) /*!40000 ALTER TABLE `areas` DISABLE KEYS */; INSERT INTO `areas` (`cve_area_dgrpt`, `area_dgrpt`) VALUES (1, 'DIRECCIÓN GENERAL DE REGISTRO PÚBLICO DE TRANSPORTE'), (3, 'SUBDIRECCIÓN DE ARCHIVO'), (2, 'SUBDIRECCIÓN DE CONCENTRACIÓN Y VINCULACIÓN DE BASES DE DATOS DEL REGISTRO DEL TRANSPORTE'), (5, 'SUBDIRECCIÓN DE ENLACE CON REPUVE'), (4, 'SUBDIRECCIÓN DE INFORMACIÓN REGISTRAL'), (6, 'SUBDIRECCIÓN DE VALIDACIÓN Y PROCESO REGISTRAL'); /*!40000 ALTER TABLE `areas` ENABLE KEYS */; -- Volcando datos para la tabla usuarios_dgrpt.tipo_personal: ~4 rows (aproximadamente) /*!40000 ALTER TABLE `tipo_personal` DISABLE KEYS */; INSERT INTO `tipo_personal` (`cve_tipo_personal`, `tipo_personal`) VALUES (4, 'BASE'), (1, 'ESTRUCTURA'), (2, 'HONORARIOS'), (3, 'NÓMINA 8'); /*!40000 ALTER TABLE `tipo_personal` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
<gh_stars>0 INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (1, 'Чингиз', 'Болатов', 1, '<EMAIL>', '$<PASSWORD>DdZ0BtHGVyzUGR50yG6uirigRzyC74I<PASSWORD>', 'FspXdrp8qvqd47lv0KekUW9KnSNwDH6pN8w8KDjkpjPfPimYbYQlTXYfha5U', '2022-02-08 11:16:33', '2022-02-09 04:51:45'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (2, 'Тестовый', 'Аккаунт', 0, '<EMAIL>', '$2y$10$SBXO3c/74pwH8vvdI0Y.aOTkn.F6TVAX5gOivS1Bdy7NyXcm8CKOi', '0Eb0qlpurfCTMYbR3AHgX3syeMGvBiYmKPb1VFadIgv1VKTq5lVr9ZY6AfkO', '2022-02-08 11:55:15', '2022-02-09 07:36:03'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (3, 'Ерасыл', 'Ахметов', 0, '<EMAIL>', '123456', null, '2022-02-08 15:41:35', '2022-02-08 15:41:35'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (5, 'Ерасыл', 'Ахметов', 0, '<EMAIL>', '123456', null, '2022-02-08 16:28:45', '2022-02-08 16:28:45'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (6, 'Ерасыл', 'Ахметов', 0, '<EMAIL>', '123456', null, '2022-02-08 16:31:33', '2022-02-08 16:31:33'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (7, 'Ерасыл', 'Ахметов', 0, '<EMAIL>', '123456', null, '2022-02-08 17:18:32', '2022-02-08 17:18:32'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (8, 'Ерасыл', 'Ахметов', 0, '<EMAIL>', '123456', null, '2022-02-08 17:18:55', '2022-02-08 17:18:55'); INSERT INTO `magnum-checklist`.users (id, f_name, l_name, is_admin, email, password, remember_token, created_at, updated_at) VALUES (9, 'Ерасыл', 'Ахметов', 0, '<EMAIL>', '123456', null, '2022-02-08 17:19:28', '2022-02-08 17:19:28');
INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',41,200); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',44,145); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',34,104); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',35,27); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',45,131); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',34,117); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',37,145); INSERT INTO `PLAYER`(`PLAYER_ID`, `NAME`, `AGE`, `MATCHES`) VALUES (player_sequence.nextval, '<NAME>',49,168);
<reponame>wing2005/dogsBarber<gh_stars>0 USE eyalet_BackEnd_Project_Chen; INSERT INTO `Orders` (`employee_id`, `service_id`, `customer_id`, `order_date`, `total_price`, `dog_id`) VALUES (1, 1, '111111111', '2021-02-09', 150, 2001), (2, 3, '222222222', '2021-02-09', 100, 2002), (3, 2, '333333333', '2021-02-09', 200, 2003), (4, 1, '444444444', '2021-03-01', 150, 2004), (5, 2, '555555555', '2021-03-01', 200, 2005), (6, 3, '666666666', '2021-03-01', 100, 2006), (7, 1, '777777777', '2021-04-01', 150, 2007), (8, 2, '888888888', '2021-04-01', 200, 2008), (9, 3, '9999999999', '2021-04-01', 100, 2009), (10, 1, '101010101', '2021-02-27', 150, 2010), (2, 3, '666666666', '2021-02-27', 100, 2006), (4, 2, '9999999999', '2021-02-27', 200, 2009), (6, 2, '333333333', '2021-02-27', 200, 2003);
select NULL pracID, NULL klientID, round(sum(SubTotal),2) as Suma from Sales.SalesOrderHeader UNION ALL select SalesPersonID pracID, CustomerID klinetID, round(sum(SubTotal),2) Suma from Sales.SalesOrderHeader group by SalesPersonID,CustomerID order by pracID, klientID
SET FOREIGN_KEY_CHECKS=0; -- -------------------------------------------------------- ALTER TABLE `@prefix@tab_adress` ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ; ALTER TABLE `@prefix@tab_events` ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ; ALTER TABLE `@prefix@tab_patients` ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ; -- -------------------------------------------------------- SET FOREIGN_KEY_CHECKS=1;
-- phpMyAdmin SQL Dump -- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 04, 2014 at 01:04 AM -- Server version: 5.5.32 -- PHP Version: 5.4.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `snc_dev` -- CREATE DATABASE IF NOT EXISTS `snc_dev` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `snc_dev`; -- -------------------------------------------------------- -- -- Table structure for table `clients` -- CREATE TABLE IF NOT EXISTS `clients` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `company` text NOT NULL, `website` text NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `profile_fields` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `clientscontacts` -- CREATE TABLE IF NOT EXISTS `clientscontacts` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `client_id` int(11) NOT NULL, `contact_id` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `contacts` -- CREATE TABLE IF NOT EXISTS `contacts` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `phone` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `modified_date` datetime NOT NULL, `modified_by` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `client_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `migration` -- CREATE TABLE IF NOT EXISTS `migration` ( `type` varchar(25) NOT NULL, `name` varchar(50) NOT NULL, `migration` varchar(100) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `migration` -- INSERT INTO `migration` (`type`, `name`, `migration`) VALUES ('app', 'default', '001_create_users'), ('app', 'default', '002_create_posts'), ('app', 'default', '003_create_clients'), ('app', 'default', '004_add_profile_fields_to_clients'), ('app', 'default', '005_add_phone_to_users'), ('app', 'default', '006_create_contacts'), ('app', 'default', '007_rename_field_site_to_company_in_clients'), ('app', 'default', '008_rename_field_web_address_to_website_in_clients'), ('app', 'default', '009_create_clientscontacts'), ('app', 'default', '010_create_projects'), ('app', 'default', '011_add_field_to_contacts'), ('app', 'default', '012_rename_field_client_to_client_id_in_contacts'), ('app', 'default', '013_create_staffs'); -- -------------------------------------------------------- -- -- Table structure for table `posts` -- CREATE TABLE IF NOT EXISTS `posts` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `summary` text NOT NULL, `body` text NOT NULL, `user_id` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `projects` -- CREATE TABLE IF NOT EXISTS `projects` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `job_type` varchar(255) NOT NULL, `client` int(11) NOT NULL, `status` varchar(255) NOT NULL, `progress` int(11) NOT NULL, `live` varchar(255) NOT NULL, `testing` varchar(255) NOT NULL, `notes` text NOT NULL, `developer` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `staffs` -- CREATE TABLE IF NOT EXISTS `staffs` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `first` varchar(255) NOT NULL, `last` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `personal_email` varchar(255) NOT NULL, `phone` varchar(255) NOT NULL, `cell_phone` varchar(255) NOT NULL, `profile_fields` text NOT NULL, `user` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Dumping data for table `staffs` -- INSERT INTO `staffs` (`id`, `first`, `last`, `email`, `personal_email`, `phone`, `cell_phone`, `profile_fields`, `user`, `created_at`, `updated_at`) VALUES (1, 'Peter', 'Seif', '<EMAIL>', '<EMAIL>', '239-790-7000 ext.231', '239-871-8766', 'Owner of Synergy Networks', 1, 1393652878, 1393652878), (2, 'Jenna', 'Moakley', '<EMAIL>', '<EMAIL>', '239-790-7000 ext.221', '239-257-7098', 'Internet Marketing Specialist\r\nWeb Programmer\r\nSEO Specialist', 0, 1393652959, 1393652959), (3, 'Raul', 'Rodriguez', '<EMAIL>', '<EMAIL>', '2398226713', '2398226713', 'web programmer', 0, 1393653074, 1393653074), (4, 'Lora', 'Nilsson', '<EMAIL>', '<EMAIL>', '239-790-7000 ext.', '236985623', 'Web Developer Supervisor', 0, 1393653152, 1393653152); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, `group` int(11) NOT NULL, `email` varchar(255) NOT NULL, `last_login` int(11) NOT NULL, `login_hash` varchar(255) NOT NULL, `profile_fields` text NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `phone` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `group`, `email`, `last_login`, `login_hash`, `profile_fields`, `created_at`, `updated_at`, `phone`) VALUES (1, 'admin', 'NtgTF8q6Z9UyyUwQS7Ma5Bvj+uTrK/F66iMji9su1XY=', 100, '<EMAIL>', 1393769347, '<PASSWORD>', 'a:0:{}', 1393635042, NULL, ''); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
create or replace trigger tr8 before insert on loans for each row declare cincome number ; begin select income into cincome from customer c where c.cid=:NEW.cid; if(:NEW.amount > 2*cincome) then raise_application_error(-20009,'LIMIT EXCEEDED'); end if; end; /
<filename>src/cli/bundled/sql/PartnerStudy.sql CREATE TABLE partner_study ( id String, additional_info Nullable(String), brand Nullable(String), client_name Nullable(String), emails Nullable(String), input_ids Array(String), is_export Nullable(UInt8), location Nullable(String), match_file_ds Nullable(String), name Nullable(String), partner_defined_id Nullable(String), partner_household_graph_dataset_id Nullable(String), status Nullable(String), study_end_date Nullable(String), study_start_date Nullable(String), study_type Nullable(String), submit_date Nullable(String) ) ENGINE = Log
-- file:alter_table.sql ln:1253 expect:true alter table foo alter f1 TYPE integer
<gh_stars>1-10 insert into account (id, name) values (uuid('2b441c6f-e9d4-4252-ab66-f87998080d51'), 'Test Account');
-- 2018-06-18T18:02:14.787 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('1',0,0,540980,'Y','de.metas.ui.web.order.sales.hu.reservation.process.WEBUI_C_OrderLineSO_Make_HuReservation','N',TO_TIMESTAMP('2018-06-18 18:02:14','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y','N','N','N','N','N','N','Y',0,'Verfügbare Handling Units anzeigen','N','Y','Java',TO_TIMESTAMP('2018-06-18 18:02:14','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_C_OrderLineSO_Make_HuReservation') ; -- 2018-06-18T18:02:14.797 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540980 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID) ; -- 2018-06-18T18:02:17.955 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Process_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-06-18 18:02:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Process_ID=540980 AND AD_Language='de_CH' ; -- 2018-06-18T18:02:31.423 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Process_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-06-18 18:02:31','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Show available handling units' WHERE AD_Process_ID=540980 AND AD_Language='en_US' ; -- 2018-06-18T18:03:13.003 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_QuickAction,WEBUI_QuickAction_Default) VALUES (0,0,540980,259,143,TO_TIMESTAMP('2018-06-18 18:03:13','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y',TO_TIMESTAMP('2018-06-18 18:03:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N') ; -- 2018-06-18T18:30:02.213 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Table_Process SET WEBUI_QuickAction='N',Updated=TO_TIMESTAMP('2018-06-18 18:30:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540980 AND AD_Table_ID=259 ; -- 2018-06-19T07:17:02.163 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Process SET Classname='de.metas.ui.web.order.sales.hu.reservation.process.WEBUI_C_OrderLineSO_Launch_HUEditor', Value='WEBUI_C_OrderLineSO_Launch_HUEditor',Updated=TO_TIMESTAMP('2018-06-19 07:17:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540980 ; -- 2018-06-20T13:04:59.379 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540478,541652,TO_TIMESTAMP('2018-06-20 13:04:59','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y','Reserviert',TO_TIMESTAMP('2018-06-20 13:04:59','YYYY-MM-DD HH24:MI:SS'),100,'R','Reserved') ; -- 2018-06-20T13:04:59.421 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541652 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) ; -- 2018-06-20T13:05:02.946 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-06-20 13:05:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Ref_List_ID=541652 AND AD_Language='de_CH' ; -- 2018-06-20T13:05:13.460 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-06-20 13:05:13','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Reserved' WHERE AD_Ref_List_ID=541652 AND AD_Language='en_US' ; -- 2018-06-20T13:06:35.083 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-06-20 13:06:35','YYYY-MM-DD HH24:MI:SS'),Description='Sortof similar to active, but is assigned to a particular portner or sale order line. Can be moved around, but not reserved or picked/shipped to another bpartner.' WHERE AD_Ref_List_ID=541652 AND AD_Language='en_US' ; -- 2018-06-20T13:07:18.788 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Ref_List SET Description='Ähnlich wie "Aktiv", aber einer Verkaufsauftragsposition oder einem Kunden zugewiesen.',Updated=TO_TIMESTAMP('2018-06-20 13:07:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541652 ; -- 2018-06-20T13:07:30.207 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Ref_List_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-06-20 13:07:30','YYYY-MM-DD HH24:MI:SS'),Description='Ähnlich wie "Aktiv", aber einer Verkaufsauftragsposition oder einem Kunden zugewiesen.' WHERE AD_Ref_List_ID=541652 AND AD_Language='de_CH' ; -- 2018-06-22T18:55:33.297 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Process (AD_Client_ID,IsActive,CreatedBy,IsReport,IsDirectPrint,Value,AccessLevel,EntityType,ShowHelp,IsBetaFunctionality,IsServerProcess,CopyFromProcess,AD_Process_ID,AllowProcessReRun,IsUseBPartnerLanguage,IsApplySecuritySettings,Type,RefreshAllAfterExecution,IsOneInstanceOnly,LockWaitTimeout,AD_Org_ID,Name,Classname,UpdatedBy,Created,Updated) VALUES (0,'Y',100,'N','N','WEBUI_C_OrderLineSO_Make_HuReservation','3','de.metas.handlingunits','Y','N','N','N',540983,'N','Y','N','Java','N','N',0,0,'Reserve','de.metas.ui.web.order.sales.hu.reservation.process.WEBUI_C_OrderLineSO_Make_HuReservation',100,TO_TIMESTAMP('2018-06-22 18:55:33','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2018-06-22 18:55:33','YYYY-MM-DD HH24:MI:SS')) ; -- 2018-06-22T18:55:33.302 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540983 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID) ;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -------------------------------------------------------------------------- CREATE TABLE `_changelog` ( `ID` decimal(20,0) NOT NULL, `APPLIED_AT` varchar(25) NOT NULL, `DESCRIPTION` varchar(255) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__account` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `owner_id` bigint(20) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL, `display_name` varchar(255) NOT NULL, `stripe_uid` varchar(255) DEFAULT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '0', `active` tinyint(1) NOT NULL DEFAULT '0', `verified` tinyint(1) NOT NULL DEFAULT '0', `retired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__account_name` (`name`), UNIQUE KEY `ux_core__account_uid` (`uid`), UNIQUE KEY `ux_core__account_owner` (`owner_id`), CONSTRAINT `fk_core__account_owner` FOREIGN KEY (`owner_id`) REFERENCES `core__user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__api_log` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `owner_id` bigint(20) unsigned NOT NULL, `app_id` bigint(20) unsigned NOT NULL, `version_id` bigint(20) unsigned NOT NULL, `client_id` varchar(255) NOT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `access_token` varchar(255) DEFAULT NULL, `end_point` varchar(255) NOT NULL, `class_name` varchar(255) NOT NULL, `method_name` varchar(255) NOT NULL, `hostname` varchar(255) DEFAULT NULL, `browser` varchar(512) DEFAULT NULL, `latitude` double DEFAULT NULL, `longitude` double DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__api_log_uid` (`uid`), KEY `ix_core__api_log_owner` (`owner_id`), KEY `ix_core__api_log_app` (`app_id`), KEY `ix_core__api_log_version` (`version_id`), KEY `ix_core__api_log_client` (`client_id`), KEY `ix_core__api_log_user` (`user_id`), CONSTRAINT `fk_core__api_log_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__api_log_client` FOREIGN KEY (`client_id`) REFERENCES `core__app_creds` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__api_log_owner` FOREIGN KEY (`owner_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__api_log_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__api_log_version` FOREIGN KEY (`version_id`) REFERENCES `core__api_version` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__api_version` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `description` varchar(2000) DEFAULT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '1', `published_date` datetime(6) NOT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__api_version_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `type_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `logo_id` bigint(20) unsigned DEFAULT NULL, `logo_url_path` varchar(255) DEFAULT NULL, `name` varchar(255) NOT NULL, `display_name` varchar(255) NOT NULL, `description` varchar(2000) DEFAULT NULL, `app_url` varchar(255) DEFAULT NULL, `company_name` varchar(255) DEFAULT NULL, `company_url` varchar(255) DEFAULT NULL, `privacy_url` varchar(255) DEFAULT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '1', `retired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__app_name` (`name`), UNIQUE KEY `ux_core__app_uid` (`uid`), KEY `ix_core__app_type` (`type_id`), KEY `ix_core__app_user` (`user_id`), KEY `ix_core__app_logo` (`logo_id`), CONSTRAINT `fk_core__app_logo` FOREIGN KEY (`logo_id`) REFERENCES `core__file` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_core__app_type` FOREIGN KEY (`type_id`) REFERENCES `core__app_type` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_core__app_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app_config` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `env` enum('dev','qa','beta','sandbox','prd') DEFAULT NULL, `name` varchar(255) NOT NULL, `value` varchar(4000) NOT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `core__app_config_env_name` (`app_id`,`env`,`name`), KEY `ix_core__app_config_app` (`app_id`), CONSTRAINT `fk_core__app_config_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app_creds` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `api_version_id` bigint(20) unsigned NOT NULL, `name` varchar(255) DEFAULT NULL, `client_id` varchar(255) DEFAULT NULL, `client_secret` varchar(255) DEFAULT NULL, `redirect_uri` varchar(255) DEFAULT NULL, `scope` varchar(255) NOT NULL DEFAULT 'read,write', `enabled` tinyint(1) NOT NULL DEFAULT '1', `access_token_timeout` int(11) unsigned DEFAULT NULL, -- seconds / needs to be integer `refresh_token_timeout` int(11) unsigned DEFAULT NULL, -- second / needs to be integer `retired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__app_creds_name` (`app_id`,`name`), UNIQUE KEY `ux_core__app_creds_client_id` (`client_id`), UNIQUE KEY `ux_core__app_creds_client_secret` (`client_secret`), KEY `ix_core__app_creds_api_version` (`api_version_id`), CONSTRAINT `fk_core__app_creds_api_version` FOREIGN KEY (`api_version_id`) REFERENCES `core__api_version` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__app_creds_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app_legal` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `app_id` bigint(20) unsigned NOT NULL, `type` enum('terms','privacy') NOT NULL, `content` mediumtext NOT NULL, `version` int(11) unsigned NOT NULL, `active` tinyint(1) NOT NULL DEFAULT '0', `published_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__app_legal_uid` (`uid`), UNIQUE KEY `core__app_legal_type_version` (`app_id`, `type`, `version`), KEY `ix_core__app_legal_app` (`app_id`), KEY `ix_core__app_legal_type` (`type`), CONSTRAINT `fk_core__app_legal_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app_type` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__app_type_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app_user` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint(20) unsigned NOT NULL, `app_id` bigint(20) unsigned NOT NULL, `token_id` bigint(20) unsigned DEFAULT NULL, `app_user_id` varchar(255) DEFAULT NULL, `revoked_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__app_user_app_user` (`app_id`,`user_id`), KEY `ix_core__user_app_user` (`user_id`), KEY `ix_core__user_app_token` (`token_id`), CONSTRAINT `fk_core__app_user_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__app_user_token` FOREIGN KEY (`token_id`) REFERENCES `core__token` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_core__app_user_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__app_webhook` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `app_id` bigint(20) unsigned NOT NULL, `name` varchar(255) NOT NULL, `display_name` varchar(255) NOT NULL, `events` varchar(2000) DEFAULT NULL, `url` varchar(2000) DEFAULT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '1', `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__app_webhook_uid` (`uid`), UNIQUE KEY `ux_core__app_webhook_app_name` (`app_id`,`name`), KEY `ix_core__app_webhook_app` (`app_id`), CONSTRAINT `fk_core__app_webhook_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__auth_code` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `type_id` bigint(20) unsigned NOT NULL, `app_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `code` varchar(255) NOT NULL, `valid` tinyint(1) NOT NULL DEFAULT '0', `use_count` int(11) unsigned NOT NULL DEFAULT '0', `max_use_count` int(11) unsigned default NULL, -- null means no max `expiration_date` datetime(6) DEFAULT NULL, `last_accessed_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__auth_code_code` (`code`), KEY `ix_core__auth_code_type` (`type_id`), KEY `ix_core__auth_code_app` (`app_id`), KEY `ix_core__auth_code_user` (`user_id`), CONSTRAINT `fk_core__auth_code_type` FOREIGN KEY (`type_id`) REFERENCES `core__auth_code_type` (`id`), CONSTRAINT `fk_core__auth_code_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`), CONSTRAINT `fk_core__auth_code_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__file` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `type_id` bigint(20) unsigned DEFAULT NULL, `access_id` bigint(20) unsigned DEFAULT NULL, `parent_id` bigint(20) unsigned DEFAULT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `account_id` bigint(20) unsigned DEFAULT NULL, `token_id` bigint(20) unsigned DEFAULT NULL, -- `thumb_id` bigint(20) unsigned DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `content_type` varchar(255) NOT NULL, `size` bigint(20) unsigned NOT NULL, -- `folder` tinyint(1) NOT NULL DEFAULT '0', -- `shared` tinyint(1) NOT NULL DEFAULT '0', -- `archive` tinyint(1) NOT NULL DEFAULT '0', -- `compressed` tinyint(1) NOT NULL DEFAULT '0', `hidden` tinyint(1) NOT NULL DEFAULT '0', `enabled` tinyint(1) NOT NULL DEFAULT '0', `active` tinyint(1) NOT NULL DEFAULT '0', `temp_file` tinyint(1) NOT NULL DEFAULT '0', -- `width` int(11) DEFAULT NULL, -- `height` int(11) DEFAULT NULL, -- `bits_per_pixel` int(11) DEFAULT NULL, -- `frames_per_second` int(11) DEFAULT NULL, -- `duration` bigint(20) unsigned DEFAULT NULL, `src_hostname` varchar(255) DEFAULT NULL, `src_filename` varchar(255) DEFAULT NULL, `local_path` varchar(255) DEFAULT NULL, `url_path` varchar(255) DEFAULT NULL, -- `thumb_url_path` varchar(255) DEFAULT NULL, `upload_time` bigint(20) unsigned DEFAULT NULL, `retired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__file_uid` (`uid`), KEY `ix_core__file_type` (`type_id`), KEY `ix_core__file_parent` (`parent_id`), KEY `ix_core__file_user` (`user_id`), KEY `ix_core__file_account` (`account_id`), KEY `ix_core__file_token` (`token_id`), -- KEY `ix_core__file_thumb` (`thumb_id`), KEY `ix_core__file_access` (`access_id`), KEY `ix_core__file_url_path` (`url_path`), CONSTRAINT `fk_core__file_access` FOREIGN KEY (`access_id`) REFERENCES `core__file_access` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__file_parent` FOREIGN KEY (`parent_id`) REFERENCES `core__file` (`id`) ON DELETE CASCADE, -- CONSTRAINT `fk_core__file_thumb` FOREIGN KEY (`thumb_id`) -- REFERENCES `core__file` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__file_token` FOREIGN KEY (`token_id`) REFERENCES `core__token` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__file_type` FOREIGN KEY (`type_id`) REFERENCES `core__file_type` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__file_account` FOREIGN KEY (`account_id`) REFERENCES `core__account` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__file_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__file_access` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__file_access_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__file_type` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__file_type_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__redirect` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `short_url_id` bigint(20) unsigned NOT NULL, `promo_id` bigint(20) unsigned DEFAULT NULL, `request_url` varchar(2000) NOT NULL, `redirect_url` varchar(2000) NOT NULL, `hostname` varchar(255) NOT NULL, `browser` varchar(512) NOT NULL, `referer` varchar(2000) DEFAULT NULL, `locale` varchar(255) DEFAULT NULL, `country` varchar(255) DEFAULT NULL, `city` varchar(255) DEFAULT NULL, `region` varchar(255) DEFAULT NULL, `latitiude` double DEFAULT NULL, `longitude` double DEFAULT NULL, `requested_date` datetime(6) NOT NULL, `redirected_date` datetime(6) NOT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), KEY `ix_core__redirect_short_url` (`short_url_id`), KEY `ix_core__redirect_promo` (`promo_id`), CONSTRAINT `fk_core__redirect_promo` FOREIGN KEY (`promo_id`) REFERENCES `sales__promo` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_core__redirect_short_url` FOREIGN KEY (`short_url_id`) REFERENCES `core__short_url` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__registration` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `account_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `campaign_id` bigint(20) unsigned DEFAULT NULL, `partner_id` bigint(20) unsigned DEFAULT NULL, `promo_id` bigint(20) unsigned DEFAULT NULL, `referred_by_id` bigint(20) unsigned DEFAULT NULL, `client_id` varchar(255) default NULL, `username` varchar(255) default NULL, `hostname` varchar(255) default NULL, `browser` varchar(512) DEFAULT NULL, `device_name` varchar(255) DEFAULT NULL, `device_uuid` varchar(255) DEFAULT NULL, `platform_name` varchar(255) DEFAULT NULL, `platform_version` varchar(255) DEFAULT NULL, `signup_time` int(10) unsigned DEFAULT NULL, `email_verified` tinyint(1) NOT NULL DEFAULT '0', `email_pending` tinyint(1) NOT NULL DEFAULT '0', `mobile_verified` tinyint(1) NOT NULL DEFAULT '0', `mobile_pending` tinyint(1) NOT NULL DEFAULT '0', `reminded_date` datetime(6) DEFAULT NULL, `registered_date` datetime(6) DEFAULT NULL, `deactivated_date` datetime(6) DEFAULT NULL, `deleted_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `ix_core__registration_app` (`app_id`), KEY `ix_core__registration_account` (`account_id`), KEY `ix_core__registration_user` (`user_id`), KEY `ix_core__registration_campaign` (`campaign_id`), KEY `ix_core__registration_partner` (`partner_id`), KEY `ix_core__registration_promo` (`promo_id`), KEY `ix_core__registration_referred_by` (`referred_by_id`), CONSTRAINT `fk_core__registration_referred_by` FOREIGN KEY (`referred_by_id`) REFERENCES `core__user` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__registration_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`), CONSTRAINT `fk_core__registration_campaign` FOREIGN KEY (`campaign_id`) REFERENCES `core__campaign` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__registration_partner` FOREIGN KEY (`partner_id`) REFERENCES `core__partner` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__registration_promo` FOREIGN KEY (`promo_id`) REFERENCES `sales__promo` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__registration_account` FOREIGN KEY (`account_id`) REFERENCES `core__account` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__registration_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__remote_service` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__remote_service_uid` (`uid`), UNIQUE KEY `ux_core__remote_service_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__remote_service_app_creds` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `remote_service_id` bigint(20) unsigned NOT NULL, `authorize_uri` varchar(1024) DEFAULT NULL, `token_uri` varchar(1024) DEFAULT NULL, `scope` varchar(1024) DEFAULT NULL, `client_key` varchar(1024) DEFAULT NULL, `client_secret` varchar(1024) DEFAULT NULL, `redirect_uri` varchar(1024) DEFAULT NULL, `namespace` varchar(255) DEFAULT NULL, `region` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__remote_service_app_creds_app_remote_service` (`app_id`,`remote_service_id`), KEY `ix_core__remote_service_app_creds_remote_service` (`remote_service_id`), CONSTRAINT `fk_core__remote_service_app_creds_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__remote_service_app_creds_remote_service` FOREIGN KEY (`remote_service_id`) REFERENCES `core__remote_service` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__remote_service_user_creds` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `account_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `remote_service_id` bigint(20) unsigned NOT NULL, `name` varchar(255) NOT NULL, `remote_service_user_id` varchar(255) DEFAULT NULL, `remote_service_screen_name` varchar(255) DEFAULT NULL, `auth_type` enum('oauth','oauth2','credentials') DEFAULT NULL, `access_token` varchar(1024) DEFAULT NULL, `refresh_token` varchar(1024) DEFAULT NULL, `token_secret` varchar(1024) DEFAULT NULL, `expire_date` datetime(6) DEFAULT NULL, `connected_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__remote_service_user_creds_app_account_name` (`app_id`,`account_id`,`name`), KEY `ix_core__remote_service_user_creds_account` (`account_id`), KEY `ix_core__remote_service_user_creds_user` (`user_id`), KEY `ix_core__remote_service_user_creds_remote_service` (`remote_service_id`), KEY `ix_core__remote_service_user_creds_remote_service_user` (`remote_service_user_id`), KEY `ix_core__remote_service_user_creds_remote_service_screen_name` (`remote_service_screen_name`), CONSTRAINT `fk_core__remote_service_user_creds_account` FOREIGN KEY (`account_id`) REFERENCES `core__account` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__remote_service_user_creds_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__remote_service_user_creds_remote_service` FOREIGN KEY (`remote_service_id`) REFERENCES `core__remote_service` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__remote_service_user_creds_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__setting` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `account_id` bigint(20) unsigned DEFAULT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL, `value` varchar(4000) NOT NULL, `overwrite_global` tinyint(1) NOT NULL DEFAULT '0', `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__setting_user_name` (`user_id`,`name`), UNIQUE KEY `ux_core__setting_account_name` (`account_id`,`name`), KEY `ix_core__setting_user` (`user_id`), KEY `ix_core__setting_account` (`account_id`), KEY `ix_core__setting_name` (`name`), CONSTRAINT `fk_core__setting_account` FOREIGN KEY (`account_id`) REFERENCES `core__account` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__setting_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__short_url` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `promo_id` bigint(20) unsigned DEFAULT NULL, `partner_id` bigint(20) unsigned DEFAULT NULL, `domain` varchar(255) NOT NULL, `path` varchar(255) NOT NULL, `short_url` varchar(255) NOT NULL, `long_url` varchar(2000) NOT NULL, `description` varchar(2000) DEFAULT NULL, `script` tinyint(1) NOT NULL DEFAULT '0', `enabled` tinyint(1) NOT NULL DEFAULT '0', `expired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__short_url_short_url` (`short_url`), UNIQUE KEY `ux_core__short_url_path` (`path`), KEY `ix_core__short_url_app` (`app_id`), KEY `ix_core__short_url_user` (`user_id`), KEY `ix_core__short_url_promo` (`promo_id`), KEY `ix_core__short_url_long_url` (`long_url`(255)), KEY `ix_core__short_url_partner` (`partner_id`), CONSTRAINT `fk_core__short_url_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`), CONSTRAINT `fk_core__short_url_partner` FOREIGN KEY (`partner_id`) REFERENCES `sales__partner` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_core__short_url_promo` FOREIGN KEY (`promo_id`) REFERENCES `sales__promo` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_core__short_url_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__token` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `type_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `app_id` bigint(20) unsigned NOT NULL, `client_id` varchar(255) NOT NULL, `access_token` varchar(255) DEFAULT NULL, `refresh_token` varchar(255) DEFAULT NULL, `scope` varchar(255) DEFAULT NULL, `authentication` blob, `username` varchar(255) DEFAULT NULL, `hostname` varchar(255) DEFAULT NULL, `latitude` double DEFAULT NULL, `longitude` double DEFAULT NULL, `browser` varchar(512) DEFAULT NULL, `app_version` varchar(255) DEFAULT NULL, `app_build` varchar(255) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '0', `approved` tinyint(1) NOT NULL DEFAULT '0', `access_count` bigint(20) unsigned DEFAULT NULL, `login_date` datetime(6) NOT NULL, `last_login_date` datetime(6) DEFAULT NULL, `logout_date` datetime(6) DEFAULT NULL, `access_expiration_date` datetime(6) DEFAULT NULL, `refresh_expiration_date` datetime(6) DEFAULT NULL, `retired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__token_access_token` (`access_token`), UNIQUE KEY `ux_core__token_refresh_token` (`refresh_token`), KEY `ix_core__token_client` (`client_id`), KEY `ix_core__token_app` (`app_id`), KEY `ix_core__token_user` (`user_id`), KEY `ix_core__token_type` (`type_id`), KEY `ix_core__token_hostname` (`hostname`), CONSTRAINT `fk_core__token_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`), CONSTRAINT `fk_core__token_client` FOREIGN KEY (`client_id`) REFERENCES `core__app_creds` (`client_id`), CONSTRAINT `fk_core__token_type` FOREIGN KEY (`type_id`) REFERENCES `core__token_type` (`id`), CONSTRAINT `fk_core__token_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__token_type` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `display_name` varchar(255) NOT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__token_type_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `parent_id` bigint(20) unsigned DEFAULT NULL, `type_id` bigint(20) unsigned DEFAULT NULL, `roles` set('SYSTEM','ADMIN','USER', 'GUEST') NOT NULL DEFAULT 'GUEST', `account_id` bigint(20) unsigned NOT NULL, `status_id` bigint(20) unsigned DEFAULT NULL, `presence_id` bigint(20) unsigned DEFAULT NULL, `photo_id` bigint(20) unsigned DEFAULT NULL, `photo_url` varchar(255) DEFAULT NULL, `thumbnail_url` varchar(255) DEFAULT NULL, `username` varchar(255) NOT NULL, `email` varchar(255) DEFAULT NULL, `mobile_number` varchar(255) DEFAULT NULL, `first_name` varchar(255) DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `gender` varchar(255) DEFAULT NULL, `birth_date` date DEFAULT NULL, `locale` varchar(255) DEFAULT NULL, `time_zone` varchar(255) DEFAULT NULL, `latitude` double DEFAULT NULL, `longitude` double DEFAULT NULL, `floor` int(11) unsigned DEFAULT NULL, `coords` geometry DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '0', `retired_date` datetime(6) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__user_username` (`username`), UNIQUE KEY `ux_core__user_uid` (`uid`), UNIQUE KEY `ux_core__user_email` (`email`), UNIQUE KEY `ux_core__user_mobile_number` (`mobile_number`), KEY `ix_core__user_parent` (`parent_id`), KEY `ix_core__user_photo` (`photo_id`), KEY `ix_core__user_type` (`type_id`), KEY `ix_core__user_status` (`status_id`), KEY `ix_core__user_account` (`account_id`), KEY `ix_core__user_coords` (`coords`(255)), KEY `ix_core__user_presence` (`presence_id`), CONSTRAINT `fk_core__user_account` FOREIGN KEY (`account_id`) REFERENCES `core__account` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__user_parent` FOREIGN KEY (`parent_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_core__user_photo` FOREIGN KEY (`photo_id`) REFERENCES `core__user_media` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__user_status` FOREIGN KEY (`status_id`) REFERENCES `core__user_status` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__user_presence` FOREIGN KEY (`presence_id`) REFERENCES `core__user_presence` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__user_type` FOREIGN KEY (`type_id`) REFERENCES `core__user_type` (`id`) ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user_auth` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint(20) unsigned NOT NULL, `password` varchar(255) DEFAULT NULL, `pin` varchar(255) DEFAULT NULL, `question1` varchar(255) DEFAULT NULL, `answer1` varchar(255) DEFAULT NULL, `question2` varchar(255) DEFAULT NULL, `answer2` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) , `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__user_auth_user` (`user_id`), CONSTRAINT `fk_core__user_auth_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user_media` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `account_id` bigint(20) unsigned NOT NULL, `file_id` bigint(20) unsigned DEFAULT NULL, `file_type_id` bigint(20) unsigned DEFAULT NULL, `thumbnail_id` bigint(20) unsigned DEFAULT NULL, `folder_path` varchar(255) DEFAULT NULL, -- similar to s3: flat but can be conceptually nested /folder1/subfolder2 `name` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `url_path` varchar(255) DEFAULT NULL, `thumbnail_url_path` varchar(255) DEFAULT NULL, `content_type` varchar(255) default NULL, `width` int(11) unsigned DEFAULT NULL, `height` int(11) unsigned DEFAULT NULL, `size` bigint(20) unsigned DEFAULT NULL, `bits_per_pixel` int(11) DEFAULT NULL, `frames_per_second` int(11) DEFAULT NULL, `duration` bigint(20) unsigned DEFAULT NULL, `thumbnail_width` int(11) unsigned DEFAULT NULL, `thumbnail_height` int(11) unsigned DEFAULT NULL, `thumbnail_size` bigint(20) unsigned DEFAULT NULL, `latitude` double DEFAULT NULL, `longitude` double DEFAULT NULL, `floor` int(11) unsigned DEFAULT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '0', `primary_photo` tinyint(1) NOT NULL DEFAULT '0', `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__user_media_uid` (`uid`), UNIQUE KEY `ux_core__user_media_file` (`file_id`), UNIQUE KEY `ux_core__user_media_thumbnail` (`thumbnail_id`), UNIQUE KEY `ux_core__user_media_name` (`account_id`, `folder_path`, `name`), KEY `ix_core__user_media_user` (`user_id`), KEY `ix_core__user_media_account` (`account_id`), CONSTRAINT `fk_core__user_media_file` FOREIGN KEY (`file_id`) REFERENCES `core__file` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__user_media_thumbnail` FOREIGN KEY (`thumbnail_id`) REFERENCES `core__file` (`id`) ON DELETE SET NULL, CONSTRAINT `fk_core__user_media_account` FOREIGN KEY (`account_id`) REFERENCES `core__account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_core__user_media_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user_presence` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__user_presence_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user_role` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__user_role_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user_status` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__user_status_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__user_type` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__user_type_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__auth_code_type` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__auth_code_type_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__entity_name_rule` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `pattern` varchar(255) DEFAULT NULL, `black_listed` tinyint(1) NOT NULL DEFAULT '0', `reserved` tinyint(1) NOT NULL DEFAULT '0', `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__entity_name_rule` (`pattern`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__position` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `sample_no` bigint(20) unsigned DEFAULT NULL, `network` varchar(255) DEFAULT NULL, `battery` int(11) DEFAULT NULL, `latitude` double DEFAULT NULL, `longitude` double DEFAULT NULL, `indoor_floor` int(11) unsigned DEFAULT NULL, `indoor_detail` varchar(2000) DEFAULT NULL, `altitude` double DEFAULT NULL, `accuracy` double DEFAULT NULL, `altitude_accuracy` double DEFAULT NULL, `heading` double DEFAULT NULL, `speed` double DEFAULT NULL, `timestamp` bigint(20) unsigned DEFAULT NULL, `error_code` varchar(255) DEFAULT NULL, `error_msg` varchar(255) DEFAULT NULL, `error_date` datetime DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `ix_core__position_app` (`app_id`), KEY `ix_core__position_user` (`user_id`), CONSTRAINT `fk_core__position_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`), CONSTRAINT `fk_core__position_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__notification_channel` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `display_name` varchar(255) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `ux_core__notification_channel_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__notification` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `user_id` bigint(20) unsigned NOT NULL, `event` text default NULL, `event_date` datetime(6) default NULL, `last_viewed_date` datetime(6) default NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE `ux_core__notification_uid` (`uid`), KEY `ix_core__notification_user` (`user_id`), CONSTRAINT `fk_core__notification_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__notification_delivery` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `notification_id` bigint(20) unsigned NOT NULL, `channel_id` bigint(20) unsigned NOT NULL, `code` varchar(255) NOT NULL, `delivered_date` datetime(6) default NULL, `viewed_date` datetime(6) default NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE `ux_core__notification_delivery_code` (`code`), KEY `ux_core__notification_delivery_notification` (`notification_id`), KEY `ix_core__notification_delivery_channel` (`channel_id`), CONSTRAINT `fk_core__notification_delivery_channel` FOREIGN KEY (`channel_id`) REFERENCES `core__notification_channel` (`id`) ON DELETE RESTRICT, CONSTRAINT `fk_core__notification_delivery_notification` FOREIGN KEY (`notification_id`) REFERENCES `core__notification` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- CREATE TABLE `core__support_message` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` varchar(255) NOT NULL, `app_id` bigint(20) unsigned DEFAULT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `first_name` varchar(255) DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `mobile_number` varchar(255) DEFAULT NULL, `message` varchar(4000) DEFAULT NULL, `hostname` varchar(255) DEFAULT NULL, `browser` varchar(512) DEFAULT NULL, `created_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `updated_date` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `ux_core__support_message_uid` (`uid`), KEY `ix_core__support_message_user` (`user_id`), KEY `ix_core__support_message_app` (`app_id`), CONSTRAINT `fk_core__support_message_app` FOREIGN KEY (`app_id`) REFERENCES `core__app` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_core__support_message_user` FOREIGN KEY (`user_id`) REFERENCES `core__user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------------------------- /*!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 */;
SET XACT_ABORT ON; GO IF NOT EXISTS(select a.name as TableName, b.name as IdentityColumn from sysobjects a inner join syscolumns b on a.id = b.id where columnproperty(a.id, b.name, 'isIdentity') = 1 and objectproperty(a.id, 'isTable') = 1 and a.name = 'County') BEGIN TRANSACTION; -- Batch 0 BEGIN TRY ALTER TABLE [dbo].[County] ADD id_temp int NULL; END TRY BEGIN CATCH PRINT 'Error Number: ' + str(error_number()) ; PRINT 'Line Number: ' + str(error_line()); PRINT error_message(); ROLLBACK TRANSACTION; END CATCH; GO -- Batch 1 BEGIN TRY -- Rollback transaction if error occurred IF (XACT_STATE()) = -1 BEGIN RAISERROR('The transaction is in an uncommittable state. Rolling back transaction.', 18, 3); END; -- Do not continue if the transaction was rolled back IF (XACT_STATE()) = 0 BEGIN RAISERROR('The transaction was rolled back.', 18, 1); END; UPDATE [dbo].[County] SET id_temp=Id; END TRY BEGIN CATCH PRINT 'Error Number: ' + str(error_number()) ; PRINT 'Line Number: ' + str(error_line()); PRINT error_message(); IF (XACT_STATE()) <> 0 BEGIN PRINT 'Rolling Back Transaction...'; ROLLBACK TRANSACTION; END; END CATCH; GO -- Batch 2 BEGIN TRY -- Rollback transaction if error occurred IF (XACT_STATE()) = -1 BEGIN RAISERROR('The transaction is in an uncommittable state. Rolling back transaction.', 18, 3); END; -- Do not continue if the transaction was rolled back IF (XACT_STATE()) = 0 BEGIN RAISERROR('The transaction was rolled back.', 18, 1); END; ALTER TABLE [dbo].[County] DROP CONSTRAINT [PK_County_Id]; ALTER TABLE [dbo].[County] DROP COLUMN Id; ALTER TABLE [dbo].[County] ADD Id int IDENTITY(1, 1) NOT NULL; ALTER TABLE [dbo].[County] ADD CONSTRAINT PK_County_Id PRIMARY KEY CLUSTERED (Id); SET IDENTITY_INSERT [dbo].[County] ON; DELETE FROM [dbo].[County] OUTPUT deleted.id_temp AS Id, deleted.CountyId, deleted.CountyName, deleted.SubcountyId, deleted.Subcountyname, deleted.WardId, deleted.WardName INTO [dbo].[County] (Id, CountyId, CountyName, SubcountyId, Subcountyname, WardId, WardName); SET IDENTITY_INSERT [dbo].[County] OFF; ALTER TABLE [dbo].[County] DROP COLUMN id_temp; DECLARE @maxid int; SELECT @maxid=MAX(Id) FROM [dbo].[County]; DBCC CHECKIDENT ("dbo.County", RESEED, @maxid) select * from [dbo].[County]; END TRY BEGIN CATCH PRINT 'Error Number: ' + str(error_number()) ; PRINT 'Line Number: ' + str(error_line()); PRINT error_message(); IF (XACT_STATE()) <> 0 BEGIN PRINT 'Rolling Back Transaction...'; ROLLBACK TRANSACTION; END; END CATCH; GO -- Commit transaction IF XACT_STATE() = 1 BEGIN COMMIT TRANSACTION; PRINT 'Transaction committed.'; END;
<gh_stars>0 ALTER DATABASE jjain2 CHARACTER SET utf8 COLLATE utf8_unicode_ci; DROP TABLE IF EXISTS articleTag; DROP TABLE IF EXISTS article; DROP TABLE IF EXISTS tag; DROP TABLE IF EXISTS author; CREATE TABLE author ( authorId BINARY(16) NOT NULL, authorAvatarUrl VARCHAR(250), authorActivationToken CHAR(32), authorEmail VARCHAR(128) NOT NULL, authorHash CHAR(97) NOT NULL, authorUsername VARCHAR(32) NOT NULL, UNIQUE(authorEmail), UNIQUE(authorUsername), INDEX (authorEmail), PRIMARY KEY(authorId) ); CREATE TABLE tag ( tagId BINARY(16) NOT NULL, tagName VARCHAR(32) NOT NULL, PRIMARY KEY (tagId, tagName) ); CREATE TABLE article ( articleId BINARY(16) NOT NULL, articleAuthorId BINARY(16) NOT NULL, articleContent BLOB(40000) NOT NULL, articleDate DATETIME(6) NOT NULL, articleImage VARCHAR(255), INDEX(articleAuthorId), FOREIGN KEY(articleAuthorId) REFERENCES author(authorId), PRIMARY KEY (articleId) ); CREATE TABLE articleTag( articleTagArticleId BINARY(16), articleTagTagId BINARY(16), INDEX (articleTagArticleId), INDEX (articleTagTagId), FOREIGN KEY (articleTagTagId) REFERENCES tag(tagId), FOREIGN KEY(articleTagArticleId) REFERENCES article(articleId), PRIMARY KEY (articleTagArticleId, articleTagTagId) ); INSERT INTO author(authorId, authorAvatarUrl, authorEmail, authorHash, authorUsername) VALUES (UNHEX("8a9<PASSWORD>3cf<PASSWORD>"), "https://www.google.com/", "<EMAIL>", "<PASSWORD>bf97a6597bab0c7852868d70999029faebe0a1f962503224c48", "jjain2"); INSERT INTO article(articleId, articleAuthorId) VALUES (UNHEX("5b0e3bf5a713456db9ee45a3dc311abf"), (UNHEX("8a915261d00543cf867eff24de15e991")));
<gh_stars>0 begin dbms_network_acl_admin.drop_acl( out_put, in_put ); end; /
-- -- headlines stylesheet category and classes -- \connect - jcms INSERT INTO updatelog (name,value) VALUES ('db_version','20100219'); -- STYLESHEET - rename email to headlines since email now deprecated UPDATE stylesheetcategories SET stylesheetcategory='headlines' WHERE stylesheetcategory_id=18; DELETE FROM stylesheet WHERE stylesheetcategory_id=18; -- headlines classes INSERT INTO stylesheet (class_id,class_name,class_value,num,required,level,level_num,stylesheetcategory_id) VALUES (300,'div.headlines','',1,true,0,0,18); INSERT INTO stylesheet (class_id,class_name,class_value,num,required,level,level_num,stylesheetcategory_id) VALUES (301,'div.headline','',2,true,0,0,18); INSERT INTO stylesheet (class_id,class_name,class_value,num,required,level,level_num,stylesheetcategory_id) VALUES (302,'a.headline:link','',3,true,0,0,18); INSERT INTO stylesheet (class_id,class_name,class_value,num,required,level,level_num,stylesheetcategory_id) VALUES (303,'a.headline:visited','',4,true,0,0,18); INSERT INTO stylesheet (class_id,class_name,class_value,num,required,level,level_num,stylesheetcategory_id) VALUES (304,'a.headline:hover','',5,true,0,0,18); INSERT INTO stylesheet (class_id,class_name,class_value,num,required,level,level_num,stylesheetcategory_id) VALUES (305,'a.headline:active','',6,true,0,0,18);
<filename>src/main/resources/data.sql INSERT INTO tbg_profile (id, profile_description) SELECT * FROM (SELECT 2, 'ROLE_ADMIN') AS tmp WHERE NOT EXISTS ( SELECT profile_description FROM tbg_profile WHERE profile_description = 'ROLE_ADMIN' ) LIMIT 1; INSERT INTO tbg_profile (id, profile_description) SELECT * FROM (SELECT 3, 'ROLE_USER') AS tmp WHERE NOT EXISTS ( SELECT profile_description FROM tbg_profile WHERE profile_description = 'ROLE_USER' ) LIMIT 1; INSERT INTO tbg_user (id, nome, login, email, senha) SELECT * FROM (SELECT 3, '<NAME>', 'ADMIN123', '<EMAIL>', '$2a$10$GWCbUih2hMNNYrFL7RR2BeNntk9IaOMJvaPR.qZY51uKLVAsob912') AS tmp WHERE NOT EXISTS ( SELECT login FROM tbg_user WHERE login = 'ADMIN123' ) LIMIT 1; INSERT INTO tbg_user_profile (id, user_id, autorization_id) SELECT * FROM (SELECT 1, 3, 2) AS tmp WHERE NOT EXISTS ( SELECT id FROM tbg_user_profile WHERE id = 1 ) LIMIT 1;
<filename>read_me.sql SELECT si.id, si.spectrum_id AS sid, pep1.seq_mods AS pep1, pep2.seq_mods AS pep2, pep1.link_site AS linkpos1, pep2.link_site AS linkpos2, si.charge_state AS charge, sp.frag_tol AS fragTolerance, si.pass_threshold, si.rank, si.ions, si.scores, pep1.crosslinker_modmass AS modmass1, pep2.crosslinker_modmass AS crosslinker_modmass, pep1_ev.decoy AS is_decoy1, pep2_ev.decoy AS is_decoy2, pep1_ev.protein AS protein1, pep2_ev.protein AS protein2, sp.peak_list_file_name AS file, sp.scan_id AS scan_id, si.spectrum_id AS peakList_id FROM spectrum_identifications AS si LEFT JOIN spectra AS sp ON (si.spectrum_id = sp.id) LEFT JOIN peptides AS pep1 ON (si.pep1_id = pep1.id) LEFT JOIN (SELECT peptide_ref, group_concat(DISTINCT protein_accession) AS protein, group_concat(DISTINCT is_decoy) AS decoy FROM peptide_evidences GROUP BY peptide_ref) AS pep1_ev ON (si.pep1_id = pep1_ev.peptide_ref) LEFT JOIN peptides AS pep2 ON (si.pep2_id = pep2.id) LEFT JOIN (SELECT peptide_ref, group_concat(DISTINCT protein_accession) AS protein, group_concat(DISTINCT is_decoy) AS decoy FROM peptide_evidences GROUP BY peptide_ref) AS pep2_ev ON (si.pep2_id = pep2_ev.peptide_ref)
DROP TABLE IF EXISTS clients; DROP TABLE IF EXISTS banned_users; CREATE TABLE clients ( ip TEXT PRIMARY KEY, username TEXT NOT NULL, drifter INTEGER NOT NULL DEFAULT 0, sort_number INTEGER NOT NULL ); CREATE TABLE banned_users ( username TEXT PRIMARY KEY );
insert into user (name,mic_code,github_code,update_time,create_time) values ('test','','',now(),now());
PRINT N'Create Sequences for Table Primary Keys' GO CREATE SEQUENCE [dbo].[PIMS_TENANT_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACCESS_REQUEST_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACCESS_REQUEST_ORGANIZATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACTIVITY_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACTIVITY_MODEL_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACTIVITY_MODEL_TASK_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACTIVITY_SERVICE_FILE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ACTIVITY_TASK_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ADDRESS_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_CLAIM_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_CONTACT_METHOD_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ORGANIZATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PERSON_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PERSON_ORGANIZATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROJECT_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROJECT_NOTE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROJECT_NUMBER_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROJECT_PROPERTY_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROJECT_WORKFLOW_MODEL_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROPERTY_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROPERTY_EVALUATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROPERTY_ACTIVITY_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROPERTY_ORGANIZATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROPERTY_PROPERTY_SERVICE_FILE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROPERTY_SERVICE_FILE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ROLE_CLAIM_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_ROLE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_TASK_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_TASK_TEMPLATE_ACTIVITY_MODEL_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_TASK_TEMPLATE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_USER_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_USER_ORGANIZATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_USER_ROLE_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_USER_TASK_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_WORKFLOW_MODEL_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO CREATE SEQUENCE [dbo].[PIMS_PROJECT_ORGANIZATION_ID_SEQ] AS BIGINT START WITH 0 INCREMENT BY 1 MINVALUE 0 MAXVALUE 2147483647 NO CYCLE CACHE 50 GO
--! Previous: sha1:2333ed9fff52a9fd530cbafcc8a7587b6c503b42 --! Hash: sha1:2a911af9cfb7fa75e232790171a67e59b722a836 -- Enter migration here alter table form_logic_conditions alter column value drop not null; create or replace function create_survey_jump_rule("formElementId" int, "jumpToId" int, "booleanOperator" form_logic_operator, "operator" field_rule_operator) returns form_logic_rules language plpgsql as $$ declare logic_rule form_logic_rules; begin insert into form_logic_rules (form_element_id, boolean_operator, command, jump_to_id) values ("formElementId", 'OR', 'JUMP', "jumpToId") returning * into logic_rule; insert into form_logic_conditions (rule_id, subject_id, operator) values (logic_rule.id, "formElementId", "operator"); return logic_rule; end; $$; grant execute on function create_survey_jump_rule to seasketch_user; comment on function create_survey_jump_rule is ' Initializes a new FormLogicRule with a single condition and command=JUMP. '; alter table form_elements add column if not exists jump_to_id int references form_elements(id) on delete set null; comment on column form_elements.jump_to_id is ' Used only in surveys. If set, the survey will advance to the page of the specified form element. If null, the survey will simply advance to the next question in the list by `position`. '; grant all on form_elements to seasketch_user; -- TODO: add post-delete rule to cleanup logic_rules that are empty
select (row_number() over (order by datum)) as covid_hospitalisation_id, 'CZ' as country_id, datum as covid_hospitalisation_date, pacient_prvni_zaznam as covid_hospitalisation_admissions, pocet_hosp as covid_hospitalisation_current, stav_bez_priznaku as covid_hospitalisation_no_symptoms, stav_lehky as covid_hospitalisation_light_symptoms, stav_stredni as covid_hospitalisation_medium_symptoms, stav_tezky as covid_hospitalisation_severe_symptoms, jip as covid_hospitalisation_intensive_care, kyslik as covid_hospitalisation_oxygen, hfno as covid_hospitalisation_hfno, upv as covid_hospitalisation_ventilation, ecmo as covid_hospitalisation_ecmo, tezky_upv_ecmo as covid_hospitalisation_ecmo_ventilation, umrti as covid_hospitalisation_deaths from ext_hospitalizace
USE SoftUni GO /* SELECT Salary FROM Employees GROUP BY Salary ORDER BY Salary ASC */ SELECT DISTINCT Salary FROM Employees ORDER BY Salary ASC
SELECT nummer, CASE WHEN ordnung LIKE 'LFP2%' THEN 2 WHEN ordnung LIKE 'LFP1%' THEN 1 ELSE 0 END AS kategorie, h02::numeric AS hoehe, lfp.geometrie, bfs_nr, ordnung, signatur, fineltra, proto_url AS protokoll FROM ${dbschema}.grundlagen_fpds AS lfp LEFT JOIN ${dbschema}.grundlagen_gemeindegrenzen AS gemeinde ON ST_Intersects(gemeinde.geometrie, lfp.geometrie) WHERE fineltra IN ('TSP1', 'TSP2') OR ordnung LIKE 'LFP1%' UNION ALL -- LPF3-TSP, die wir zu LFP2 upgraden (waren früher alles LFP2 und sind in LV95 bestimmt worden) SELECT lfp.aname AS nummer, 2 AS kategorie, lfp.hoehe, lfp.geometrie, gemeinde.bfs_nr, NULL::varchar AS ordnung, NULL::varchar AS signatur, NULL::varchar AS fineltra, NULL::varchar AS protokoll FROM ${dbschema}.berechnungen_tsp_ungleich_lfp2 AS lfp LEFT JOIN ${dbschema}.grundlagen_gemeindegrenzen AS gemeinde ON ST_Intersects(gemeinde.geometrie, lfp.geometrie) WHERE lfp.upgrade = true UNION ALL SELECT '11072357' AS nummer, 2 AS kategorie, 1399.330 AS hoehe, ST_PointFromText('POINT(2606757.520 1234122.210)', 2056) AS geometrie, 2522 AS bfs_nr, 'LFP2.Ordnung4' AS ordnung, 'Pyramide_Pfeiler' AS signatur, 'kein_TSP' AS fineltra, 'https://data.geo.admin.ch/ch.swisstopo.fixpunkte-lfp1/protokolle/LV03AV/1107/CH0300001107_11072357.pdf' AS protokoll -- Hohe Winde ist LFP1.Ordnung3 ;
<reponame>sayeedazmal/elearning<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 19, 2019 at 05:15 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `e_learn` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id` int(11) NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, `session` int(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `username`, `password`, `session`) VALUES (1, 'admin', 'admin123', 0), (2, 'molla', '<PASSWORD>', 0); -- -------------------------------------------------------- -- -- Table structure for table `course` -- CREATE TABLE `course` ( `course_id` int(20) NOT NULL, `coursename` varchar(50) NOT NULL, `courseno` varchar(50) NOT NULL, `coursetitle` varchar(50) NOT NULL, `courseimg` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `img` -- CREATE TABLE `img` ( `img_id` int(11) NOT NULL, `imagname` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `img` -- INSERT INTO `img` (`img_id`, `imagname`) VALUES (5, 'course_51.jpg'), (7, 'comment_2.jpg'), (8, 'comment_2.jpg'), (9, 'contact_background.jpg'), (10, 'course_8.jpg'), (11, 'event_2.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `lessons` -- CREATE TABLE `lessons` ( `lessonid` int(20) NOT NULL, `lessonname` varchar(50) NOT NULL, `lessontitle` varchar(50) NOT NULL, `description` varchar(50) NOT NULL, `video` varchar(50) NOT NULL, `link` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `login` -- CREATE TABLE `login` ( `log_id` int(50) NOT NULL, `name` varchar(50) NOT NULL, `password` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `quesresult` -- CREATE TABLE `quesresult` ( `resul_id` int(50) NOT NULL, `totalquestion` int(50) NOT NULL, `wrongans` int(50) NOT NULL, `trueans` int(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `question` -- CREATE TABLE `question` ( `question_id` int(50) NOT NULL, `quesdescription` varchar(50) NOT NULL, `ans1` varchar(50) NOT NULL, `ans2` varchar(50) NOT NULL, `ans3` varchar(50) NOT NULL, `ans4` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `quize` -- CREATE TABLE `quize` ( `quize_id` int(11) NOT NULL, `lessonid` int(11) NOT NULL, `question_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `student` -- CREATE TABLE `student` ( `st_id` int(50) NOT NULL, `firsname` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `lastname` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `fullname` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `password` int(11) NOT NULL, `confirmpass` int(11) NOT NULL, `address` int(11) NOT NULL, `phone` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `student` -- INSERT INTO `student` (`st_id`, `firsname`, `lastname`, `fullname`, `password`, `confirmpass`, `address`, `phone`) VALUES (1, 'sayeed', 'address', '<EMAIL>', 0, 0, 0, 0), (2, 'azmal', 'borishal', '<EMAIL>', 0, 0, 0, 0), (3, 'dad', 'afda', '<PASSWORD>', 0, 0, 0, 0), (4, 'dadda', 'dafa', 'afdaef', 0, 0, 0, 0), (5, 'MD. ABU SAYEED', 'yugbyubyubu', '<EMAIL>', 0, 0, 0, 0), (6, 'MD. ABU SAYEED', 'adaf', '<EMAIL>', 0, 0, 0, 0), (7, 'constructor', 'adaf', '01726879021', 0, 0, 0, 0), (8, 'constructor', 'adaf', '01726879021', 0, 0, 0, 0), (9, '', '', '', 0, 0, 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `teacher` -- CREATE TABLE `teacher` ( `tech_id` int(50) NOT NULL, `techname` varchar(50) NOT NULL, `designation` varchar(50) NOT NULL, `picture` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `teacher` -- INSERT INTO `teacher` (`tech_id`, `techname`, `designation`, `picture`) VALUES (1, 'daf', 'adf', 'uploads/become.jpg'), (2, '<NAME>', 'javaprogrammer', 'uploads/comment_1.jpg'), (3, 'ad', 'adf', 'uploads/course_4.jpg'), (4, 'daf', 'ad', 'uploads/course_1.jpg'), (5, 'daf', 'ad', 'uploads/course_11.jpg'), (6, 'daf', 'ad', 'uploads/course_12.jpg'), (7, 'daf', 'ad', 'uploads/course_13.jpg'), (9, '<NAME>', 'php', 'uploads/course_5.jpg'); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `course` -- ALTER TABLE `course` ADD PRIMARY KEY (`course_id`); -- -- Indexes for table `img` -- ALTER TABLE `img` ADD PRIMARY KEY (`img_id`); -- -- Indexes for table `lessons` -- ALTER TABLE `lessons` ADD PRIMARY KEY (`lessonid`); -- -- Indexes for table `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`log_id`); -- -- Indexes for table `quesresult` -- ALTER TABLE `quesresult` ADD PRIMARY KEY (`resul_id`); -- -- Indexes for table `question` -- ALTER TABLE `question` ADD PRIMARY KEY (`question_id`); -- -- Indexes for table `quize` -- ALTER TABLE `quize` ADD PRIMARY KEY (`quize_id`); -- -- Indexes for table `student` -- ALTER TABLE `student` ADD PRIMARY KEY (`st_id`); -- -- Indexes for table `teacher` -- ALTER TABLE `teacher` ADD PRIMARY KEY (`tech_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `course` -- ALTER TABLE `course` MODIFY `course_id` int(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `img` -- ALTER TABLE `img` MODIFY `img_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `lessons` -- ALTER TABLE `lessons` MODIFY `lessonid` int(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `login` -- ALTER TABLE `login` MODIFY `log_id` int(50) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `quesresult` -- ALTER TABLE `quesresult` MODIFY `resul_id` int(50) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `question` -- ALTER TABLE `question` MODIFY `question_id` int(50) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `quize` -- ALTER TABLE `quize` MODIFY `quize_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `student` -- ALTER TABLE `student` MODIFY `st_id` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `teacher` -- ALTER TABLE `teacher` MODIFY `tech_id` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
CREATE OR ALTER PROCEDURE [capture].[test update_only_captures_modified_columns] AS BEGIN ----------------------------------------------------------------------------------------------------------------- -- Arrange: ----------------------------------------------------------------------------------------------------------------- EXEC [tSQLt].[FakeTable] @TableName = N'dda.audits', @Identity = 1; EXEC [tSQLt].[FakeTable] @TableName = N'dbo.SortTable', @Identity = 1; EXEC [tSQLt].[ApplyTrigger] @TableName = N'dbo.SortTable', @TriggerName = N'ddat_SortTable'; ----------------------------------------------------------------------------------------------------------------- -- Act: ----------------------------------------------------------------------------------------------------------------- WITH multiples AS ( SELECT 27 [CustomerID], GETDATE() [OrderDate], 999.33 [Value], 'xxxx_xxxx' [ColChar] UNION ALL SELECT 28 [CustomerID], GETDATE() [OrderDate], 1187.33 [Value], 'yyyy_yyyy' [ColChar] UNION ALL SELECT 30 [CustomerID], GETDATE() [OrderDate], 2258.33 [Value], 'zzzzz_zzzz' [ColChar] UNION ALL SELECT 30 [CustomerID], GETDATE() [OrderDate], 2268.33 [Value], 'aaaa_aaaa' [ColChar] ) INSERT INTO [dbo].[SortTable] ( [CustomerID], [OrderDate], [Value], [ColChar] ) SELECT [CustomerID], [OrderDate], [Value], [ColChar] FROM [multiples]; UPDATE dbo.[SortTable] SET [Value] = 999.99 WHERE [OrderID] IN (1, 2); ----------------------------------------------------------------------------------------------------------------- -- Assert: ----------------------------------------------------------------------------------------------------------------- DECLARE @rowCount int = (SELECT [row_count] FROM dda.[audits] WHERE [audit_id] = 2); EXEC [tSQLt].[AssertEquals] @Expected = 2, @Actual = @rowCount; DECLARE @operation sysname = (SELECT [operation] FROM dda.[audits] WHERE [audit_id] = 2); EXEC [tSQLt].[AssertEqualsString] @Expected = N'UPDATE', @Actual = @operation; DECLARE @json nvarchar(MAX) = (SELECT [audit] FROM dda.[audits] WHERE [audit_id] = 2); WITH [result] AS ( SELECT [value] FROM OPENJSON(JSON_QUERY(@json, N'$[0].detail')) ) SELECT [x].[key] INTO #columns FROM [result] r CROSS APPLY OPENJSON(r.[value], N'$') x; DECLARE @count int = (SELECT COUNT(*) FROM [#columns] WHERE [key] IS NOT NULL); EXEC [tSQLt].[AssertEquals] @Expected = 1, @Actual = @count; DECLARE @value sysname; SELECT @value = [key] FROM [#columns] WHERE [key] = N'Value'; EXEC [tSQLt].[AssertEqualsString] @Expected = N'Value', @Actual = @value; END;
<reponame>lanka97/bightstar_enterprise -- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64) -- -- Host: localhost Database: empmgt -- ------------------------------------------------------ -- Server version 8.0.11 /*!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 */; 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 */; -- -- Dumping data for table `employee` -- LOCK TABLES `employee` WRITE; /*!40000 ALTER TABLE `employee` DISABLE KEYS */; INSERT INTO `employee` VALUES (27,'Hiruni ','Pabasara','1997-04-02','No.2890 , Stage 3 , Anuradhapura','<EMAIL>','+94718779855','975930599V'),(28,'Hasini ','Punsara','1990-10-17','No.21/1 , kaduwele Road , Malabe','<EMAIL>','+94775889633','905963242V'),(29,'Ajith','Perera','1968-10-18','No.2650 , Waliwite Road , Malabe ','<EMAIL>','+94715443255','687954122V'),(30,'Nuwani','Silva','1978-10-21','No.568 , Araliye Road , Galle','<EMAIL>','+94258776935','785469322V'),(31,'Namal','Dias','1983-08-17','No.25/4 , Temple Road , Mathara','<EMAIL>','+94719887845','835689477V'),(32,'Nimal','Gunewardhana','1986-06-17','No.8907 , Stage 2 , Anuradhapura','<EMAIL>','+94716554899','869741521V'),(33,'Sandali','Nethsari','1974-10-18','No.576/5 , Kaduwele Road , Malabe','<EMAIL>','+94114523147','749856255V'),(34,'Aruna','kamara','1988-07-13','No.5678 , Vijerama Road , Colombo 7','<EMAIL>','+94778996532','889654712V'),(35,'Madhu','Roxx','1970-05-19','No.258/4 , Palace Road , Rajagiriya','<EMAIL>','+94257889632','709865411V'),(36,'Pasindu','Senarathna','1983-12-14','No.7890 , Stage 3 , Kurunagala','<EMAIL>','+94112459865','867894574V'),(37,'Amal','Perera','1972-12-20','No.909 , Hospital Road , Kaluthara','<EMAIL>','+94718779658','725698555V'),(38,'Harsha','Perera','1986-10-17','No.2890 , Stage 3 , Anuradhapura','<EMAIL>','+94718779855','655930599V'); /*!40000 ALTER TABLE `employee` ENABLE KEYS */; UNLOCK TABLES; -- -- Dumping data for table `paysheet` -- LOCK TABLES `paysheet` WRITE; /*!40000 ALTER TABLE `paysheet` DISABLE KEYS */; INSERT INTO `paysheet` VALUES (1,'27','Hiruni ','2018-10-13','October','Employee','29','1000','1500','2500','28','3821800'),(2,'28','Hasini ','2018-10-13','October','Employee','50','1000','1200','2500','20','3602000'),(3,'29','Ajith','2018-10-13','October','Admin','52','2000','1000','1000','22','3765200'),(4,'30','Nuwani','2018-10-13','October','Secretary','53','1400','1200','1500','25','3589200'),(5,'31','Namal','2018-10-13','October','Employee','23','100','120','2500','25','259300'),(6,'32','Nimal','2018-10-13','October','Employee','39','25','20','100','25','13975'),(7,'33','Sandali','2018-10-13','October','Admin','24','1000','2000','1025','14','2945400'),(8,'34','Aruna','2018-10-13','October','Employee','20','1000','1000','2000','28','2812800'),(9,'35','Madhu','2018-10-13','October','Employee','20','1000','1050','2000','20','2922000'),(10,'36','Pasindu','2018-10-13','October','Employee','20','1000','1050','2050','28','2912800'),(11,'34','Aruna','2018-10-19','August','Employee','20','1000','1000','2000','28','2812800'); /*!40000 ALTER TABLE `paysheet` ENABLE KEYS */; UNLOCK TABLES; -- -- Dumping data for table `supplier` -- LOCK TABLES `supplier` WRITE; /*!40000 ALTER TABLE `supplier` DISABLE KEYS */; INSERT INTO `supplier` VALUES (12,'Hema Printers','No.233 , Temple Road , Panadura','<EMAIL>','+94115522639'),(13,'Gunarathna Bookshop','No.765/1 , Waliwite Road , Kaduwele','<EMAIL>','+94112254789'),(14,'Dammika Bookshop','No.456 , Galle Road , Colombo','<EMAIL>','+94114569328'),(15,'Star Printers','No.456 , Araliya Uyane Road , Kaduwele','<EMAIL>','+94112654879'),(16,'Mahanama Printers','No.567 , Jaffna Road , Jaffna','<EMAIL>','+94115487987'),(17,'Helakuru Bookshop','No.234 , Stage 3 , Anuradhapura','<EMAIL>','+94252224159'),(18,'Gamini Books','No.147/58 , Senanayaka Road , Mathara','<EMAIL>','+94254578965'),(19,'Bookstar','No.234 , Galle Road , Colombo','<EMAIL>','+94112456987'),(20,'Bookshelf','No.456/25 , Maliga Road , Kiribathgoda','<EMAIL>','+94115478963'),(21,'Sara Printers','No.456 , Eppawele Road , Anuradhapura','<EMAIL>','+94114578963'); /*!40000 ALTER TABLE `supplier` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2018-10-05 10:09:44
<reponame>AerisG222/mikeandwan.us<filename>src/maw_database_pg/005/funcs/maw.get_roles.sql CREATE OR REPLACE FUNCTION maw.get_roles ( _id SMALLINT DEFAULT NULL, _name VARCHAR(30) DEFAULT NULL ) RETURNS TABLE ( id SMALLINT, name VARCHAR(30), description VARCHAR(255) ) LANGUAGE SQL AS $$ SELECT id, name, description FROM maw.role WHERE (_id IS NULL OR id = _id) AND (_name IS NULL OR name = _name) ORDER BY name; $$; GRANT EXECUTE ON FUNCTION maw.get_roles TO website;
create database todolist; use todolist; create table tarefa( id int primary key, descricao varchar(36000), status_tarefa boolean default(false) ); ALTER TABLE `todolist`.`tarefa` CHANGE COLUMN `id` `id` INT NOT NULL AUTO_INCREMENT ;
CREATE OR REPLACE VIEW mountain_peak_label_z12toz14 AS SELECT id AS osm_id, elevation_m, name, name_fr, name_en, name_de, name_es, name_ru, name_zh, name_sv, type, geometry FROM osm_mountain_peak_point; CREATE OR REPLACE VIEW mountain_peak_label_layer AS ( SELECT osm_id FROM mountain_peak_label_z12toz14 ); CREATE OR REPLACE FUNCTION meter_to_feet(meter INTEGER) RETURNS INTEGER AS $$ BEGIN RETURN round(meter * 3.28084); END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION mountain_peak_type(type VARCHAR) RETURNS VARCHAR AS $$ BEGIN IF type = 'volcano' THEN RETURN type; ELSE RETURN 'mountain'; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE;
<reponame>rh24/code-libs CREATE TABLE IF NOT EXISTS stretch_games ( id SERIAL PRIMARY KEY, username VARCHAR(256), date_created TEXT, stretch_template_id INTEGER REFERENCES stretch_templates(id), lib_1 TEXT, lib_2 TEXT, lib_3 TEXT, lib_4 TEXT, lib_5 TEXT, lib_6 TEXT, lib_7 TEXT, lib_8 TEXT, lib_9 TEXT, lib_10 TEXT, votes INT DEFAULT 0 ); INSERT INTO stretch_games (username, date_created, stretch_template_id, lib_1, lib_2, lib_3, lib_4, lib_5, lib_6, lib_7, lib_8, lib_9, lib_10) VALUES ('rebecca', '9/24/2018', 2, 'BEDS', 'POST', 'PENCILS', 'DANUL', 'SLEEPING', 'SOFT', 'COMPUTER', 'CUP', 'SINGING', 'LOUD'); INSERT INTO stretch_games (username, date_created, stretch_template_id, lib_1, lib_2, lib_3, lib_4, lib_5, lib_6, lib_7, lib_8, lib_9, lib_10) VALUES ('richard', '9/24/2018', 2, 'COMPUTERS', 'GET', 'STICKERS', 'DANUL', 'WAVES', 'QUIET', 'COFFEE', 'MUG', 'RUNS', 'FAR');
-- MySQL Script generated by MySQL Workbench -- Wed Jan 16 22:12:41 2019 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; -- ----------------------------------------------------- -- Schema java_chat_server -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `java_chat_server` ; -- ----------------------------------------------------- -- Schema java_chat_server -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `java_chat_server` DEFAULT CHARACTER SET utf8 ; USE `java_chat_server` ; -- ----------------------------------------------------- -- Table `java_chat_server`.`benutzer` -- ----------------------------------------------------- DROP TABLE IF EXISTS `java_chat_server`.`benutzer` ; CREATE TABLE IF NOT EXISTS `java_chat_server`.`benutzer` ( `idLogin` INT NOT NULL AUTO_INCREMENT, `username` VARCHAR(45) NOT NULL, `password` VARCHAR(45) NOT NULL, `status` VARCHAR(45) NOT NULL, `lastonline` DATETIME NULL, PRIMARY KEY (`idLogin`), UNIQUE INDEX `username_UNIQUE` (`username` ASC) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `java_chat_server`.`raum` -- ----------------------------------------------------- DROP TABLE IF EXISTS `java_chat_server`.`raum` ; CREATE TABLE IF NOT EXISTS `java_chat_server`.`raum` ( `idRaum` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `typ` VARCHAR(45) NOT NULL, PRIMARY KEY (`idRaum`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `java_chat_server`.`message` -- ----------------------------------------------------- DROP TABLE IF EXISTS `java_chat_server`.`message` ; CREATE TABLE IF NOT EXISTS `java_chat_server`.`message` ( `idMsg` INT NOT NULL AUTO_INCREMENT, `nachricht` VARCHAR(255) NOT NULL, `datum` DATETIME NOT NULL, `benutzer_idLogin` INT NOT NULL, `raum_idRaum` INT NOT NULL, PRIMARY KEY (`idMsg`, `benutzer_idLogin`, `raum_idRaum`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `java_chat_server`.`benutzer_in_raum` -- ----------------------------------------------------- DROP TABLE IF EXISTS `java_chat_server`.`benutzer_in_raum` ; CREATE TABLE IF NOT EXISTS `java_chat_server`.`benutzer_in_raum` ( `benutzer_idLogin` INT NOT NULL, `raum_idRaum` INT NOT NULL, PRIMARY KEY (`benutzer_idLogin`, `raum_idRaum`)) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; -- ----------------------------------------------------- -- Data for table `java_chat_server`.`benutzer` -- ----------------------------------------------------- START TRANSACTION; USE `java_chat_server`; INSERT INTO `java_chat_server`.`benutzer` (`idLogin`, `username`, `password`, `status`, `lastonline`) VALUES (1, 'hans', '1234', 'online', NULL); INSERT INTO `java_chat_server`.`benutzer` (`idLogin`, `username`, `password`, `status`, `lastonline`) VALUES (2, 'adolf', '1234', 'abwesend', NULL); COMMIT; -- ----------------------------------------------------- -- Data for table `java_chat_server`.`raum` -- ----------------------------------------------------- START TRANSACTION; USE `java_chat_server`; INSERT INTO `java_chat_server`.`raum` (`idRaum`, `name`, `typ`) VALUES (1, 'boese sachen', 'privat'); INSERT INTO `java_chat_server`.`raum` (`idRaum`, `name`, `typ`) VALUES (2, 'home', 'privat'); INSERT INTO `java_chat_server`.`raum` (`idRaum`, `name`, `typ`) VALUES (3, 'test', 'öffentlich'); INSERT INTO `java_chat_server`.`raum` (`idRaum`, `name`, `typ`) VALUES (4, 'nix', 'privat'); COMMIT; -- ----------------------------------------------------- -- Data for table `java_chat_server`.`message` -- ----------------------------------------------------- START TRANSACTION; USE `java_chat_server`; INSERT INTO `java_chat_server`.`message` (`idMsg`, `nachricht`, `datum`, `benutzer_idLogin`, `raum_idRaum`) VALUES (1, 'Hello hai ich bin Adolf', '2019-01-16 12:54:30', 1, 1); INSERT INTO `java_chat_server`.`message` (`idMsg`, `nachricht`, `datum`, `benutzer_idLogin`, `raum_idRaum`) VALUES (2, 'huuhuhuh adholf', '2019-01-16 13:00:34', 2, 1); COMMIT; -- ----------------------------------------------------- -- Data for table `java_chat_server`.`benutzer_in_raum` -- ----------------------------------------------------- START TRANSACTION; USE `java_chat_server`; INSERT INTO `java_chat_server`.`benutzer_in_raum` (`benutzer_idLogin`, `raum_idRaum`) VALUES (1, 1); INSERT INTO `java_chat_server`.`benutzer_in_raum` (`benutzer_idLogin`, `raum_idRaum`) VALUES (1, 2); INSERT INTO `java_chat_server`.`benutzer_in_raum` (`benutzer_idLogin`, `raum_idRaum`) VALUES (1, 3); INSERT INTO `java_chat_server`.`benutzer_in_raum` (`benutzer_idLogin`, `raum_idRaum`) VALUES (2, 1); INSERT INTO `java_chat_server`.`benutzer_in_raum` (`benutzer_idLogin`, `raum_idRaum`) VALUES (2, 4); COMMIT;
SET LINESIZE 300 SET PAGESIZE 300 SET ECHO OFF SET FEEDBACK OFF SET TRIMSPOOL ON COLUMN sid FORMAT 9999 COLUMN sec FORMAT 9999999999 COLUMN event FORMAT A50 COLUMN p1 FORMAT 999999999999999 COLUMN wait_class FORMAT A25 COLUMN laddr FORMAT A30 COLUMN object FORMAT A50 SELECT w.sid, s.sql_id, w.event, w.wait_class, w.seconds_in_wait "sec", w.p1, w.p2, -- lpad(replace(to_char(W.P1,'XXXXXXXXX'),' ','0'),16,0) laddr NVL2(o.object_name, o.owner || '.' || o.object_name || '(' || o.object_type || ')', NULL) "object" FROM v$session_wait w, v$session s, v$process p, dba_objects o WHERE w.sid = s.sid AND s.paddr = p.addr AND w.event NOT IN ('pmon timer', 'smon timer', 'rdbms ipc message', 'wakeup time manager', 'jobq slave wait', 'PL/SQL lock timer') AND w.wait_class <> 'Idle' AND s.row_wait_obj# = o.object_id(+) ORDER BY w.seconds_in_wait, w.sid;
CREATE TABLE [Sales].[Orders] ( [Id] INT IDENTITY (1, 1) NOT NULL, [CustomerId] INT NOT NULL, [DateAndTime] DATETIME2 (0) NOT NULL, [OrderStatusId] TINYINT NOT NULL, [Comments] NVARCHAR (1000) NULL, CONSTRAINT [pk_Orders_nc_Id] PRIMARY KEY NONCLUSTERED ([Id] ASC), CONSTRAINT [fk_Orders_CustomerId_Customers_Id] FOREIGN KEY ([CustomerId]) REFERENCES [Marketing].[Customers] ([Id]), CONSTRAINT [fk_Orders_OrderStatusId_OrderStatuses_Id] FOREIGN KEY ([OrderStatusId]) REFERENCES [Lists].[OrderStatuses] ([Id]) ); GO CREATE NONCLUSTERED INDEX [ix_Orders_nc_nu_CustomerId] ON [Sales].[Orders]([CustomerId] ASC);
<gh_stars>1-10 CREATE TABLE [dbo].[Patients]( [PatientId] [int] IDENTITY(1,1), [SSN] [char](11) NOT NULL, [FirstName] [nvarchar](50) NULL, [LastName] [nvarchar](50) NULL, [MiddleName] [nvarchar](50) NULL, [StreetAddress] [nvarchar](50) NULL, [City] [nvarchar](50) NULL, [ZipCode] [char](5) NULL, [State] [char](2) NULL, [BirthDate] [date] NOT NULL PRIMARY KEY CLUSTERED ([PatientId] ASC) ON [PRIMARY] ); GO
alter table results add column p_rank int; update results left join ( select study_id, cpg, @rank := case when study_id = @last_study then @rank + 1 else 1 end as p_rank, @last_study := study_id from ( select study_id, cpg from results order by study_id, (p+0) asc ) as results_ordered join (select @rank := 1, @last_study := '') as init ) as results_p on results.study_id = results_p.study_id and results.cpg = results_p.cpg set results.p_rank = results_p.p_rank;
IF OBJECT_ID('config.get_custom_field_form_name') IS NOT NULL DROP FUNCTION config.get_custom_field_form_name; GO CREATE FUNCTION config.get_custom_field_form_name ( @table_name character varying ) RETURNS character varying BEGIN RETURN ( SELECT form_name FROM config.custom_field_forms WHERE table_name = @table_name ); END; GO
<reponame>wilfriedago/parkoo /** * @licence MIT Licence * @author <NAME> * @email <EMAIL> * Created: 27 déc. 2021 */ --Create database parkooDB CREATE DATABASE "parkooDB" WITH OWNER = postgres ENCODING = 'UTF8' CONNECTION LIMIT = -1; --Create parkooDB.caissiers CREATE TABLE public.caissiers ( caid integer NOT NULL, caname character varying(180) NOT NULL, PRIMARY KEY (caid) ); CREATE TABLE public.clients ( clid integer NOT NULL, clname character varying(120), clemail character varying(140), cltelephone character varying(40), PRIMARY KEY (clid) ); CREATE TABLE public.ventes ( veid character varying(40) NOT NULL, vedatevente date NOT NULL, veprix real NOT NULL DEFAULT 0, PRIMARY KEY (veid) ); CREATE SEQUENCE public."numVen" INCREMENT 1 START 1 OWNED BY ventes.veid; ALTER SEQUENCE public."numVen" OWNER TO postgres; CREATE TABLE public.voitures ( vonumserie character varying(40) NOT NULL, vomarque character varying(120), vomodele character varying(180), vocouleur character varying(80), voprixachat real DEFAULT 0, voprixvente real DEFAULT 0, PRIMARY KEY (vonumserie) ); GRANT ALL ON DATABASE "parkooDB" TO postgres; ALTER TABLE IF EXISTS public.clients OWNER to postgres; ALTER TABLE IF EXISTS public.ventes OWNER to postgres; ALTER TABLE IF EXISTS public.voitures OWNER to postgres; ALTER TABLE IF EXISTS public.caissiers OWNER to postgres;
<filename>resources/migrations_data/mig-enums-2019-03-06.sql COPY vetd.enums (id, idstr, created, updated, deleted, fsubtype, descr) FROM stdin; 558733581462 heypt0w4 2019-03-06 10:40:00.000-00 2019-03-06 10:40:00.000-00 \N e-yes-no Yes or No
<reponame>yasir2000/brown-bear DROP TABLE IF EXISTS plugin_taskboard_usage; CREATE TABLE IF NOT EXISTS plugin_taskboard_usage ( project_id INT(11) NOT NULL PRIMARY KEY, board_type VARCHAR(10) NOT NULL ); INSERT INTO plugin_taskboard_usage (project_id, board_type) SELECT group_id, 'taskboard' FROM `groups`, tuleap_installed_version WHERE tuleap_installed_version.version >= '11.10.99.159';
-- file:jsonb.sql ln:228 expect:true SELECT '[5]'::jsonb @> '[5]'
<filename>DBADashDB/dbo/Stored Procedures/InstanceVersionInfo_Get.sql CREATE PROC dbo.InstanceVersionInfo_Get( @InstanceIDs VARCHAR(MAX)=NULL ) AS DECLARE @Instances TABLE( InstanceID INT PRIMARY KEY ) IF @InstanceIDs IS NULL BEGIN INSERT INTO @Instances ( InstanceID ) SELECT InstanceID FROM dbo.Instances WHERE IsActive=1 END ELSE BEGIN INSERT INTO @Instances ( InstanceID ) SELECT value FROM STRING_SPLIT(@InstanceIDs,',') END; SELECT I.ConnectionID, I.InstanceDisplayName, I.SQLVersion, I.ProductVersion, I.Edition, I.EngineEdition, I.EditionID, I.ProductLevel, I.ProductUpdateLevel, I.ProductUpdateReference, I.ProductMajorVersion, I.ProductBuildType, I.ProductBuild, I.ResourceVersion, I.ResourceLastUpdateDateTime, I.LicenseType, I.NumLicenses, I.WindowsCaption, I.WindowsRelease, I.WindowsSKU, H.ChangedDate AS PatchDate FROM dbo.InstanceInfo I OUTER APPLY(SELECT TOP(1) H.ChangedDate FROM dbo.SQLPatchingHistory H WHERE H.InstanceID = I.InstanceID ORDER BY H.ChangedDate DESC ) H WHERE EXISTS(SELECT 1 FROM @Instances t WHERE t.InstanceID = I.InstanceID ) AND I.IsActive=1
<reponame>SkobelevIgor/stackexchange-xml-to-csv<gh_stars>10-100 -- Example of schema -- The schema does not include any indexes ( except PK's ) -- Users CREATE TABLE users ( id SERIAL PRIMARY KEY, account_id INTEGER, reputation INTEGER NOT NULL, views INTEGER DEFAULT 0, down_votes INTEGER DEFAULT 0, up_votes INTEGER DEFAULT 0, display_name VARCHAR(255) NOT NULL, location VARCHAR(512), profile_image_url VARCHAR(255), website_url VARCHAR(255), about_me TEXT, creation_date TIMESTAMP NOT NULL, last_access_date TIMESTAMP NOT NULL ); -- Posts CREATE TABLE posts ( id SERIAL PRIMARY KEY, owner_user_id INTEGER, last_editor_user_id INTEGER, post_type_id SMALLINT NOT NULL, accepted_answer_id INTEGER, score INTEGER NOT NULL, parent_id INTEGER, view_count INTEGER, answer_count INTEGER DEFAULT 0, comment_count INTEGER DEFAULT 0, owner_display_name VARCHAR(64), last_editor_display_name VARCHAR(64), title VARCHAR(512), tags VARCHAR(512), content_license VARCHAR(64) NOT NULL, body TEXT, favorite_count INTEGER, creation_date TIMESTAMP NOT NULL, community_owned_date TIMESTAMP, closed_date TIMESTAMP, last_edit_date TIMESTAMP, last_activity_date TIMESTAMP ); -- PostLinks CREATE TABLE post_links ( id SERIAL PRIMARY KEY, related_post_id INTEGER NOT NULL, post_id INTEGER NOT NULL, link_type_id SMALLINT NOT NULL, creation_date TIMESTAMP NOT NULL ); -- PostHistory CREATE TABLE post_history ( id SERIAL PRIMARY KEY, post_id INTEGER NOT NULL, user_id INTEGER, post_history_type_id SMALLINT NOT NULL, user_display_name VARCHAR(64), content_license VARCHAR(64), revision_guid uuid, text TEXT, comment TEXT, creation_date TIMESTAMP NOT NULL ); -- Comments CREATE TABLE comments ( id SERIAL PRIMARY KEY, post_id INTEGER NOT NULL, user_id INTEGER, score SMALLINT NOT NULL, content_license VARCHAR(64) NOT NULL, user_display_name VARCHAR(64), text TEXT, creation_date TIMESTAMP NOT NULL ); -- Votes CREATE TABLE votes ( id SERIAL PRIMARY KEY, user_id INTEGER, post_id INTEGER NOT NULL, vote_type_id SMALLINT NOT NULL, bounty_amount SMALLINT, creation_date TIMESTAMP NOT NULL ); -- Badges CREATE TABLE badges ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL, class SMALLINT NOT NULL, name VARCHAR(64) NOT NULL, tag_based BOOL NOT NULL, date TIMESTAMP NOT NULL ); -- Tags CREATE TABLE tags ( id SERIAL PRIMARY KEY, excerpt_post_id INTEGER, wiki_post_id INTEGER, tag_name VARCHAR(255) NOT NULL, count INTEGER DEFAULT 0 );
CREATE TABLE `tb_lvzjcjnwfj` ( `col_wfdgvtipop` binary(1) NOT NULL, `col_dhvowgmope` date, `col_ztgybltpcr` bit(42) DEFAULT b'0', `col_rfeddmkkmb` enum('enum_or_set_0','enum_or_set_1','enum_or_set_2') CHARACTER SET utf8mb4 NULL DEFAULT 'enum_or_set_0', CONSTRAINT symb_puisvgsxvj PRIMARY KEY (`col_wfdgvtipop`), UNIQUE `col_rfeddmkkmb` (`col_rfeddmkkmb`), UNIQUE INDEX `col_wfdgvtipop` (`col_wfdgvtipop`) ) DEFAULT CHARSET=utf8; RENAME TABLE `tb_lvzjcjnwfj` TO `tb_gwhtsxuovt`; RENAME TABLE `tb_gwhtsxuovt` TO `tb_gvuiytzqsi`; RENAME TABLE `tb_gvuiytzqsi` TO `tb_hjqdntirzd`; ALTER TABLE `tb_hjqdntirzd` ADD COLUMN `col_oirceeozit` mediumtext AFTER `col_wfdgvtipop`; ALTER TABLE `tb_hjqdntirzd` ADD COLUMN (`col_ckheruciet` blob(829823439), `col_mwlpdcpegm` char NULL); ALTER TABLE `tb_hjqdntirzd` ADD COLUMN (`col_okjyevogvl` integer NULL DEFAULT '1', `col_nperdtdonu` int(55) unsigned zerofill NOT NULL); ALTER TABLE `tb_hjqdntirzd` ADD COLUMN (`col_cawkxhaucp` tinyblob, `col_urbzxvvjju` binary(3) NULL); ALTER TABLE `tb_hjqdntirzd` CHARACTER SET = utf8mb4; ALTER TABLE `tb_hjqdntirzd` ADD UNIQUE KEY `uk_hrnnhxlode` (`col_urbzxvvjju`); ALTER TABLE `tb_hjqdntirzd` ADD UNIQUE (`col_mwlpdcpegm`, `col_nperdtdonu`); ALTER TABLE `tb_hjqdntirzd` ALTER `col_nperdtdonu` DROP DEFAULT; ALTER TABLE `tb_hjqdntirzd` CHANGE COLUMN `col_mwlpdcpegm` `col_dtiogubkiw` set ('enum_or_set_0','enum_or_set_1','enum_or_set_2') CHARACTER SET utf8mb4 NULL DEFAULT 'enum_or_set_0' AFTER `col_ckheruciet`; ALTER TABLE `tb_hjqdntirzd` CHANGE `col_nperdtdonu` `col_uwucrgteir` tinyint(120) DEFAULT '1'; ALTER TABLE `tb_hjqdntirzd` CHANGE `col_ztgybltpcr` `col_egpjhiepzh` smallint (0) DEFAULT '1'; ALTER TABLE `tb_hjqdntirzd` DROP `col_dhvowgmope`, DROP `col_wfdgvtipop`; ALTER TABLE `tb_hjqdntirzd` DROP COLUMN `col_urbzxvvjju`, DROP COLUMN `col_rfeddmkkmb`; ALTER TABLE `tb_hjqdntirzd` DROP `col_oirceeozit`, DROP `col_egpjhiepzh`; ALTER TABLE `tb_hjqdntirzd` DROP COLUMN `col_uwucrgteir`, DROP COLUMN `col_ckheruciet`;
<gh_stars>0 create table persons( person_id varchar(32) primary key, person_name varchar(32), person_age int, person_sex char(1), person_section varchar(200), person_position varchar(100) );
<reponame>irrenhaus/pushmearound_server CREATE TABLE users ( id SERIAL PRIMARY KEY, created_at date NOT NULL DEFAULT CURRENT_TIMESTAMP, last_modified_at date NOT NULL DEFAULT CURRENT_TIMESTAMP, last_sign_in_at date NOT NULL DEFAULT CURRENT_TIMESTAMP, username varchar(40) NOT NULL UNIQUE, first_name varchar(40), last_name varchar(40), email varchar(255) NOT NULL UNIQUE, email_confirmed boolean NOT NULL DEFAULT false, password varchar(255) NOT NULL );
/* Navicat MySQL Data Transfer Source Host : localhost:3306 Source Database : amdb Target Host : localhost:3306 Target Database : amdb Date: 2015-12-27 21:05:20 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for student -- ---------------------------- DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `sno` char(8) NOT NULL, `sname` varchar(20) NOT NULL, `spwd` varchar(20) NOT NULL, `avatar` varchar(20) NOT NULL DEFAULT 'default.png', PRIMARY KEY (`sno`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of student -- ---------------------------- INSERT INTO `student` VALUES ('13301081', '于瀚程', '111', 'default.png'); INSERT INTO `student` VALUES ('13301085', '周灿桢', '111', 'default.png'); INSERT INTO `student` VALUES ('13301087', '葛梦珍', '111', 'default.png'); INSERT INTO `student` VALUES ('13301089', '贾佩', '111', 'default.png');
<reponame>gerinka/EnhancedDocumentCreator insert into documentstructurerelation(DocumentTemplateId, StructureElementId) values (3, 168), (3, 169), (3, 170), (3, 171), (3, 172), (3, 173), (3, 174), (3, 175), (3, 176), (3, 177), (3, 178), (3, 179), (3, 180), (3, 181)
alter table EMAILTEMPLATES_EMAIL_TEMPLATE_FILE_DESCRIPTOR_LINK add constraint FK_EMATEMFILDES_ON_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID); alter table EMAILTEMPLATES_EMAIL_TEMPLATE_FILE_DESCRIPTOR_LINK add constraint FK_EMATEMFILDES_ON_FILE_DESCRIPTOR foreign key (FILE_DESCRIPTOR_ID) references SYS_FILE(ID);
<gh_stars>10-100 create table gx_access_key( oid integer not null identity(1,1), access_key uniqueidentifier not null, secret nvarchar(200) not null, is_active bit not null default 1, access_key_type integer, primary key(oid) ); create table gx_user_account_access_key_join( oid_user_account integer not null, oid_access_key integer not null, foreign key(oid_user_account) references gx_user_account(oid) on delete cascade, foreign key(oid_access_key) references gx_access_key(oid) on delete cascade ); create table gx_access_key_security_group_join( oid_access_key integer not null, oid_security_group integer not null, foreign key(oid_security_group) references gx_security_group(oid) on delete cascade, foreign key(oid_access_key) references gx_access_key(oid) on delete cascade ); create table gx_access_key_security_policy_join( oid_access_key integer not null, oid_security_policy integer not null, foreign key(oid_security_policy) references gx_security_policy(oid) on delete cascade, foreign key(oid_access_key) references gx_access_key(oid) on delete cascade ); create table gx_resource( oid integer not null identity(1,1), resource_name nvarchar(50), resource_desription nvarchar(100), is_active bit not null default 1, oid_namespace integer not null, foreign key(oid_namespace) references gx_namespace(oid), primary key(oid) ); create table gx_access_log( oid integer not null identity(1,1), oid_access_key integer not null, oid_resource integer not null, access_time datetime not null, is_success bit not null default 0, access_type integer not null, primary key(oid), foreign key(oid_access_key) references gx_access_key(oid) on delete cascade, foreign key(oid_resource) references gx_resource(oid) on delete cascade );
-- 505 Number of death records, by death_type_concept_id --insert into @results_schema.heracles_results (cohort_definition_id, analysis_id, stratum_1, count_value) select c1.cohort_definition_id, 505 as analysis_id, death_type_concept_id as stratum_1, cast( '' as varchar(1) ) as stratum_2, cast( '' as varchar(1) ) as stratum_3, cast( '' as varchar(1) ) as stratum_4, COUNT_BIG(distinct PERSON_ID) as count_value into #results_505 from @CDM_schema.death d1 inner join #HERACLES_cohort c1 on d1.person_id = c1.subject_id --{@cohort_period_only == 'true'}?{ WHERE d1.death_date>=c1.cohort_start_date and d1.death_date<=c1.cohort_end_date --} group by c1.cohort_definition_id, death_type_concept_id ;
create or replace package test_documentation_reporter as --%suite(ut_documentation_reporter) --%suitepath(utplsql.test_user.reporters) --%test(Report produces expected output) procedure report_produces_expected_out; end; /
-- Check if pg_stat_last_shoperation stores CREATE of global objects CREATE DATABASE shoperation; CREATE ROLE shoperation_user; SELECT count(*) FROM pg_stat_last_shoperation WHERE staactionname = 'CREATE' AND stasubtype = 'DATABASE' AND objid = (SELECT oid FROM pg_database WHERE datname = 'shoperation'); SELECT count(*) FROM pg_stat_last_shoperation WHERE staactionname = 'CREATE' AND stasubtype = 'ROLE' AND objid = (SELECT oid FROM pg_authid WHERE rolname = 'shoperation_user'); -- Check if pg_stat_last_shoperation stores ALTER SET of global objects ALTER DATABASE shoperation SET enable_seqscan TO on; ALTER ROLE shoperation_user SET enable_seqscan TO on; SELECT count(*) FROM pg_stat_last_shoperation WHERE staactionname = 'ALTER' AND stasubtype = 'SET' AND objid = (SELECT oid FROM pg_database WHERE datname = 'shoperation'); SELECT count(*) FROM pg_stat_last_shoperation WHERE staactionname = 'ALTER' AND stasubtype = 'SET' AND objid = (SELECT oid FROM pg_authid WHERE rolname = 'shoperation_user'); -- Check if ALTER ROLE IN DATABASE updates role object in pg_stat_last_shoperation SET allow_system_table_mods=true; DELETE FROM pg_stat_last_shoperation WHERE staactionname = 'ALTER' AND stasubtype = 'SET' AND objid = (SELECT oid FROM pg_authid WHERE rolname = 'shoperation_user'); RESET allow_system_table_mods; SELECT count(*) FROM pg_stat_last_shoperation WHERE staactionname = 'ALTER' AND stasubtype = 'SET' AND objid = (SELECT oid FROM pg_authid WHERE rolname = 'shoperation_user'); ALTER ROLE shoperation_user IN DATABASE shoperation SET enable_seqscan TO off; SELECT count(*) FROM pg_stat_last_shoperation WHERE staactionname = 'ALTER' AND stasubtype = 'SET' AND objid = (SELECT oid FROM pg_authid WHERE rolname = 'shoperation_user'); -- Clean up since we don't want these lingering DROP ROLE shoperation_user; DROP DATABASE shoperation;
<reponame>TTGS/IT_script<gh_stars>0 ERROR: invalid input syntax for type point: "" 2018-07-03 14:50:30| 分类: PostgreSQL | 标签:postgresql 案例 修复 今天接了一个大活,把开发存在mysql数据库里的坐标都导入到postgresql里,为后面的postgis做准备。开发存放坐标也是比较直接,直接一个字符类型就保存了坐标。 前面传过来的数据也是很规矩,经纬度,逗号分隔,不会给你偷摸多个空格什么的。 那我我这里就直接保存成point类型就好了。因为后面反正也是给postgis用,point类型后续的计算等事情就方便很多。 但是我在校验的时候报错了。 postgres=# select p::point from tpoint ; 2018-07-03 22:05:40.310 CST [4237] ERROR: invalid input syntax for type point: "" 2018-07-03 22:05:40.310 CST [4237] STATEMENT: select p::point from tpoint ; ERROR: invalid input syntax for type point: "" Time: 0.664 ms 这事是什么?莫名其妙的内容。什么都没有输出。 其实这个就和varchar中的null和''有关 , 如果只是NULL,那么这个可以直接转换成point内容,但是如果插入的是'',那么恭喜你,这个是一个不可隐式转换方式。 我们可以使用case进行换话一下。 postgres=# select case when p='' then null else p end ::point from tpoint ; p ------------------------------------ (116.590185016394,39.803132322094) (2 rows) Time: 8.204 ms ''是varchar中一种比较特殊的NULL,看上去和NULL没什么区别,但是这个''经常是不能与其他类型兼容的内容。 例如: postgres=# select ''::int ; 2018-07-03 22:47:47.525 CST [4237] ERROR: invalid input syntax for integer: "" at character 8 2018-07-03 22:47:47.525 CST [4237] STATEMENT: select ''::int ; ERROR: invalid input syntax for integer: "" LINE 1: select ''::int ; ^ Time: 0.288 ms 但是NULL就不会有这样的问题。 postgres=# select null::int , null::point ; int4 | point ------+------- | (1 row) Time: 0.279 ms postgres=#
DELETE FROM poll WHERE id = $1;
<reponame>afdmoraes/Server CREATE DATABASE ELIBRAS; CREATE TABLE publicacoes( publicacao_id SERIAL PRIMARY KEY, descricao varchar(255), )
INSERT INTO `district` VALUES (1,'Bad Cannstatt'),(2,'Birkach'),(3,'Botnang'),(4,'Degerloch'),(5,'Feuerbach'),(6,'Hedelfingen'),(7,'Möhringen'),(8,'Mühlhausen'),(9,'Münster'),(10,'Obertürkheim'),(11,'Plieningen'),(12,'Sillenbuch'),(13,'Stammheim'),(14,'Stuttgart‐Mitte'),(15,'Stuttgart‐Nord'),(16,'Stuttgart‐Ost'),(17,'Stuttgart‐Süd'),(18,'Stuttgart‐West'),(19,'Untertürkheim'),(20,'Vaihingen'),(21,'Wangen'),(22,'Weilimdorf'),(23,'Zuffenhausen');
/* SQLyog Enterprise v12.4.3 (64 bit) MySQL - 10.1.13-MariaDB : Database - auth ********************************************************************* */ /*Table structure for table `aauth_group_to_group` */ DROP TABLE IF EXISTS `aauth_group_to_group`; CREATE TABLE `aauth_group_to_group` ( `group_id` int(11) unsigned NOT NULL, `subgroup_id` int(11) unsigned NOT NULL, PRIMARY KEY (`group_id`,`subgroup_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `aauth_group_to_group` */ /*Table structure for table `aauth_groups` */ DROP TABLE IF EXISTS `aauth_groups`; CREATE TABLE `aauth_groups` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(100) DEFAULT NULL, `definition` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; /*Data for the table `aauth_groups` */ insert into `aauth_groups`(`id`,`name`,`definition`) values (1,'Admin','Super Admin Group'), (2,'Public','Public Access Group'), (3,'Default','Default Access Group'), (5,'DSM','dsm group'); /*Table structure for table `aauth_login_attempts` */ DROP TABLE IF EXISTS `aauth_login_attempts`; CREATE TABLE `aauth_login_attempts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ip_address` varchar(39) DEFAULT '0', `timestamp` datetime DEFAULT NULL, `login_attempts` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `aauth_login_attempts` */ /*Table structure for table `aauth_perm_to_group` */ DROP TABLE IF EXISTS `aauth_perm_to_group`; CREATE TABLE `aauth_perm_to_group` ( `perm_id` int(11) unsigned NOT NULL, `group_id` int(11) unsigned NOT NULL, PRIMARY KEY (`perm_id`,`group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `aauth_perm_to_group` */ insert into `aauth_perm_to_group`(`perm_id`,`group_id`) values (1,5), (2,2), (2,5), (4,2); /*Table structure for table `aauth_perm_to_user` */ DROP TABLE IF EXISTS `aauth_perm_to_user`; CREATE TABLE `aauth_perm_to_user` ( `perm_id` int(11) unsigned NOT NULL, `user_id` int(11) unsigned NOT NULL, PRIMARY KEY (`perm_id`,`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `aauth_perm_to_user` */ /*Table structure for table `aauth_perms` */ DROP TABLE IF EXISTS `aauth_perms`; CREATE TABLE `aauth_perms` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(100) DEFAULT NULL, `definition` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*Data for the table `aauth_perms` */ insert into `aauth_perms`(`id`,`name`,`definition`) values (1,'add_post','Post'), (2,'change_post','Post'), (4,'delete_post','Post'); /*Table structure for table `aauth_pms` */ DROP TABLE IF EXISTS `aauth_pms`; CREATE TABLE `aauth_pms` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `sender_id` int(11) unsigned NOT NULL, `receiver_id` int(11) unsigned NOT NULL, `title` varchar(255) NOT NULL, `message` text, `date_sent` datetime DEFAULT NULL, `date_read` datetime DEFAULT NULL, `pm_deleted_sender` int(1) DEFAULT NULL, `pm_deleted_receiver` int(1) DEFAULT NULL, PRIMARY KEY (`id`), KEY `full_index` (`id`,`sender_id`,`receiver_id`,`date_read`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `aauth_pms` */ /*Table structure for table `aauth_user_to_group` */ DROP TABLE IF EXISTS `aauth_user_to_group`; CREATE TABLE `aauth_user_to_group` ( `user_id` int(11) unsigned NOT NULL, `group_id` int(11) unsigned NOT NULL, PRIMARY KEY (`user_id`,`group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `aauth_user_to_group` */ insert into `aauth_user_to_group`(`user_id`,`group_id`) values (1,1), (1,3), (2,3); /*Table structure for table `aauth_user_variables` */ DROP TABLE IF EXISTS `aauth_user_variables`; CREATE TABLE `aauth_user_variables` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) unsigned NOT NULL, `data_key` varchar(100) NOT NULL, `value` text, PRIMARY KEY (`id`), KEY `user_id_index` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `aauth_user_variables` */ /*Table structure for table `aauth_users` */ DROP TABLE IF EXISTS `aauth_users`; CREATE TABLE `aauth_users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(100) NOT NULL, `pass` varchar(64) NOT NULL, `username` varchar(100) DEFAULT NULL, `banned` tinyint(1) DEFAULT '0', `last_login` datetime DEFAULT NULL, `last_activity` datetime DEFAULT NULL, `date_created` datetime DEFAULT NULL, `forgot_exp` text, `remember_time` datetime DEFAULT NULL, `remember_exp` text, `verification_code` text, `totp_secret` varchar(16) DEFAULT NULL, `ip_address` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*Data for the table `aauth_users` */ insert into `aauth_users`(`id`,`email`,`pass`,`username`,`banned`,`last_login`,`last_activity`,`date_created`,`forgot_exp`,`remember_time`,`remember_exp`,`verification_code`,`totp_secret`,`ip_address`) values (1,'<EMAIL>','<PASSWORD>','Admin',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0'), (2,'<EMAIL>','<PASSWORD>','ta<PASSWORD>ana',0,NULL,NULL,'2018-04-09 13:18:30',NULL,NULL,NULL,NULL,NULL,NULL); /*Table structure for table `tbl_app_log` */ DROP TABLE IF EXISTS `tbl_app_log`; CREATE TABLE `tbl_app_log` ( `ser_id` int(11) NOT NULL AUTO_INCREMENT, `log_name` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `created_by` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT 'created by user: from session', `log_detail` text COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci, `created_on` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`ser_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Data for the table `tbl_app_log` */ /*Table structure for table `tbl_menu` */ DROP TABLE IF EXISTS `tbl_menu`; CREATE TABLE `tbl_menu` ( `ser_id` int(8) NOT NULL AUTO_INCREMENT, `menu_label` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `menu_url` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL, `menu_icon` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `parent_menu` int(8) DEFAULT NULL, `menu_level` int(6) NOT NULL DEFAULT '0', PRIMARY KEY (`ser_id`), KEY `fk_tbl_menu_parent_menu_id` (`parent_menu`), CONSTRAINT `fk_tbl_menu_parent_menu_id` FOREIGN KEY (`parent_menu`) REFERENCES `tbl_menu` (`ser_id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Data for the table `tbl_menu` */ insert into `tbl_menu`(`ser_id`,`menu_label`,`menu_url`,`menu_icon`,`parent_menu`,`menu_level`) values (2,'Admin Console','#','fa-cog',NULL,1), (3,'Group','auth/group',NULL,2,3), (4,'User','auth/user',NULL,2,2), (6,'Menu','auth/menu',NULL,2,0), (7,'Home',NULL,'fa-home',NULL,0), (8,'Permission','auth/permission',NULL,2,0); /*Table structure for table `tbl_menu_to_group` */ DROP TABLE IF EXISTS `tbl_menu_to_group`; CREATE TABLE `tbl_menu_to_group` ( `ser_id` int(10) NOT NULL AUTO_INCREMENT, `group_id` int(11) unsigned NOT NULL, `menu_id` int(8) NOT NULL, PRIMARY KEY (`ser_id`), KEY `fk_aauth_groups_id` (`group_id`), KEY `fk_tbl_menu_ser_id` (`menu_id`), CONSTRAINT `fk_aauth_groups_id` FOREIGN KEY (`group_id`) REFERENCES `aauth_groups` (`id`), CONSTRAINT `fk_tbl_menu_ser_id` FOREIGN KEY (`menu_id`) REFERENCES `tbl_menu` (`ser_id`) ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Data for the table `tbl_menu_to_group` */ insert into `tbl_menu_to_group`(`ser_id`,`group_id`,`menu_id`) values (34,5,2), (35,5,4), (36,5,6), (37,5,7);
# ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: mrvir.com (MySQL 5.7.18-0ubuntu0.16.04.1) # Database: chaos # Generation Time: 2017-05-10 17:23:52 +0000 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Dump of table users # ------------------------------------------------------------ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(11) unsigned NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `queue` tinyint(1) NOT NULL DEFAULT 0, `relationship` bigint(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
DELETE FROM [semanticinsight].[process] DELETE FROM [semanticinsight].[data_type] DELETE FROM [semanticinsight].[load_pattern_attribute] DELETE FROM [semanticinsight].[system_framework_attribute] DELETE FROM [semanticinsight].[load_pattern] DELETE FROM [semanticinsight].[system_framework] DELETE FROM [semanticinsight].[data_object_type]
<gh_stars>1-10 ------------------------------------ADDING FEATURE STARTS------------------------ INSERT INTO eg_feature(ID,NAME,DESCRIPTION,MODULE) VALUES (NEXTVAL('seq_eg_feature'),'Common Search Application','Common Search Application',(select id from eg_module where name='Common')); ------------------------------------ADDING FEATURE ENDS------------------------ ------------------------------------ADDING FEATURE ACTION STARTS------------------------ INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ElasiticapplicationSearch') ,(select id FROM eg_feature WHERE name = 'Common Search Application')); INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'autopopulateApplicationType') ,(select id FROM eg_feature WHERE name = 'Common Search Application')); ------------------------------------ADDING FEATURE ACTION ENDS------------------------ ------------------------------------ADDING FEATURE ROLE STARTS------------------------ INSERT INTO eg_feature_role (ROLE, FEATURE) VALUES ((select id from eg_role where name = 'WC_VIEW_ACCESS_ROLE') ,(select id FROM eg_feature WHERE name = 'Common Search Application')); ------------------------------------ADDING FEATURE ROLE ENDS------------------------
<filename>Employee Names.sql -- https://www.hackerrank.com/challenges/name-of-employees/problem SELECT name FROM employee ORDER BY name;
DROP TABLE IF EXISTS `XXX_galerie_bilder`; ##b_dump## CREATE TABLE `XXX_galerie_bilder` ( `bild_id` bigint(20) NOT NULL AUTO_INCREMENT, `bild_datei` varchar(255) NOT NULL, `bild_gal_id` bigint(20) NOT NULL, `bild_nummer` int(11) NOT NULL, `bild_format` varchar(50) NOT NULL, `bild_breite` int(11) NOT NULL, `bild_breite_thumb` int(11) NOT NULL, `bild_hoehe` int(11) NOT NULL, `bild_hoehe_thumb` int(11) NOT NULL, `bild_diashow_timeout` int(11) NOT NULL DEFAULT '5', PRIMARY KEY (`bild_id`), KEY `bild_gal_id` (`bild_gal_id`), KEY `bild_nummer` (`bild_nummer`) ) ENGINE=MyISAM AUTO_INCREMENT=416 DEFAULT CHARSET=latin1 ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='1', bild_datei='../../../bilder/kein_bild.gif', bild_gal_id='0', bild_nummer='0', bild_format='GIF', bild_breite='100', bild_breite_thumb='100', bild_hoehe='30', bild_hoehe_thumb='30', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='24', bild_datei='asteroids.png', bild_gal_id='11', bild_nummer='2', bild_format='PNG', bild_breite='150', bild_breite_thumb='120', bild_hoehe='114', bild_hoehe_thumb='91', bild_diashow_timeout='10' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='25', bild_datei='invaders.png', bild_gal_id='11', bild_nummer='3', bild_format='PNG', bild_breite='150', bild_breite_thumb='120', bild_hoehe='133', bild_hoehe_thumb='106', bild_diashow_timeout='10' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='26', bild_datei='pacman.png', bild_gal_id='11', bild_nummer='4', bild_format='PNG', bild_breite='150', bild_breite_thumb='120', bild_hoehe='134', bild_hoehe_thumb='107', bild_diashow_timeout='10' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='27', bild_datei='tetris.png', bild_gal_id='11', bild_nummer='5', bild_format='PNG', bild_breite='150', bild_breite_thumb='120', bild_hoehe='149', bild_hoehe_thumb='119', bild_diashow_timeout='10' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='28', bild_datei='snake.png', bild_gal_id='11', bild_nummer='6', bild_format='PNG', bild_breite='150', bild_breite_thumb='120', bild_hoehe='119', bild_hoehe_thumb='95', bild_diashow_timeout='10' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='364', bild_datei='Tasse_AppleLogo2.jpg', bild_gal_id='11', bild_nummer='7', bild_format='JPG', bild_breite='500', bild_breite_thumb='120', bild_hoehe='333', bild_hoehe_thumb='80', bild_diashow_timeout='20' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='393', bild_datei='logo.gif', bild_gal_id='11', bild_nummer='1', bild_format='GIF', bild_breite='271', bild_breite_thumb='120', bild_hoehe='140', bild_hoehe_thumb='62', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='394', bild_datei='027.jpg', bild_gal_id='12', bild_nummer='1', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='395', bild_datei='035.jpg', bild_gal_id='12', bild_nummer='2', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='396', bild_datei='037.jpg', bild_gal_id='12', bild_nummer='3', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='397', bild_datei='043.jpg', bild_gal_id='12', bild_nummer='4', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='398', bild_datei='045.jpg', bild_gal_id='12', bild_nummer='5', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='399', bild_datei='049.jpg', bild_gal_id='12', bild_nummer='6', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='400', bild_datei='053.jpg', bild_gal_id='12', bild_nummer='7', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='401', bild_datei='067.jpg', bild_gal_id='12', bild_nummer='8', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='402', bild_datei='082.jpg', bild_gal_id='12', bild_nummer='9', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='403', bild_datei='134.jpg', bild_gal_id='12', bild_nummer='10', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='404', bild_datei='136.jpg', bild_gal_id='12', bild_nummer='11', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='405', bild_datei='194.jpg', bild_gal_id='12', bild_nummer='12', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='406', bild_datei='195.jpg', bild_gal_id='12', bild_nummer='13', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='407', bild_datei='212.jpg', bild_gal_id='12', bild_nummer='14', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='408', bild_datei='215.jpg', bild_gal_id='12', bild_nummer='15', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='409', bild_datei='228.jpg', bild_gal_id='12', bild_nummer='16', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='410', bild_datei='243.jpg', bild_gal_id='12', bild_nummer='17', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='411', bild_datei='248.jpg', bild_gal_id='12', bild_nummer='18', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='412', bild_datei='252.jpg', bild_gal_id='12', bild_nummer='19', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='413', bild_datei='254.jpg', bild_gal_id='12', bild_nummer='20', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='414', bild_datei='258.jpg', bild_gal_id='12', bild_nummer='21', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## INSERT INTO `XXX_galerie_bilder` SET bild_id='415', bild_datei='268.jpg', bild_gal_id='12', bild_nummer='22', bild_format='JPG', bild_breite='2560', bild_breite_thumb='120', bild_hoehe='1920', bild_hoehe_thumb='90', bild_diashow_timeout='5' ; ##b_dump## DROP TABLE IF EXISTS `XXX_galerie_bilder_language`; ##b_dump## CREATE TABLE `XXX_galerie_bilder_language` ( `bildlang_bild_id` bigint(20) NOT NULL, `bildlang_lang_id` int(11) NOT NULL, `bildlang_name` varchar(255) NOT NULL, `bildlang_beschreibung` longtext NOT NULL, PRIMARY KEY (`bildlang_bild_id`, `bildlang_lang_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='1', bildlang_lang_id='1', bildlang_name='kein Bild', bildlang_beschreibung='Kein Bild' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='1', bildlang_lang_id='2', bildlang_name='no picture', bildlang_beschreibung='no picture' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='24', bildlang_lang_id='2', bildlang_name='Asteroids', bildlang_beschreibung='You have to navigate your little spaceship through a field of asteroids. Dont bump on one of them, better shot them before they damage your spaceship.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='25', bildlang_lang_id='1', bildlang_name='Space-Invaders', bildlang_beschreibung='Es gilt eine Invasion von außeridischen Raumschiffen aufzuhalten. Mit marzialischer Gewalt versteht sich, durch abschießen also.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='26', bildlang_lang_id='1', bildlang_name='PacMan', bildlang_beschreibung='Der Spieler manövriert durch ein Labyrinth, welches von gefräsigen Monstern nur so wimmelt. Es gilt dabei das Gesetz \"Fressen und gefressen werden\".' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='27', bildlang_lang_id='1', bildlang_name='Tetris', bildlang_beschreibung='Geometrische Objekte müssen während dem Herabfallen so positioniert werden, dass eine Reihe komplett gefüllt wird. Zu allem Übel muß das immer schneller geschehen, da sich die Spielgeschwindigkeit immer weiter steigert.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='28', bildlang_lang_id='2', bildlang_name='Snake', bildlang_beschreibung='A game for two persons. Your snake has to eat everything to grow. But do not bump into the other snake or you will die.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='364', bildlang_lang_id='1', bildlang_name='\"Täs\'sche Tee\"', bildlang_beschreibung='Dieses Bild hat nun mal überhaupt nichts mit Spielen zu tun.\r\n\r\nIst einfach ein Bild, welches etwas größer ist als die anderen Bilder.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='364', bildlang_lang_id='2', bildlang_name='Cup of Tea', bildlang_beschreibung='No game, just a cup of tea in a nice cup :-)' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='393', bildlang_lang_id='1', bildlang_name='Startbild der Galerie \"Spiele-Klassiker\" \'§$%\'', bildlang_beschreibung='Logo der Bilder-Reihe \"Spiele-Klassiker\" \'§$%\'\r\n\r\n.. siehe auch <a href=\"http://www.ximix.de\" target=\"_blank\">XiMiX.de</a>' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='26', bildlang_lang_id='2', bildlang_name='PacMan', bildlang_beschreibung='You have to navigate through a labyrinth. But be carefull, there are monster that want to kill you.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='24', bildlang_lang_id='1', bildlang_name='Asteroids', bildlang_beschreibung='Mit einem kleinen Raumschiff muß kollisionsfrei durch ein Asteroiden-Feld manövriert werden. Natürlich darf dabei auch auf den ein oder anderen Asteroiden geschoßen werden.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='25', bildlang_lang_id='2', bildlang_name='Space-Invaders', bildlang_beschreibung='Invasion from outer space. KILL ALL THE ALIENS!!' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='27', bildlang_lang_id='2', bildlang_name='Tetris', bildlang_beschreibung='You have to order geometric figures to fill a line. hurry up! the game will get faster and faster and faster and..' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='28', bildlang_lang_id='1', bildlang_name='Snake', bildlang_beschreibung='Ein Spiel für Zwei. Jeder der Spieler versucht dabei so viel zu Fressen wie nur Möglich, damit die eigene Schlange immer weiter wächst. Trifft man jedoch auf die gegnerische Schlange, so hat man sofort verloren.' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='393', bildlang_lang_id='2', bildlang_name='Logo', bildlang_beschreibung='Start-picture for the picture-galerie \"computer-games\"' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='394', bildlang_lang_id='1', bildlang_name='027.jpg', bildlang_beschreibung='027.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='394', bildlang_lang_id='2', bildlang_name='027.jpg', bildlang_beschreibung='027.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='395', bildlang_lang_id='1', bildlang_name='035.jpg', bildlang_beschreibung='035.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='395', bildlang_lang_id='2', bildlang_name='035.jpg', bildlang_beschreibung='035.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='396', bildlang_lang_id='1', bildlang_name='037.jpg', bildlang_beschreibung='037.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='396', bildlang_lang_id='2', bildlang_name='037.jpg', bildlang_beschreibung='037.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='397', bildlang_lang_id='1', bildlang_name='043.jpg', bildlang_beschreibung='043.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='397', bildlang_lang_id='2', bildlang_name='043.jpg', bildlang_beschreibung='043.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='398', bildlang_lang_id='1', bildlang_name='045.jpg', bildlang_beschreibung='045.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='398', bildlang_lang_id='2', bildlang_name='045.jpg', bildlang_beschreibung='045.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='399', bildlang_lang_id='1', bildlang_name='049.jpg', bildlang_beschreibung='049.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='399', bildlang_lang_id='2', bildlang_name='049.jpg', bildlang_beschreibung='049.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='400', bildlang_lang_id='1', bildlang_name='053.jpg', bildlang_beschreibung='053.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='400', bildlang_lang_id='2', bildlang_name='053.jpg', bildlang_beschreibung='053.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='401', bildlang_lang_id='1', bildlang_name='067.jpg', bildlang_beschreibung='067.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='401', bildlang_lang_id='2', bildlang_name='067.jpg', bildlang_beschreibung='067.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='402', bildlang_lang_id='1', bildlang_name='082.jpg', bildlang_beschreibung='082.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='402', bildlang_lang_id='2', bildlang_name='082.jpg', bildlang_beschreibung='082.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='403', bildlang_lang_id='1', bildlang_name='134.jpg', bildlang_beschreibung='134.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='403', bildlang_lang_id='2', bildlang_name='134.jpg', bildlang_beschreibung='134.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='404', bildlang_lang_id='1', bildlang_name='136.jpg', bildlang_beschreibung='136.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='404', bildlang_lang_id='2', bildlang_name='136.jpg', bildlang_beschreibung='136.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='405', bildlang_lang_id='1', bildlang_name='194.jpg', bildlang_beschreibung='194.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='405', bildlang_lang_id='2', bildlang_name='194.jpg', bildlang_beschreibung='194.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='406', bildlang_lang_id='1', bildlang_name='195.jpg', bildlang_beschreibung='195.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='406', bildlang_lang_id='2', bildlang_name='195.jpg', bildlang_beschreibung='195.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='407', bildlang_lang_id='1', bildlang_name='212.jpg', bildlang_beschreibung='212.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='407', bildlang_lang_id='2', bildlang_name='212.jpg', bildlang_beschreibung='212.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='408', bildlang_lang_id='1', bildlang_name='215.jpg', bildlang_beschreibung='215.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='408', bildlang_lang_id='2', bildlang_name='215.jpg', bildlang_beschreibung='215.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='409', bildlang_lang_id='1', bildlang_name='228.jpg', bildlang_beschreibung='228.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='409', bildlang_lang_id='2', bildlang_name='228.jpg', bildlang_beschreibung='228.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='410', bildlang_lang_id='1', bildlang_name='243.jpg', bildlang_beschreibung='243.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='410', bildlang_lang_id='2', bildlang_name='243.jpg', bildlang_beschreibung='243.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='411', bildlang_lang_id='1', bildlang_name='248.jpg', bildlang_beschreibung='248.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='411', bildlang_lang_id='2', bildlang_name='248.jpg', bildlang_beschreibung='248.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='412', bildlang_lang_id='1', bildlang_name='252.jpg', bildlang_beschreibung='252.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='412', bildlang_lang_id='2', bildlang_name='252.jpg', bildlang_beschreibung='252.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='413', bildlang_lang_id='1', bildlang_name='254.jpg', bildlang_beschreibung='254.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='413', bildlang_lang_id='2', bildlang_name='254.jpg', bildlang_beschreibung='254.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='414', bildlang_lang_id='1', bildlang_name='258.jpg', bildlang_beschreibung='258.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='414', bildlang_lang_id='2', bildlang_name='258.jpg', bildlang_beschreibung='258.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='415', bildlang_lang_id='1', bildlang_name='268.jpg', bildlang_beschreibung='268.jpg' ; ##b_dump## INSERT INTO `XXX_galerie_bilder_language` SET bildlang_bild_id='415', bildlang_lang_id='2', bildlang_name='268.jpg', bildlang_beschreibung='268.jpg' ; ##b_dump## DROP TABLE IF EXISTS `XXX_galerie_einstellungen`; ##b_dump## CREATE TABLE `XXX_galerie_einstellungen` ( `galset_thumb_breite` int(11) NOT NULL DEFAULT '150', `galset_thumb_hoehe` int(11) NOT NULL DEFAULT '150', `galset_diashow_id` int(11) NOT NULL DEFAULT '1', `galset_diashow_timeout` int(11) NOT NULL DEFAULT '5', `galset_lightbox` int(11) NOT NULL DEFAULT '1', `galset_diashow` int(11) NOT NULL DEFAULT '1', `galset_diashow_window` int(11) NOT NULL DEFAULT '1', `galset_gps_view` int(11) NOT NULL DEFAULT '1' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; ##b_dump## INSERT INTO `XXX_galerie_einstellungen` SET galset_thumb_breite='120', galset_thumb_hoehe='120', galset_diashow_id='1', galset_diashow_timeout='5', galset_lightbox='1', galset_diashow='1', galset_diashow_window='1', galset_gps_view='1' ; ##b_dump## DROP TABLE IF EXISTS `XXX_galerie_galerien`; ##b_dump## CREATE TABLE `XXX_galerie_galerien` ( `gal_id` bigint(20) NOT NULL AUTO_INCREMENT, `parent_id` int(11) NOT NULL DEFAULT '999999999', `gal_bilderanzahl` int(11) NOT NULL DEFAULT '0', `gal_verzeichnis` varchar(255) NOT NULL, `gal_aktiv_janein` int(1) NOT NULL DEFAULT '0', `gal_bild_id` bigint(20) NOT NULL DEFAULT '1', `gal_order_id` int(11) NOT NULL, PRIMARY KEY (`gal_id`) ) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 ; ##b_dump## INSERT INTO `XXX_galerie_galerien` SET gal_id='11', parent_id='14', gal_bilderanzahl='7', gal_verzeichnis='SpieleKlassiker', gal_aktiv_janein='1', gal_bild_id='24', gal_order_id='2' ; ##b_dump## INSERT INTO `XXX_galerie_galerien` SET gal_id='12', parent_id='13', gal_bilderanzahl='22', gal_verzeichnis='Greece', gal_aktiv_janein='1', gal_bild_id='412', gal_order_id='1' ; ##b_dump## INSERT INTO `XXX_galerie_galerien` SET gal_id='13', parent_id='0', gal_bilderanzahl='0', gal_verzeichnis='', gal_aktiv_janein='0', gal_bild_id='1', gal_order_id='12' ; ##b_dump## INSERT INTO `XXX_galerie_galerien` SET gal_id='14', parent_id='0', gal_bilderanzahl='0', gal_verzeichnis='', gal_aktiv_janein='0', gal_bild_id='1', gal_order_id='22' ; ##b_dump## DROP TABLE IF EXISTS `XXX_galerie_galerien_language`; ##b_dump## CREATE TABLE `XXX_galerie_galerien_language` ( `gallang_gal_id` bigint(20) NOT NULL, `gallang_lang_id` bigint(20) NOT NULL, `gallang_name` varchar(255) NOT NULL, `gallang_beschreibung` longtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; ##b_dump## INSERT INTO `XXX_galerie_galerien_language` SET gallang_gal_id='11', gallang_lang_id='2', gallang_name='Computer-Games', gallang_beschreibung='Screenshots of some classic console-games.' ; ##b_dump## INSERT INTO `XXX_galerie_galerien_language` SET gallang_gal_id='11', gallang_lang_id='1', gallang_name='Spiele-Klassiker', gallang_beschreibung='Screenshots einiger klassischer Konsolen-Spiele. Sie gehören zu den ersten Computer-Spielen überhaupt und bereiteten den Weg für den enormen Erfolg von Computer-Spielen. Im Vergleich zu den grafisch aufwändigen Spielen heutiger Zeit, sehen diese Spiele eher bescheiden aus. Der Spaß-Faktor ist aber enorm, weshalb sich einige dieser Spiele bis in die heutige Zeit erhalten haben und nun z.B. auf Handys verfügbar sind.' ; ##b_dump## INSERT INTO `XXX_galerie_galerien_language` SET gallang_gal_id='12', gallang_lang_id='1', gallang_name='Griechenland', gallang_beschreibung='Impressionen aus Griechenland, alles was man erwartet, Blaue Dächer, weiße Häuser, alte Steine und traumhafte Strände.' ; ##b_dump## INSERT INTO `XXX_galerie_galerien_language` SET gallang_gal_id='12', gallang_lang_id='2', gallang_name='Greece', gallang_beschreibung='Greece' ; ##b_dump## INSERT INTO `XXX_galerie_galerien_language` SET gallang_gal_id='13', gallang_lang_id='1', gallang_name='Urlaub', gallang_beschreibung='' ; ##b_dump## INSERT INTO `XXX_galerie_galerien_language` SET gallang_gal_id='14', gallang_lang_id='1', gallang_name='Freizeit', gallang_beschreibung='' ; ##b_dump##
<gh_stars>10-100 ENV COLWRAP 120 COL "Create View" new_value ddl COL "VIEW,TABLE" NOPRINT SHOW CREATE VIEW `&object_owner`.`&object_name` save ddl &object_owner..&object_name..sql
<gh_stars>1-10 -- Up CREATE TABLE posts_m ( id int unsigned NOT NULL AUTO_INCREMENT, title varchar(50) DEFAULT NULL, body text, created_at datetime NOT NULL, updated_at datetime NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; CREATE TABLE articles_m ( id int unsigned NOT NULL AUTO_INCREMENT, title varchar(50) DEFAULT NULL, body text, created_at datetime NOT NULL, updated_at datetime NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- Down DROP TABLE IF EXISTS posts_m; DROP TABLE IF EXISTS articles_m;
<reponame>UKHomeOffice/hocs-casework create table casework.case_link ( primary_case_uuid uuid not null constraint case_link_primary___fk references casework.case_data (uuid), secondary_case_uuid uuid not null constraint case_link_secondary__fk references casework.case_data (uuid), constraint case_link_pk primary key (primary_case_uuid, secondary_case_uuid) ); comment on table casework.case_link is 'Stores a link between a primary and secondary case'; -- update the active_case view to include linking to the next case create or replace view casework.active_case(id, uuid, created, type, reference, data, primary_topic_uuid, primary_correspondent_uuid, case_deadline, date_received, deleted, completed, case_deadline_warning, secondary_case_uuid, secondary_case_reference, secondary_stage_uuid, primary_case_uuid, primary_case_reference, primary_stage_uuid) as SELECT case_data.id, case_data.uuid, case_data.created, case_data.type, case_data.reference, case_data.data, case_data.primary_topic_uuid, case_data.primary_correspondent_uuid, case_data.case_deadline, case_data.date_received, case_data.deleted, case_data.completed, case_data.case_deadline_warning, next_case.uuid AS secondary_case_uuid, next_case.reference AS secondary_case_reference, (select s.uuid from casework.stage s where s.case_uuid = next_case.uuid order by s.team_uuid DESC nulls last, s.created desc limit 1) as secondary_stage_uuid, prev_case.uuid AS primary_case_uuid, prev_case.reference AS primary_case_reference, (select s.uuid from casework.stage s where s.case_uuid = prev_case.uuid order by s.team_uuid DESC nulls last, s.created desc limit 1) as primary_stage_uuid FROM casework.case_data LEFT JOIN casework.case_link pl ON case_data.uuid = pl.primary_case_uuid LEFT JOIN casework.case_data next_case ON pl.secondary_case_uuid = next_case.uuid LEFT JOIN casework.case_link sl on case_data.uuid = sl.secondary_case_uuid LEFT JOIN casework.case_data prev_case ON sl.primary_case_uuid = prev_case.uuid WHERE NOT case_data.deleted; -- create a view on case_data that includes the link in both directions create or replace view casework.view_case_data(id, uuid, created, type, reference, data, primary_topic_uuid, primary_correspondent_uuid, case_deadline, date_received, deleted, completed, case_deadline_warning, secondary_case_uuid, secondary_case_reference, secondary_stage_uuid, primary_case_uuid, primary_case_reference, primary_stage_uuid) as SELECT case_data.id, case_data.uuid, case_data.created, case_data.type, case_data.reference, case_data.data, case_data.primary_topic_uuid, case_data.primary_correspondent_uuid, case_data.case_deadline, case_data.date_received, case_data.deleted, case_data.completed, case_data.case_deadline_warning, next_case.uuid AS secondary_case_uuid, next_case.reference AS secondary_case_reference, (select s.uuid from casework.stage s where s.case_uuid = next_case.uuid order by s.team_uuid DESC nulls last, s.created desc limit 1) as secondary_stage_uuid, prev_case.uuid AS primary_case_uuid, prev_case.reference AS primary_case_reference, (select s.uuid from casework.stage s where s.case_uuid = prev_case.uuid order by s.team_uuid DESC nulls last, s.created desc limit 1) as primary_stage_uuid FROM casework.case_data LEFT JOIN casework.case_link pl ON case_data.uuid = pl.primary_case_uuid LEFT JOIN casework.case_data next_case ON pl.secondary_case_uuid = next_case.uuid LEFT JOIN casework.case_link sl on case_data.uuid = sl.secondary_case_uuid LEFT JOIN casework.case_data prev_case ON sl.primary_case_uuid = prev_case.uuid; -- Add the secondary case details to the stage_data create or replace view casework.stage_data(case_reference, case_type, data, case_created, id, uuid, created, type, deadline, transition_note_uuid, case_uuid, team_uuid, user_uuid, deadline_warning, correspondents, case_assigned_topic, somu) as SELECT c.reference AS case_reference, c.type AS case_type, c.data, c.created AS case_created, s.id, s.uuid, s.created, s.type, s.deadline, s.transition_note_uuid, s.case_uuid, s.team_uuid, s.user_uuid, s.deadline_warning, cs.correspondents, t.text AS case_assigned_topic, s.somu, c.secondary_case_uuid, c.secondary_case_reference, c.completed, c.secondary_stage_uuid FROM casework.stage s JOIN casework.active_case c ON s.case_uuid = c.uuid LEFT JOIN casework.correspondents_json_by_case cs ON s.case_uuid = cs.case_uuid LEFT JOIN casework.topic t ON c.primary_topic_uuid = t.uuid; create or replace view casework.active_stage_data(case_reference, case_type, data, case_created, id, uuid, created, type, deadline, transition_note_uuid, case_uuid, team_uuid, user_uuid, deadline_warning, correspondents, case_assigned_topic, somu) as SELECT c.reference AS case_reference, c.type AS case_type, c.data, c.created AS case_created, s.id, s.uuid, s.created, s.type, s.deadline, s.transition_note_uuid, s.case_uuid, s.team_uuid, s.user_uuid, s.deadline_warning, cs.correspondents, t.text AS case_assigned_topic, s.somu, c.secondary_case_uuid, c.secondary_case_reference, c.completed, c.secondary_stage_uuid FROM casework.stage s JOIN casework.active_case c ON s.case_uuid = c.uuid LEFT JOIN casework.correspondents_json_by_case cs ON s.case_uuid = cs.case_uuid LEFT JOIN casework.topic t ON c.primary_topic_uuid = t.uuid WHERE s.team_uuid IS NOT NULL;
-- alter4.test -- -- execsql {ALTER TABLE abc ADD d INTEGER;} ALTER TABLE abc ADD d INTEGER;
<gh_stars>1000+ CREATE TYPE status AS ENUM ('open', 'closed'); ALTER TYPE status ADD VALUE 'unknown'; ALTER TYPE status ADD VALUE IF NOT EXISTS 'unknown';
<gh_stars>0 --4. List the department of each employee with the following information: --employee number, last name, first name, and department name. SELECT e.emp_no, e.first_name,e.last_name, d.dept_name FROM employees AS e JOIN dept_emp AS de on e.emp_no = de.emp_no JOIN departments AS d on de.dept_no = d.dept_no
insert into tipo_veiculo values(1,'Caminhão baú', 1.0); insert into tipo_veiculo values(2,'Caminhão caçamba', 1.05); insert into tipo_veiculo values(3,'Carreta', 1.12);
/****** Object: StoredProcedure [dbo].[UpdateMyEMSLUploadIngestStats] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[UpdateMyEMSLUploadIngestStats] /**************************************************** ** ** Desc: Updates column Ingest_Steps_Completed for the given MyEMSL ingest task ** ** This procedure is called by the ArchiveStatusCheckPlugin in the DMS Capture Manager ** ** Return values: 0: success, otherwise, error code ** ** Auth: mem ** Date: 12/18/2014 mem - Initial version ** 06/23/2016 mem - Add parameter @fatalError ** 05/31/2017 mem - Update TransactionID in T_MyEMSL_Uploads using @transactionId ** 06/16/2017 mem - Restrict access using VerifySPAuthorized ** 07/12/2017 mem - Update TransactionId if null yet Ingest_Steps_Completed and ErrorCode are unchanged ** 08/01/2017 mem - Use THROW instead of RAISERROR ** 07/15/2019 mem - Filter on both StatusNum and Dataset_ID when updating T_MyEMSL_Uploads ** 01/31/2020 mem - Add @returnCode, which duplicates the integer returned by this procedure; @returnCode is varchar for compatibility with Postgres error codes ** *****************************************************/ ( @datasetID int, @statusNum int, -- The status number must match the specified DatasetID (this is a safety check) @ingestStepsCompleted tinyint, -- Number of ingest steps that were completed for this entry @fatalError tinyint = 0, -- Set to 1 if the ingest failed and the ErrorCode column needs to be set to -1 (if currently 0 or null) @transactionId int = 0, -- Transaction ID (null or 0 if unknown); starting in July 2017, transactionId and StatusNum should match @message varchar(512) = '' output, @returnCode varchar(64) = '' output ) As set nocount on Declare @myError int = 0 Declare @myRowCount int = 0 Declare @errorCode int = 0 Set @returnCode = '' --------------------------------------------------- -- Verify that the user can execute this procedure from the given client host --------------------------------------------------- Declare @authorized tinyint = 0 Exec @authorized = VerifySPAuthorized 'UpdateMyEMSLUploadIngestStats', @raiseError = 1 If @authorized = 0 Begin; THROW 51000, 'Access denied', 1; End; --------------------------------------------------- -- Validate the inputs --------------------------------------------------- Set @datasetID = IsNull(@datasetID, 0) Set @statusNum = IsNull(@statusNum, 0) Set @ingestStepsCompleted = IsNull(@ingestStepsCompleted, 0) Set @fatalError = IsNull(@fatalError, 0) Set @transactionId = IsNull(@transactionId, 0) Set @message = '' If @datasetID <= 0 Begin Set @message = '@datasetID must be positive; unable to continue' Set @myError = 60000 Goto Done End --------------------------------------------------- -- Make sure the @statusNum exists in T_MyEMSL_Uploads --------------------------------------------------- If Not Exists (SELECT * FROM T_MyEMSL_Uploads MU WHERE StatusNum = @statusNum) Begin Set @message = 'StatusNum ' + Cast(@statusNum as varchar(12)) + ' not found in T_MyEMSL_Uploads' Set @myError = 60003 Goto Done End --------------------------------------------------- -- Make sure the Dataset_ID is correct -- Also lookup the current ErrorCode for this upload task --------------------------------------------------- SELECT @errorCode = ErrorCode FROM T_MyEMSL_Uploads WHERE StatusNum = @statusNum AND Dataset_ID = @datasetID -- SELECT @myError = @@error, @myRowCount = @@rowcount If @myRowCount = 0 Begin Set @message = 'The DatasetID for StatusNum ' + Cast(@statusNum as varchar(12)) + ' is not ' + Cast(@datasetID as varchar(12)) + '; will not update Ingest_Steps_Completed' Set @myError = 60004 Goto Done End --------------------------------------------------- -- Possibly update the error code --------------------------------------------------- If @fatalError > 0 And IsNull(@errorCode, 0) = 0 Begin Set @errorCode = -1 End --------------------------------------------------- -- Perform the update --------------------------------------------------- UPDATE T_MyEMSL_Uploads SET Ingest_Steps_Completed = @ingestStepsCompleted, ErrorCode = @errorCode, TransactionID = CASE WHEN @transactionId = 0 THEN TransactionID ELSE @transactionId END WHERE StatusNum = @statusNum AND Dataset_ID = @datasetID AND (IsNull(Ingest_Steps_Completed, 0) <> @ingestStepsCompleted OR IsNull(ErrorCode, 0) <> IsNull(@errorCode, 0) OR IsNull(TransactionID, 0) <> IsNull(@transactionId, 0) ) -- SELECT @myError = @@error, @myRowCount = @@rowcount If @myError > 0 Begin Set @message = 'Error updating T_MyEMSL_Uploads for Dataset_ID ' + Cast(@datasetID As varchar(12)) + ' and StatusNum ' + Cast(@statusNum as varchar(12)) Set @myError = 60006 Goto Done End Done: If @myError <> 0 Begin If @message = '' Set @message = 'Error in UpdateMyEMSLUploadIngestStats' Set @message = @message + '; error code = ' + Convert(varchar(12), @myError) Exec PostLogEntry 'Error', @message, 'UpdateMyEMSLUploadIngestStats' End Set @returnCode = Cast(@myError As varchar(64)) Return @myError GO GRANT VIEW DEFINITION ON [dbo].[UpdateMyEMSLUploadIngestStats] TO [DDL_Viewer] AS [dbo] GO GRANT EXECUTE ON [dbo].[UpdateMyEMSLUploadIngestStats] TO [DMS_SP_User] AS [dbo] GO
<filename>resources/sql/fb/gene_xref.sql<gh_stars>10-100 SELECT feature.uniquename as gene_id, dbxref.accession as xref_id, db.name as xref_source FROM feature JOIN cvterm cvt ON feature.type_id = cvt.cvterm_id AND cvt.name = 'gene' JOIN featureprop ON feature.feature_id = featureprop.feature_id AND feature.is_obsolete = FALSE JOIN cvterm ON featureprop.type_id = cvterm.cvterm_id AND cvterm.name = 'derived_gene_model_status' AND featureprop.value != 'Withdrawn' JOIN feature_dbxref ON feature.feature_id = feature_dbxref.feature_id AND feature_dbxref.is_current = TRUE JOIN dbxref ON feature_dbxref.dbxref_id = dbxref.dbxref_id JOIN db ON dbxref.db_id = db.db_id WHERE db.name = 'EntrezGene' OR db.name = 'HGNC'
<filename>sql/_01_object/_05_serial/_002_with_option/cases/1059.sql -- create serial using INCREMENT BY which value is 2 and MAXVALUE which value is 999999999999999999999999999999999998 create serial ser1 INCREMENT BY 2 MAXVALUE 9999999999999999999999999999999999998 ; select * from db_serial WHERE name='ser1'; drop serial ser1;
-- misc tests : wrong separators, special cases create table tab1 (name char varying, t1 time, d1 date, d2 datetime, t2 timestamp,i1 integer ,b bit varying); insert into tab1 values('alice',time'11:21:31',date'2001-10-10',datetime'2002-11-01 03:11:45',timestamp'2006-10-02 21:21:10',3,b'001011101100'); insert into tab1 values('alice',time'11:21:31',date'2011-10-10',datetime'2002-01-01 03:11:45',timestamp'2006-10-12 21:21:10',5,b'111011001011'); insert into tab1 values('george',time'01:21:31',date'2001-06-10',datetime'1992-11-01 03:11:45',timestamp'1986-10-02 21:21:10',4,b'11101100'); insert into tab1 values('george',time'11:21:31',date'2001-06-10',datetime'2012-11-01 03:11:45',timestamp'2002-06-02 21:21:10',3,b'1110'); insert into tab1 values('mary',time'18:21:31',date'2001-09-10',datetime'1994-11-01 03:11:45',timestamp'1986-10-02 21:21:10',5,b'11001100'); insert into tab1 values('mary',time'19:21:31',date'2021-02-10',datetime'1994-11-01 03:11:45',timestamp'2002-06-02 21:21:10',2,b'11101101'); insert into tab1 values('john',time'18:21:11',date'1991-09-10',datetime'1998-11-01 03:11:45',timestamp'1981-10-02 21:21:10',6,b'111010000101'); insert into tab1 values('john',time'19:21:18',date'2000-02-10',datetime'1994-11-08 03:11:45',timestamp'1981-10-02 21:21:10',5,b'011001001111'); insert into tab1 values('john',time'19:21:18',date'2000-02-10',datetime'1994-11-08 03:11:45',timestamp'1981-10-02 21:21:10',5,b'011001001111'); select i1,group_concat(name+'_' order by 1 separator ';') from tab1 group by i1; select i1,group_concat(distinct name+'_' order by 1 separator ';') from tab1 group by i1; select i1,group_concat(t1+10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(distinct t1+10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(d1-10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(distinct d1-10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(d2+10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(distinct d2+10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(t2+10 order by 1 separator ';') from tab1 group by i1; select i1,group_concat(distinct t2+10 order by 1 separator ';') from tab1 group by i1; select name,group_concat(i1*2 order by 1 separator ';') from tab1 group by name; select name,group_concat(distinct i1*2 order by 1 separator ';') from tab1 group by name; drop table tab1;
create table stages ( id varchar(64) not null constraint stages_pk primary key, guide varchar(64) not null constraint stages_guides_id_fk references guides on delete cascade, from_spot varchar(64) not null constraint stages_spots_id_fk references spots on delete cascade, to_spot varchar(64) not null constraint stages_spots_id_fk_2 references spots on delete cascade, created timestamp with time zone not null, updated timestamp with time zone, status stage_status not null, position integer ); alter table stages owner to superuser; create index stages_guide_index on stages (guide); create unique index stages_id_uindex on stages (id);
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 28-04-2021 a las 03:06:45 -- Versión del servidor: 10.1.35-MariaDB -- Versión de PHP: 7.2.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `php_avanzado` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productos` -- CREATE TABLE `productos` ( `codigo` int(30) NOT NULL, `producto` varchar(30) NOT NULL, `descripcion` varchar(255) NOT NULL, `precio` decimal(10,2) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `productos` -- INSERT INTO `productos` (`codigo`, `producto`, `descripcion`, `precio`) VALUES (1001, 'Lampara Xenon B54', 'Las lamparas de xenon generan hasta 4 veces mas luz que las lamparas halogenas comunes. El consumo de energia es de 35watt, casi la mitad del consumo de las lamparas halogenas comunes. ', '234.00'), (1002, 'Lampara Xenon B16', 'El funcionamiento mediante la descarga electrica aumenta la cantidad de horas utiles de la lampara, ya que los golpes y las vibraciones no las da?an, como sucede con las lamparas halogenas.MODIFICADO', '546.00'), (1003, 'Lampara Xenon 300SD', 'El funcionamiento mediante la descarga electrica aumenta la cantidad de horas utiles de la lampara, ya que los golpes y las vibraciones no las da?an, como sucede con las lamparas halogenas.', '344.00'), (1004, 'Lampara Xenon B45SD', 'No hace falta realizar ninguna modificacion electrica en el auto, tampoco hace falta cortar cables. Hay kits para cada modelo y marca de autos. Los kits consumen casi la mitad de electricidad que las lamparas halogenas comunes.', '256.40'), (1005, 'Lampara Xenon 28SE', 'Este modelo de lampara genera un ahorro de combustible.', '310.50'), (1006, 'Lampara Xenon B345', 'En caso de ser necesario se pueden colocar lamparas halogenas de forma inmediata, los kits no modifican la instalacion electrica original del auto. ', '340.00'), (1007, 'Lampara Xenon 34SE', 'En caso de ser necesario se pueden colocar lamparas halogenas de forma inmediata, los kits no modifican la instalacion electrica original del auto. ', '322.50'), (1008, 'Lampara Xenon B90', 'Las lamparas de xenon generan menos calor que las lamparas halogenas, todas las opticas soportan las lamparas de xenon.', '349.90'), (1009, 'Lampara Xenon 43SE', 'Las lamparas de xenon generan menos calor que las lamparas halogenas, todas las opticas soportan las lamparas de xenon.', '230.90'), (1010, 'Lampara Xenon 98DE', 'Las lamparas de xenon generan menos calor que las lamparas halogenas, todas las opticas soportan las lamparas de xenon.', '110.00'), (1011, 'Lampara Xenon 65SD', 'Los balastros son de menor tama?o y son digitales. Los balastros no generan ningun tipo de interferencia en las computadoras de los autos ni en las radios. ', '430.00'), (1012, 'Lampara Xenon B44', 'Los balastros son de menor tama?o y son digitales. Los balastros no generan ningun tipo de interferencia en las computadoras de los autos ni en las radios.', '235.60'), (1013, 'Lampara Xenon 3D4G', 'Las lamparas de 6000k generan el mismo color que los autos de alta gama que vienen con lamparas de xenon de serie. A medida que aumenta la temperatura de las lamparas la potencia lum?nica disminuye. ', '260.60'), (1014, 'Lampara Xenon 109FD', 'Las lamparas de 6000k generan el mismo color que los autos de alta gama que vienen con lamparas de xenon de serie. A medida que aumenta la temperatura de las lamparas la potencia lum?nica disminuye. ', '430.00'), (1015, 'Lampara Xenon 90FT', 'El funcionamiento mediante la descarga electrica aumenta la cantidad de horas utiles de la lampara, ya que los golpes y las vibraciones no las da?an, como sucede con las lamparas halogenas.', '456.60'), (1016, 'Lampara Xenon FG34', 'El funcionamiento mediante la descarga electrica aumenta la cantidad de horas utiles de la lampara, ya que los golpes y las vibraciones no las da?an, como sucede con las lamparas halogenas.', '190.00'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `productos` -- ALTER TABLE `productos` ADD PRIMARY KEY (`codigo`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `productos` -- ALTER TABLE `productos` MODIFY `codigo` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1023; 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 DATABASE IF NOT EXISTS ims; USE IMS; CREATE TABLE IF NOT EXISTS `customers` ( `customers_id` INT(50) NOT NULL AUTO_INCREMENT, `first_name` VARCHAR(40) DEFAULT NULL, `surname` VARCHAR(40) DEFAULT NULL, PRIMARY KEY (`customers_id`) ); CREATE TABLE IF NOT EXISTS `items`( `items_id` int NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL, `price` decimal(6,2) NOT NULL, PRIMARY KEY (`items_id`) ); CREATE TABLE IF NOT EXISTS `orders`( `orders_id` int NOT NULL AUTO_INCREMENT, `fk_customers_id` INT NOT NULL, PRIMARY KEY (`orders_id`), FOREIGN KEY (`fk_customers_id`) REFERENCES `customers`(`customers_id`) ); CREATE TABLE IF NOT EXISTS `orderitem`( `orderitem_id` int NOT NULL AUTO_INCREMENT, PRIMARY KEY (`orderitem_id`), `fk_orders_id` INT NOT NULL, `fk_items_id` INT NOT NULL, FOREIGN KEY (`fk_orders_id`) REFERENCES `orders`(`orders_id`), FOREIGN KEY (`fk_items_id`) REFERENCES `items`(`items_id`) );
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Sep 10, 2017 at 10:15 PM -- Server version: 10.1.16-MariaDB -- PHP Version: 7.0.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `students` -- -- -------------------------------------------------------- -- -- Table structure for table `course` -- CREATE TABLE `course` ( `cid` varchar(3) NOT NULL, `cname` varchar(50) NOT NULL, `cdesc` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `course` -- INSERT INTO `course` (`cid`, `cname`, `cdesc`) VALUES ('000', 'QQQ', 'Quando Quando Quando'), ('012', 'BFA', 'Bachelor of Fine Arts'), ('022', 'ABM', 'Auqnah Business Management'), ('037', 'BSIT', 'Bachelor of Science in Information Technology'), ('039', 'BSCS', 'Bachelor of Science in Computer Science'), ('088', 'BSC', 'Bachelor of Science in Chef'); -- -------------------------------------------------------- -- -- Table structure for table `student` -- CREATE TABLE `student` ( `id` int(11) NOT NULL, `idno` varchar(10) NOT NULL, `fname` varchar(50) NOT NULL, `lname` varchar(50) NOT NULL, `mname` varchar(50) NOT NULL, `course` varchar(50) NOT NULL, `sex` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `student` -- INSERT INTO `student` (`id`, `idno`, `fname`, `lname`, `mname`, `course`, `sex`) VALUES (1, '15-038-1', 'Geisher', 'Bernabezz', 'Gonzalo', 'BSCS', 'F'), (2, '15-038-2', '<NAME>', 'Waje', 'Pabillaran', 'BSCS', 'F'), (3, '15-038-3', 'Carlo', 'Abendanio', 'Consultado', 'BSIT', 'M'), (5, '15-000-4', 'Sheira', 'Man-awit', 'Custodio', 'BFA', 'F'), (6, '15-037-5', 'Samantha', 'Millos', 'Musa', 'BSIT', 'F'), (18, '15-037-061', 'Gem', 'Gonzalo', 'Ganay', 'QQQ', 'F'); -- -- Indexes for dumped tables -- -- -- Indexes for table `course` -- ALTER TABLE `course` ADD PRIMARY KEY (`cid`); -- -- Indexes for table `student` -- ALTER TABLE `student` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `student` -- ALTER TABLE `student` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; /*!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 */;
use togo; DROP TABLE IF EXISTS users; CREATE TABLE users( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, daily_limit INT NOT NULL DEFAULT 0 )ENGINE=INNODB; DROP TABLE IF EXISTS user_daily_counters; CREATE TABLE user_daily_counters( user_id BIGINT NOT NULL UNIQUE, daily_count INT NOT NULL DEFAULT 0, last_updated DATETIME NOT NULL )ENGINE=INNODB; DROP TABLE IF EXISTS tasks; CREATE TABLE tasks( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id BIGINT NOT NULL, name VARCHAR(64) NOT NULL, INDEX user_id_idx(user_id) )ENGINE=INNODB;
<reponame>emmaus-5h/5Hin1-webshop-Yara -- -- create tables -- CREATE TABLE products ( id INTEGER PRIMARY KEY AUTOINCREMENT, code VARCHAR(15), name VARCHAR(255), description TEXT, price NUMERIC(10, 2), model VARCHAR(255), productiejaar_id INTEGER, kleuren_id INTEGER, rating_id INTEGER ); CREATE TABLE productiejaren ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255) ); CREATE TABLE kleuren ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255) ); CREATE TABLE rating ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255) ); -- -- populate with data -- -- generared using -- curl "https://api.mockaroo.com/api/910b6c20?count=100&key=90eac760" > seed.sql -- -- want different data? check: https://www.mockaroo.com/910b6c20 -- insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('<NAME>', 'Dit hoesje is heel populair onder jongeren. Het was de best verkochte hoesje van 2021.', '816905633-0', 10.5, 'iPhone 11, iPhone 12 en iPhone 13' , 3, 5, 2); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Beige Bees', 'Vrolijk hoesje met beige achtergrond en bijen.', '077030122-3', 11, 'iPhone 12 en iPhone 13' , 1, 4, 1); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Lightning Bolt', 'Een zwarte hoesje met een bliksemschicht in het midden.', '445924201-X', 13.5, 'iPhone 11' , 2, 6, 1); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Aqua Sea Blue', 'Met dit hoesje kijk je door je ogen door de zee', '693155505-7', 13.5, 'iPhone 11, iPhone 12 en iPhone 13 ' , 3, 3, 3); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Happy Autumn', 'De vormen geven een warme gevoel en de kleuren een herfstgevoel', '686928463-6', 14, 'iPhone 11, iPhone 12 en iPhone 13' , 2, 1, 1); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Broken Glass', 'Een coole gebroken zwarte hoesje om jouw onhandige kant te laten zien.', '492662523-7', 14, 'iPhone 11 en iPhone 12 ' , 1, 6, 1); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Special Honeycomb', 'Dit hoesje zorgt ervoor dat bijen jaloers worden. zo eentje zullen ze nooit vinden', '492662523-6', 14, 'iPhone 11 en iPhone 12' , 1, 1, 1); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Happy Donuts', 'Wie wordt er nou niet vrolijk van donuts? Voor de echte donutlovers is dit hoesje perfect', '492662523-9', 14, 'iPhone 11 en iPhone 12' , 3, 7, 3); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Snake Print', 'Dit hoesje heeft een leuk slangen printje.', '492662523-3', 14, 'iPhone 11 en iPhone 12' , 2, 1, 2); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Golden Stars', 'Leuke sterren op een roze achtergrond. Are you gonna shine like the stars with this case?', '492662523-1', 14, 'iPhone 11 en iPhone 12' , 3, 8, 2); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Pink Flamingo', 'Vrolijk hoesje met roze flamingos', '492662523-2', 14, 'iPhone 11 en iPhone 13' , 1, 8, 3); insert into products (name, description, code, price, model, productiejaar_id, kleuren_id, rating_id) values ('Tropical leaves', 'Basic hoesje met tropische bladeren', '492662523-4', 14, 'iPhone 11' , 1, 7, 1); insert into productiejaren (name) values ('2020'); insert into productiejaren (name) values ('2021'); insert into productiejaren (name) values ('2022'); insert into kleuren (name) values ('overige'); insert into kleuren (name) values ('beige'); insert into kleuren (name) values ('blauw'); insert into kleuren (name) values ('geel'); insert into kleuren (name) values ('terquoise'); insert into kleuren (name) values ('zwart'); insert into kleuren (name) values ('groen'); insert into kleuren (name) values ('roze'); insert into rating (name) values ('⭐⭐⭐'); insert into rating (name) values ('⭐⭐'); insert into rating (name) values ('⭐'); /* de 1:n samenvoegen tabellen*/ SELECT productiejaren.id, productiejaren.name FROM productiejaren JOIN products ON productiejaren.id = products.productiejaar_id /* aangezien de console bij 2 van bij elkaargevoegde tabellen error geeft, zet ik hem als commentaar neer*/ /* SELECT rating.id, rating.name FROM rating INNER JOIN products ON rating.id = products.rating_id */
<filename>scripts/db-seed/db_data_parcel_tracking.sql<gh_stars>0 INSERT INTO `refua_delivery`.`parcel_tracking` (`status_date`, `status`, `user_fk`, `parcel_fk`) VALUES ('2020-02-01 08:00:00', 'delivered', 14, 6);
<gh_stars>0 /* Question 1 */ ALTER TABLE BOOK ADD( CONSTRAINT book_price_positive check (price > 0), CONSTRAINT book_publishdate_notnull check (publish_date is not null) ); INSERT INTO BOOK values ('9752106401.', '<NAME>', 3, 'Emrah', 'Serbes', -10, to_date('01.06.14', 'DD-mm-YY') , 6); /* Question 2 */ ALTER TABLE LOAN ADD RETURN_DATE DATE; /* Question 3 */ UPDATE LOAN SET RETURN_DATE = TO_DATE('03.01.13', 'DD-mm-YY') where LOAN_ID = '130150'; UPDATE LOAN SET RETURN_DATE = TO_DATE('08.04.13', 'DD-mm-YY') where LOAN_ID = '130428'; /* Question 4 */ INSERT INTO LOAN VALUES ('130429', '9786055943639', 20003, TO_DATE('03.05.13', 'DD-mm-YY'), TO_DATE('03.06.13 ', 'DD-mm-YY'), TO_DATE('09.06.13', 'DD-mm-YY')); /* Question 5 */ SELECT SUM((l.RETURN_DATE - l.DUE_DATE)*2) AS Fine, m.MEMBER_NAME FROM MEMBER m, LOAN l WHERE m.MEMBER_ID = l.MEMBER_ID AND l.DUE_DATE < l.RETURN_DATE GROUP BY m.MEMBER_NAME;
<gh_stars>10-100 CREATE SCHEMA myschema; CREATE TABLE myschema.foo (a text, b integer); -- name: InsertValues :copyfrom -- InsertValues inserts multiple values using copy. INSERT INTO myschema.foo (a, b) VALUES ($1, $2); -- name: InsertSingleValue :copyfrom -- InsertSingleValue inserts a single value using copy. INSERT INTO myschema.foo (a) VALUES ($1);
<reponame>manikmagar/munit-db-testcontainers-connector drop table if exists books; CREATE TABLE books ( book_id int(11) NOT NULL AUTO_INCREMENT, title varchar(45) NOT NULL, description varchar(45) NOT NULL, price decimal(10,0) NOT NULL, total_quantity int(11) NOT NULL, available_quantity int(11) NOT NULL, create_timestamp timestamp NULL DEFAULT NULL, PRIMARY KEY (book_id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO books(title,description,price,total_quantity,available_quantity,create_timestamp) VALUES ('My First Book','This is my first book.',20,10,10,now()); DROP PROCEDURE IF EXISTS calculate_library_value; CREATE PROCEDURE `calculate_library_value`() BEGIN -- Total Value of Library books select sum(price * total_quantity) as library_Value from books; /* Also get all the books. */ BEGIN select * from books order by title; END; END;
<reponame>idocalm/dl-banking CREATE TABLE `banking-payments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `player` varchar(255) DEFAULT NULL, `time` varchar(255) DEFAULT NULL, `money` varchar(255) DEFAULT NULL, `title` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ); -- money can be - 500 / + 500 -- player can be the one who pays / recives
<filename>tools/DDLShow/files/sample.ddl<gh_stars>1-10 /* sample.ddl */ scope Basic { include <inc/basic.ddl> } include <inc/basic.ddl> scope Int { include <inc/int.ddl> } scope Text { include <inc/text.ddl> } scope Scope { include <inc/scope.ddl> } scope Block { include <inc/block.ddl> } scope Ptr { include <inc/ptr.ddl> } scope Temp { int Len = 10 ; int A = Len ; type T = int[Len] ; } /* type B = A * ; type A = { { B } * [10] , int } * [] ; */ /* type R = S[] ; struct T { R[20] a; }; struct S { T[10] a; int[12] b; }; */
-- -- Copyright 2010-2013 <NAME> and the many contributors. -- -- 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. -- DROP INDEX ${table}_current_version_index ON ${schema}.${table}; RENAME TABLE ${schema}.${table} TO `${schema}`.`${table}_bak`; RENAME TABLE `${schema}`.`${table}_bak` TO `${schema}`.`${table}`; ALTER TABLE `${schema}`.`${table}` DROP INDEX script; ALTER TABLE `${schema}`.`${table}` DROP PRIMARY KEY; ALTER TABLE `${schema}`.`${table}` DROP COLUMN current_version; ALTER TABLE `${schema}`.`${table}` CHANGE version `version` VARCHAR(50) NOT NULL; ALTER TABLE `${schema}`.`${table}` CHANGE description `description` VARCHAR(200) NOT NULL; ALTER TABLE `${schema}`.`${table}` CHANGE type `type` VARCHAR(20) NOT NULL; UPDATE `${schema}`.`${table}` SET `type` = 'SPRING_JDBC' WHERE `type` = 'JAVA'; ALTER TABLE `${schema}`.`${table}` CHANGE script `script` VARCHAR(1000) NOT NULL; ALTER TABLE `${schema}`.`${table}` CHANGE checksum `checksum` INT; ALTER TABLE `${schema}`.`${table}` CHANGE installed_by `installed_by` VARCHAR(30) NOT NULL; ALTER TABLE `${schema}`.`${table}` CHANGE installed_on `installed_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ALTER TABLE `${schema}`.`${table}` CHANGE execution_time `execution_time` INT NOT NULL; ALTER TABLE `${schema}`.`${table}` ADD `version_rank` INT; ALTER TABLE `${schema}`.`${table}` ADD `installed_rank` INT; ALTER TABLE `${schema}`.`${table}` ADD `success` BOOL; UPDATE `${schema}`.`${table}` SET `success` = TRUE WHERE state = 'SUCCESS'; UPDATE `${schema}`.`${table}` SET `success` = FALSE WHERE state = 'FAILED'; ALTER TABLE `${schema}`.`${table}` MODIFY COLUMN `success` BOOL NOT NULL; ALTER TABLE `${schema}`.`${table}` DROP COLUMN state;
DECLARE @PatientID VARCHAR(50), @RegistrationDate VARCHAR(100), @StartARTDate VARCHAR(100), @TransferInFrom VARCHAR(1000), @StartRegimenId VARCHAR(1000), @RegimenName varchar(1000) DECLARE @C as cursor Set @C = CURSOR FOR WITH HIVEnrollment AS (select a.Ptn_Pk PatientPK , a.IQNumber , b.Visit_Id VisitPK , d.[Name] FacilityFrom from mst_patient a inner join ord_visit b on a.Ptn_Pk= b.Ptn_Pk inner join mst_VisitType c on b.VisitType = c.VisitTypeID left join mst_LPTF d ON a.LPTFTransferId = d.ID where c.VisitName = 'Enrollment' and (a.DeleteFlag = 0 or a.DeleteFlag IS NULL) and (b.DeleteFlag = 0 or b.DeleteFlag IS NULL) and a.TransferIn = 1) , InitialEvaluation AS (select a.Ptn_Pk PatientPK , a.IQNumber , b.Visit_Id VisitPK , d.CurrentART StartRegimen , d.CurrentARTStartDate StartARTDate from mst_patient a inner join ord_visit b on a.Ptn_Pk= b.Ptn_Pk inner join mst_VisitType c on b.VisitType = c.VisitTypeID left join dtl_PatientHivPrevCareIE d on b.Visit_Id = d.Visit_pk where c.VisitName = 'Initial Evaluation' and (a.DeleteFlag = 0 or a.DeleteFlag IS NULL) and (b.DeleteFlag = 0 or b.DeleteFlag IS NULL) and (d.PrevARVExposure = 1) and YEAR(d.CurrentARTStartDate) > 1989) , ARTHistory AS (select a.Ptn_Pk PatientPK , b.Visit_Id VisitPK , CASE WHEN YEAR(d.ARTTransferInDate) > 1989 THEN ARTTransferInDate ELSE NULL END AS TransferInDate , h.Name ARTTransferInFrom , g.Name FromDistrict , CASE WHEN YEAR(e.ARTStartDate) > 1989 THEN e.ARTStartDate ELSE NULL END AS ARTStartDate , CASE WHEN YEAR(e.ConfirmHIVPosDate) > 1989 THEN e.ConfirmHIVPosDate ELSE NULL END AS ConfirmHIVPosDate , CASE WHEN f.HIVCareWhere = '' THEN NULL ELSE f.HIVCareWhere END AS ConfirmHIVPosWhere from mst_patient a inner join ord_visit b on a.Ptn_Pk= b.Ptn_Pk inner join mst_VisitType c on b.VisitType = c.VisitTypeID left join dtl_PatientHivPrevCareIE d on b.Visit_Id = d.Visit_pk left join dtl_PatientHivPrevCareEnrollment e ON b.Visit_Id = e.Visit_pk left join dtl_PriorArvAndHivCare f on b.Visit_Id = f.Visit_pk left join mst_District g on d.FromDistrict = g.ID left join mst_LPTF h ON d.ARTTransferInFrom = h.ID where c.VisitName = 'ART History' and (a.DeleteFlag = 0 or a.DeleteFlag IS NULL) and (b.DeleteFlag = 0 or b.DeleteFlag IS NULL)) , ARTTherapy AS (select a.Ptn_Pk PatientPK , b.Visit_Id VisitPK , CASE WHEN YEAR(d.FirstLineRegStDate) > 1989 THEN d.FirstLineRegStDate ELSE NULL END AS ARTStartDate , CASE WHEN d.FirstLineReg != '' THEN d.FirstLineReg ELSE NULL END AS StartRegimen from mst_patient a inner join ord_visit b on a.Ptn_Pk= b.Ptn_Pk inner join mst_VisitType c on b.VisitType = c.VisitTypeID inner join dtl_patientartcare d on b.Visit_Id = d.visit_Id where c.VisitName = 'ART Therapy' and (a.DeleteFlag = 0 or a.DeleteFlag IS NULL) and (b.DeleteFlag = 0 or b.DeleteFlag IS NULL) and YEAR(d.FirstLineRegStDate) > 1989) , ClinicalEncounter AS (select a.Ptn_Pk PatientPK , a.IQNumber , b.Visit_Id VisitPK , COALESCE(CASE WHEN YEAR(e.ARTStartDate) > 1989 THEN e.ARTStartDate ELSE NULL END , CASE WHEN YEAR(f.FirstLineRegStDate) > 1989 THEN f.FirstLineRegStDate ELSE NULL END) StartARTDate , g.RegimenName StartRegimen , h.Name TransferInFrom ,g.RegimenCode RegimenCode from mst_patient a inner join ord_visit b on a.Ptn_Pk= b.Ptn_Pk inner join mst_VisitType c on b.VisitType = c.VisitTypeID left join dtl_PatientHivPrevCareIE d on b.Visit_Id = d.Visit_pk left join dtl_PatientHivPrevCareEnrollment e on b.Visit_Id = e.Visit_pk left join dtl_patientARTCare f on b.Visit_Id = f.visit_Id left join mst_Regimen g on f.FirstLineReg = g.RegimenID left join mst_LPTF h on d.ARTTransferInFrom = h.ID where c.VisitName = 'Clinical Encounter' and (a.DeleteFlag = 0 or a.DeleteFlag IS NULL) and (b.DeleteFlag = 0 or b.DeleteFlag IS NULL) and a.TransferIn = 1 and COALESCE(CASE WHEN YEAR(e.ARTStartDate) > 1989 THEN e.ARTStartDate ELSE NULL END , CASE WHEN YEAR(f.FirstLineRegStDate) > 1989 THEN f.FirstLineRegStDate ELSE NULL END) IS NOT NULL) , tri AS ( Select PatientPK , FacilityFrom , NULL StartARTDate , NULL StartRegimen FROM HIVEnrollment a UNION Select PatientPK , NULL FacilityFrom , StartARTDate , StartRegimen FROM InitialEvaluation UNION SELECT PatientPK , ARTTransferInFrom FacilityFrom , ARTStartDate StartARTDate , NULL StartRegimen FROM ARTHistory UNION Select PatientPK , NULL , ARTStartDate StartARTDate , StartRegimen FROM ARTTherapy UNION Select PatientPK , TransferInFrom , StartARTDate ,StartRegimen FROM ClinicalEncounter), Triage as( select t.PatientPK ,t.StartARTDate ,t.FacilityFrom ,REPLACE(t.StartRegimen,'/','+') as Regimen ,t.StartRegimen as StartRegimen from ( select t.PatientPK,t.StartARTDate,t.FacilityFrom,t.StartRegimen , SubString(t.StartRegimen, 0, 4) [1], Case When CharIndex('+', t.StartRegimen) > 0 Then SubString(t.StartRegimen, CharIndex('+', t.StartRegimen) + 1, 3) End As [2], Case When CharIndex('+', t.StartRegimen, 6) > 0 Then SubString(t.StartRegimen, CharIndex('+', t.StartRegimen, 6) + 1, 3) Else Null End As [3], Case When CharIndex('+', t.StartRegimen, 10) > 0 Then SubString(StartRegimen, CharIndex('+', t.StartRegimen, 10) + 1, 3) Else Null End As [4], Case When CharIndex('+', t.StartRegimen, 14) > 0 Then SubString(StartRegimen, CharIndex('+', t.StartRegimen, 14) + 1, 3) Else Null End As [5] from tri t) t) , StartART AS ( Select PatientPK , MIN(StartARTDate)StartARTDate FROM triage WHERE StartARTDate IS NOT NULL GROUP BY PatientPK) , TransferIn AS ( Select a.Ptn_Pk , c.FacilityFrom , b.StartARTDate , c.StartRegimen , CASE WHEN DATEDIFF(dd, a.DOB, b.StartARTDate)/365.25 < 15 THEN 'CHILD' ELSE 'ADULT' END AS Age FROM mst_Patient a LEFT JOIN StartART b ON a.Ptn_Pk = b.PatientPK LEFT JOIN ( Select PatientPK , MAX(FacilityFrom) FacilityFrom , MAX(StartRegimen) StartRegimen FROM triage WHERE Coalesce(FacilityFrom, StartRegimen) IS NOT NULL GROUP BY PatientPK) c ON a.Ptn_Pk = c.PatientPK WHERE coalesce(b.PatientPK, c.PatientpK) IS NOT NULL) Select distinct b.Id PatientId , CASE WHEN a.FacilityFrom IS NULL THEN 'Facility From Not Documented' ELSE REPLACE(a.FacilityFrom,'''','') END AS FacilityFrom , CASE WHEN a.StartARTDate IS NULL THEN '' ELSE a.StartARTDate END AS StartARTDate , CASE WHEN a.StartARTDate IS NOT NULL AND y.ItemId IS NULL THEN (select ItemId from LookupItemView where MasterName = 'AdultFirstLineRegimen' and ItemName = 'Unknown') /*Default to Unknown*/ WHEN a.StartARTDate IS NULL THEN 0 ELSE y.ItemId END StartRegimenId , b.RegistrationDate , a.StartRegimen as RegimenName FROM TransferIn a INNER JOIN Patient b ON a.Ptn_Pk = b.ptn_pk LEFT JOIN RegimenMap421 z ON REPLACE(a.StartRegimen, ' + ','/') = z.Regimen AND a.Age = z.Age LEFT JOIN LookupItemView y ON z.RegimenCode = y.ItemName LEFT JOIN LookupMasterItem x ON y.MasterName = REPLACE(x.DisplayName, ' ','') LEFT JOIN PatientMasterVisit c ON b.Id = c.PatientId AND c.VisitType IS NULL WHERE c.Id IS NULL OPEN @C FETCH NEXT FROM @C INTO @PatientID, @TransferInFrom, @StartARTDate, @StartRegimenId, @RegistrationDate, @RegimenName WHILE @@FETCH_STATUS = 0 BEGIN EXEC ('UPDATE Patient SET PatientType = 260 WHERE Id = ' + @PatientID + ';') EXEC(' DECLARE @PatientMasterVisitID as INT; INSERT INTO dbo.PatientMasterVisit (PatientId , ServiceId , Start , [End] , Active , VisitDate , VisitScheduled , VisitBy , VisitType , Status , CreateDate , DeleteFlag , CreatedBy , AuditData) VALUES ('+@PatientID+' , 1 , CAST('''+@RegistrationDate+''' AS DATETIME) , CAST('''+@RegistrationDate+''' AS DATETIME) , 1 , CAST('''+@RegistrationDate+''' AS DATETIME) , 0 , 0 , NULL , 2 , GETDATE() , 0 , 1 , NULL); SELECT @PatientMasterVisitID = IDENT_CURRENT(''PatientMasterVisit'') IF (YEAR(CAST('''+@StartARTDate+''' AS DATE)) != 1900) INSERT INTO [dbo].[PatientTransferIn] ([PatientId] ,[PatientMasterVisitId] ,[ServiceAreaId] ,[TransferInDate] ,[TreatmentStartDate] ,[CurrentTreatment] ,[FacilityFrom] ,[MFLCode] ,[CountyFrom] ,[TransferInNotes] ,[DeleteFlag] ,[CreatedBy] ,[CreateDate] ,[AuditData]) VALUES ('+@PatientID+' ,@PatientMasterVisitID ,1 ,CAST('''+@RegistrationDate+''' AS DATETIME) ,CAST('''+@StartARTDate+''' AS DATETIME) ,'''+@StartRegimenId+''' ,'''+@TransferInFrom+''' ,''99999'' ,''48'' ,'''+@RegimenName +' - '' + '''+@TransferInFrom+''' --Transfer In Notes ,0 ,1 ,GETDATE() ,NULL); ') FETCH NEXT FROM @C INTO @PatientID, @TransferInFrom, @StartARTDate, @StartRegimenId, @RegistrationDate, @RegimenName END CLOSE @C DEALLOCATE @C
<gh_stars>0 insert into REALMS(ID,NAME,DESCRIPTION,CONFIG,CREATION_TIME,LAST_UPDATE_TIME, REGISTRATION_ENABLED, PRIVACY_POLICY_URL, AUP_URL) values (1,'iam', 'The iam realm', '{"kc":{"clientId":"iam-api", "clientSecret": "secret"}}', CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), false, 'https://iam.example.com/privacy', null); insert into REALMS(ID,NAME,DESCRIPTION,CONFIG,CREATION_TIME,LAST_UPDATE_TIME, REGISTRATION_ENABLED, PRIVACY_POLICY_URL, AUP_URL) values (2,'alice', 'The alice realm', '{"kc":{"clientId":"iam-api", "clientSecret": "secret"}}', CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), true, 'https://alice.example.com/privacy', 'https://alice.example.com/aup'); insert into REALMS(ID,NAME,DESCRIPTION,CONFIG,CREATION_TIME,LAST_UPDATE_TIME, REGISTRATION_ENABLED, PRIVACY_POLICY_URL, AUP_URL) values (3,'atlas', 'The atlas realm', '{"kc":{"clientId":"iam-api", "clientSecret": "secret"}}', CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), false, 'https://atlas.example.com/privacy', 'https://atlas.example.com/aup'); insert into REALMS(ID,NAME,DESCRIPTION,CONFIG,CREATION_TIME,LAST_UPDATE_TIME,REGISTRATION_ENABLED, PRIVACY_POLICY_URL, AUP_URL) values (4,'cms', 'The cms realm', '{"kc":{"clientId":"iam-api", "clientSecret": "secret"}}', CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), false, 'https://cms.example.com/privacy', 'https://cms.example.com/aup'); insert into REALMS(ID,NAME,DESCRIPTION,CONFIG,CREATION_TIME,LAST_UPDATE_TIME,REGISTRATION_ENABLED, PRIVACY_POLICY_URL, AUP_URL) values (5,'lhcb', 'The lhcb realm', '{"kc":{"clientId":"iam-api", "clientSecret": "secret"}}', CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), true, 'https://lhcb.example.com/privacy', 'https://lhcb.example.com/aup');
<reponame>ysaakpr/kratos<gh_stars>0 CREATE INDEX `auth_codes_flow_id_idx` ON `auth_codes` (`flow_id`);
--###################################################### --# Create legacy indication staging tables DDL and --# Load legacy FAERS data files into the indi_legacy table --# --# LTS Computing LLC --###################################################### set search_path = faers; drop table if exists indi_legacy; create table indi_legacy ( ISR varchar, DRUG_SEQ varchar, INDI_PT varchar, FILENAME varchar ); truncate indi_legacy; COPY indi_legacy FROM '/home/lee/data/inbound/faers/legacy/ascii/all_indi_legacy_data_with_filename.txt' WITH DELIMITER E'$' CSV HEADER QUOTE E'\b' ; select distinct filename from indi_legacy order by 1 ;