sql
stringlengths
6
1.05M
<filename>src/test/resources/sql/drop_view/d915e4e4.sql<gh_stars>10-100 -- file:security_label.sql ln:41 expect:true DROP VIEW seclabel_view1
<filename>SqlWatch.Monitor/Project.SqlWatch.Database/dbo/Tables/sqlwatch_config_check_template_action.sql CREATE TABLE [dbo].[sqlwatch_config_check_template_action] ( [check_name] [nvarchar](255) not null, [action_id] smallint not null, [action_every_failure] bit not null, [action_recovery] bit not null, [action_repeat_period_minutes] smallint null, [action_hourly_limit] tinyint not null, [action_template_id] smallint not null, constraint pk_sqlwatch_config_check_template_action primary key clustered ([check_name], [action_id]), constraint fk_sqlwatch_config_check_template_action_check_name foreign key ([check_name]) references [dbo].[sqlwatch_config_check_template] ([check_name]) on delete no action )
/****** Object: View [dbo].[V_Analysis_Job] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE VIEW [dbo].[V_Analysis_Job] AS SELECT AJ.AJ_jobID AS Job, AnTool.AJT_toolName AS Tool, DS.Dataset_Num AS Dataset, DFP.Dataset_Folder_Path AS Dataset_Storage_Path, DFP.Dataset_Folder_Path + '\' + AJ.AJ_resultsFolderName As Results_Folder_Path, AJ.AJ_parmFileName AS ParmFileName, AJ.AJ_settingsFileName AS SettingsFileName, AnTool.AJT_parmFileStoragePath AS ParmFileStoragePath, AJ.AJ_organismDBName AS OrganismDBName, AJ.AJ_proteinCollectionList AS ProteinCollectionList, AJ.AJ_proteinOptionsList AS ProteinOptions, O.OG_organismDBPath AS OrganismDBStoragePath, AJ.AJ_StateID AS StateID, AJ.AJ_priority AS priority, AJ.AJ_comment AS [Comment], DS.DS_Comp_State AS CompState, InstName.IN_class AS InstClass, AJ.AJ_datasetID AS DatasetID, AJ.AJ_requestID AS RequestID, DFP.Archive_Folder_Path, DFP.MyEMSL_Path_Flag, DFP.Instrument_Data_Purged, E.Experiment_Num As Experiment, C.Campaign_Num As Campaign, InstName.IN_name AS Instrument, AJ.AJ_StateNameCached AS State, AJ.AJ_jobID, AJ.AJ_datasetID, DS.DS_rating AS Rating, AJ.AJ_created AS Created, AJ.AJ_start AS Started, AJ.AJ_finish AS Finished, CONVERT(DECIMAL(9, 2), AJ.AJ_ProcessingTimeMinutes) AS Runtime, AJ.AJ_specialProcessing AS SpecialProcessing, AJ.AJ_batchID FROM T_Analysis_Job AJ INNER JOIN T_Dataset DS ON AJ.AJ_datasetID = DS.Dataset_ID INNER JOIN T_Organisms O ON AJ.AJ_organismID = O.Organism_ID INNER JOIN T_Analysis_Tool AnTool ON AJ.AJ_analysisToolID = AnTool.AJT_toolID INNER JOIN T_Instrument_Name InstName ON DS.DS_instrument_name_ID = InstName.Instrument_ID INNER JOIN V_Dataset_Folder_Paths DFP ON DS.Dataset_ID = DFP.Dataset_ID INNER JOIN T_Experiments E ON DS.Exp_ID = E.Exp_ID INNER JOIN T_Campaign C ON E.EX_campaign_ID = C.Campaign_ID GO GRANT VIEW DEFINITION ON [dbo].[V_Analysis_Job] TO [DDL_Viewer] AS [dbo] GO GRANT DELETE ON [dbo].[V_Analysis_Job] TO [Limited_Table_Write] AS [dbo] GO GRANT SELECT ON [dbo].[V_Analysis_Job] TO [Limited_Table_Write] AS [dbo] GO GRANT UPDATE ON [dbo].[V_Analysis_Job] TO [Limited_Table_Write] AS [dbo] GO
<filename>spring-boot-test-extend-samples/data-jdbc-spring-boot-test-sample/mybatis-plus-spring-boot-test-smaple/src/test/resources/schema.sql DROP table if exists user; CREATE TABLE `user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ;
/* Navicat Premium Data Transfer Source Server : loalhost Source Server Type : MySQL Source Server Version : 50731 Source Host : localhost:3306 Source Schema : global_server Target Server Type : MySQL Target Server Version : 50731 File Encoding : 65001 Date: 27/11/2020 18:44:34 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for user_acccount -- ---------------------------- DROP TABLE IF EXISTS `user_acccount`; CREATE TABLE `user_acccount` ( `sid` bigint(20) NOT NULL, `account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`sid`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
<reponame>FlukerGames/ever-wallet-api<filename>migrations/20220204093759_token_version.sql DROP TYPE IF EXISTS twa_token_wallet_version; CREATE TYPE twa_token_wallet_version as ENUM ( 'OldTip3v4', 'Tip3' ); ALTER TABLE token_owners ADD COLUMN version twa_token_wallet_version NOT NULL DEFAULT 'OldTip3v4';
<gh_stars>10-100 CREATE PROCEDURE tSQLt.Private_SetConfiguration @Name NVARCHAR(100), @Value SQL_VARIANT AS BEGIN IF(EXISTS(SELECT 1 FROM tSQLt.Private_Configurations WITH(ROWLOCK,UPDLOCK) WHERE Name = @Name)) BEGIN UPDATE tSQLt.Private_Configurations SET Value = @Value WHERE Name = @Name; END; ELSE BEGIN INSERT tSQLt.Private_Configurations(Name,Value) VALUES(@Name,@Value); END; END;
CREATE FUNCTION func228() RETURNS integer LANGUAGE plpgsql AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE495);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE124);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE398);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW4);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW53);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW68);CALL FUNC117(MYVAR);CALL FUNC997(MYVAR);CALL FUNC535(MYVAR);CALL FUNC313(MYVAR);END $$; GO
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 */; DROP TABLE IF EXISTS `auth_assignment`; CREATE TABLE IF NOT EXISTS `auth_assignment` ( `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) DEFAULT NULL, PRIMARY KEY (`item_name`,`user_id`), KEY `afp2_idx-auth_assignment-user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES ('admin', '1', 1557776957), ('admin', '11', 1558150589), ('admin', '6', 1557832970), ('admin', '7', 1557841607), ('teacher', '3', 1558185801), ('teacher', '9', 1558029847); DROP TABLE IF EXISTS `auth_item`; CREATE TABLE IF NOT EXISTS `auth_item` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `type` smallint(6) NOT NULL, `description` text COLLATE utf8_unicode_ci, `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `data` blob, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`name`), KEY `rule_name` (`rule_name`), KEY `afp2_idx-auth_item-type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES ('addCardPair', 2, 'Create new card pair', NULL, NULL, 1557776957, 1557776957), ('addUser', 2, 'Create new user', NULL, NULL, 1557776957, 1557776957), ('admin', 1, NULL, NULL, NULL, 1557776957, 1557776957), ('removeCardPair', 2, 'Remove card pair', NULL, NULL, 1557776957, 1557776957), ('removeUser', 2, 'Remove user', NULL, NULL, 1557776957, 1557776957), ('teacher', 1, NULL, NULL, NULL, 1557776957, 1557776957), ('updateCardPair', 2, 'Update card pair', NULL, NULL, 1557776957, 1557776957), ('updateUser', 2, 'Update user', NULL, NULL, 1557776957, 1557776957); DROP TABLE IF EXISTS `auth_item_child`; CREATE TABLE IF NOT EXISTS `auth_item_child` ( `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`parent`,`child`), KEY `child` (`child`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `auth_item_child` (`parent`, `child`) VALUES ('admin', 'addUser'), ('admin', 'removeUser'), ('admin', 'teacher'), ('admin', 'updateUser'), ('teacher', 'addCardPair'), ('teacher', 'removeCardPair'), ('teacher', 'updateCardPair'); DROP TABLE IF EXISTS `auth_rule`; CREATE TABLE IF NOT EXISTS `auth_rule` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `data` blob, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `course`; CREATE TABLE IF NOT EXISTS `course` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `team` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `subject_id` int(11) UNSIGNED NOT NULL, `instructor_id` int(11) UNSIGNED NOT NULL, `semester_id` int(4) UNSIGNED NOT NULL, `created_by` int(11) UNSIGNED NOT NULL, `updated_by` int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_course_user1_idx` (`created_by`), KEY `fk_course_user2_idx` (`updated_by`), KEY `fk_course_subject1_idx` (`subject_id`), KEY `fk_course_semester1_idx` (`semester_id`), KEY `fk_course_instructor1_idx` (`instructor_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `file`; CREATE TABLE IF NOT EXISTS `file` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `course_id` int(11) UNSIGNED NOT NULL, `uploaded_at` datetime NOT NULL, `created_by` int(11) UNSIGNED NOT NULL, `updated_by` int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_file_course1_idx` (`course_id`), KEY `fk_file_user1_idx` (`created_by`), KEY `fk_file_user2_idx` (`updated_by`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `instructor`; CREATE TABLE IF NOT EXISTS `instructor` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(99) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(99) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `created_by` int(11) UNSIGNED NOT NULL, `updated_by` int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_instructor_user1_idx` (`created_by`), KEY `fk_instructor_user2_idx` (`updated_by`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `migration`; CREATE TABLE IF NOT EXISTS `migration` ( `version` varchar(180) COLLATE utf8_unicode_ci NOT NULL, `apply_time` int(11) DEFAULT NULL, PRIMARY KEY (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `scedule`; CREATE TABLE IF NOT EXISTS `scedule` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci, `deadline` datetime NOT NULL, `course_id` int(10) UNSIGNED NOT NULL, `created_by` int(11) UNSIGNED NOT NULL, `updated_by` int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_scedule_user1_idx` (`created_by`), KEY `fk_scedule_user2_idx` (`updated_by`), KEY `fk_scedule_course1_idx` (`course_id`) ) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `semester`; CREATE TABLE IF NOT EXISTS `semester` ( `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT, `semester` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `created_by` int(11) UNSIGNED NOT NULL, `updated_by` int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_semester_user1_idx` (`created_by`), KEY `fk_semester_user2_idx` (`updated_by`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `subject`; CREATE TABLE IF NOT EXISTS `subject` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci, `created_by` int(11) UNSIGNED NOT NULL, `updated_by` int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_subject_user_idx` (`created_by`), KEY `fk_subject_user1_idx` (`updated_by`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; DROP TABLE IF EXISTS `user`; CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(99) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `user` (`id`, `username`, `email`, `password`) VALUES (1, 'admin', '<EMAIL>', <PASSWORD>'), (2, 'diák', '<EMAIL>', <PASSWORD>'), (3, 'szerkesztő', '<EMAIL>', '$2y$10$3FjmQBWT3A3L918Gq.PR2uOC3jk36ZZ0l.LX3Sf1XH4t5YJf2c/Ou'); ALTER TABLE `auth_assignment` ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `auth_item` ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE; ALTER TABLE `auth_item_child` ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `course` ADD CONSTRAINT `fk_course_instructor1` FOREIGN KEY (`instructor_id`) REFERENCES `instructor` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_course_semester1` FOREIGN KEY (`semester_id`) REFERENCES `semester` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_course_subject1` FOREIGN KEY (`subject_id`) REFERENCES `subject` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_course_user1` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_course_user2` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `file` ADD CONSTRAINT `fk_file_course1` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_file_user1` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_file_user2` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `instructor` ADD CONSTRAINT `fk_instructor_user1` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_instructor_user2` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `scedule` ADD CONSTRAINT `fk_scedule_course1` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_scedule_user1` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_scedule_user2` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `semester` ADD CONSTRAINT `fk_semester_user1` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_semester_user2` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `subject` ADD CONSTRAINT `fk_subject_user` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_subject_user1` FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- data/update_data.sql -- Copyright 2019 Evans Policy Analysis and Research Group (EPAR) -- This project is licensed under the 3-Clause BSD License. Please see the -- license.txt file for more information. ------------------------------------------------------------------------------- -- CREATE NEW TABLES -- ------------------------------------------------------------------------------- CREATE TABLE public.estimates_update ( id bigserial PRIMARY KEY, hexid text, geography text, survey text, instrument text, year text, "indicatorCategory" text, indicator text, units text, "cropDisaggregation" text, "genderDisaggregation" text, "farmSizeDisaggregation" text, ruralortotal text, subpopulation text, "currencyConversion" text, "indicatorLevel" text, weight text, "variableName" text, mean numeric, se numeric, sd numeric, p25 numeric, median numeric, p75 numeric, minim numeric, maxim numeric, n numeric, nover30 text ); CREATE TABLE public.indcons_update ( hexid text, indicator text PRIMARY KEY, "indicatorCategory" text, varnamestem text, "genderDisaggregation" text, "farmSizeDisaggregation" text, "cropDisaggregation" text, subpopulation text, rowsperinstrument text, "numerator" text, "denominator" text, "units" text, "indicatorLevel" text, weight text, constructiondecision text, winsorizing text ); CREATE TABLE public.cntrycons_update ( id bigserial PRIMARY KEY, instrument text, cntrydec text, indicator text REFERENCES indcons_update ); ------------------------------------------------------------------------------- -- MODIFY THE TABLES -- ------------------------------------------------------------------------------- -- Import the data from the respective csv files -- \COPY estimates_update FROM 'estimates_cleaned.csv' CSV; -- Remove the AgDev results DELETE FROM public.estimates_update WHERE survey = 'AgDev Baseline'; \COPY indcons_update FROM 'decs_cleaned.csv' CSV; \COPY cntrycons_update FROM 'ctry_decs_cleaned.csv' CSV; -- Change owners of the new tables to epardata -- -- ALTER TABLE public.estimates_update OWNER TO epardata; -- ALTER TABLE public.indcons_update OWNER to epardata; -- ALTER TABLE public.cntrycons_update OWNER to epardata; -- Suppress Nigerian Yield Estimates -- UPDATE estimates_update SET mean = 0.0, se = 0.0, sd = 0.0, median = 0.0, minim = 0.0, maxim = 0.0, p25 = 0.0, p75 = 0.0 WHERE indicator LIKE 'Yield%' AND geography = 'Nigeria'; ------------------------------------------------------------------------------- -- REPLACE OLD TABLE -- ------------------------------------------------------------------------------- -- Out with the old -- DROP TABLE estimates, indcons, cntrycons; -- In with the new -- ALTER TABLE estimates_update RENAME TO estimates; ALTER TABLE indcons_update RENAME TO indcons; ALTER TABLE cntrycons_update RENAME TO cntrycons;
=> SELECT format('create index on my_table(%I)', attname) -> FROM pg_attribute -> WHERE attrelid = 'my_table'::regclass AND attnum > 0 -> ORDER BY attnum -> \gexec CREATE INDEX CREATE INDEX CREATE INDEX CREATE INDEX
-- login with vanillacqrs on database vanillacqrs DROP OWNED BY vanillacqrs; CREATE TABLE "$checkpoints" ( name TEXT PRIMARY KEY, value JSON ); CREATE TABLE "$versions" ( name TEXT PRIMARY KEY, version FLOAT(53) );
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 22, 2018 at 08:06 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `job` -- -- -------------------------------------------------------- -- -- Table structure for table `job_catagory` -- CREATE TABLE `job_catagory` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `salaryForm` varchar(255) NOT NULL, `salaryTo` varchar(255) NOT NULL, `cmbCurrency` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `job_circular_dtls` -- CREATE TABLE `job_circular_dtls` ( `id` int(11) NOT NULL, `job_catagory_id` varchar(255) NOT NULL, `agent` varchar(255) NOT NULL, `needWorker` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `job_catagory` -- ALTER TABLE `job_catagory` ADD PRIMARY KEY (`id`); -- -- Indexes for table `job_circular_dtls` -- ALTER TABLE `job_circular_dtls` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `job_catagory` -- ALTER TABLE `job_catagory` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `job_circular_dtls` -- ALTER TABLE `job_circular_dtls` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<gh_stars>0 USE [msdb] GO /****** Object: StoredProcedure [dbo].[sReplicaSyncStateMonitor] Script Date: 9/11/2018 11:24:21 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <<NAME>> -- Create date: <9/11/18> -- Description: <Checks AG replica state and emails if a problem exists. > -- ============================================= ALTER PROCEDURE [dbo].[sReplicaSyncStateMonitor] -- Add the parameters for the stored procedure here @DatabaseToMonitor VARCHAR(128) AS BEGIN --declare variables for procedure DECLARE @serverName AS VARCHAR(128) DECLARE @syncStateDesc AS VARCHAR(128) DECLARE @modeDesc AS VARCHAR(128) DECLARE @desiredState AS VARCHAR(128) DECLARE @prevState AS VARCHAR(128) DECLARE @suspendDesc AS VARCHAR(32) DECLARE @isSuspended AS INT DECLARE @db_id AS int DECLARE @send_mail AS int DECLARE @emailBody AS VARCHAR(MAX) DECLARE @emailSubj AS VARCHAR(128) DECLARE @bodyHead AS VARCHAR(MAX) DECLARE @bodyFoot AS VARCHAR(MAX) DECLARE @bodyResults AS VARCHAR(MAX) --define the header and footer for the HTML message SET @bodyHead ='<html><body><H3>Availability Group Replica Status Notification</H3> <br> <p>Any replicas listed here are either not syncing data or have resumed syncing data after a problem condition. Take note of the status shown and the server name. This job runs every 5 minutes. If this notice states that a server has a problem condition, and you do not see a notification within 15 minutes stating that the problem is resolved, contact a member of the sysadmin team. </p> <br> <br> <b>' SET @bodyFoot = '</b> <br> <br> <p style="font-size:10px;font-decoration:italic"> E-mail generated by SQL stored procedure [msdb].[dbo].[sReplicaSyncStateMonitor] called by Agent job "Availability Group Monitoring: Replica Sync State Monitor" on ' + @@SERVERNAME + '.</p>' --set the send_mail flag to 0 SET @send_mail = 0 --check for temp tables used and drop if they exist DROP TABLE IF EXISTS #ReplicaStateCheck DROP TABLE IF EXISTS #ReplicaStateCheckResults --create a temp table for results CREATE TABLE #ReplicaStateCheckResults( NodeStatus VARCHAR(256) ) --set the database ID based on a query to sys.databases filtered by a name match SET @db_id = (SELECT database_id from sys.databases WHERE name = @DatabaseToMonitor); --select status of replicas, name of replicas, and the type of replica and insert into temp table SELECT DISTINCT r.replica_server_name, s.synchronization_state_desc, r.availability_mode_desc, s.is_suspended, s.suspend_reason_desc INTO #ReplicaStateCheck FROM sys.dm_hadr_database_replica_states s INNER JOIN sys.availability_replicas r ON s.replica_id = r.replica_id WHERE s.database_id = @db_id --declare a cursor to go over the results and open it DECLARE curs CURSOR FOR SELECT replica_server_name, synchronization_state_desc, availability_mode_desc, is_suspended, suspend_reason_desc FROM #ReplicaStateCheck OPEN curs --get next values and put into variables FETCH NEXT FROM curs INTO @serverName, @syncStateDesc, @modeDesc, @isSuspended, @suspendDesc WHILE @@FETCH_STATUS = 0 BEGIN --set the desired state based on the type of replica it is IF @modeDesc = 'SYNCHRONOUS_COMMIT' BEGIN SET @desiredState = 'SYNCHRONIZED' END ELSE IF @modeDesc = 'ASYNCHRONOUS_COMMIT' BEGIN SET @desiredState = 'SYNCHRONIZING' END --special handling for suspension initiated by user for maintenance IF @isSuspended = 1 BEGIN IF @suspendDesc = 'SUSPEND_FROM_USER' BEGIN SET @send_mail = 1 INSERT INTO #ReplicaStateCheckResults VALUES( 'Data movement has been suspended on:' + @serverName + '. The suspend reason was returned as ' + @suspendDesc + ', which indicates that an administrator is performing maintenance on this node.' ) END ELSE BEGIN SET @send_mail = 1 INSERT INTO #ReplicaStateCheckResults VALUES( 'Data movement has been suspended on:' + @serverName + '; sync state should be ' + @desiredState + ' and is ' + @syncStateDesc +'. The suspension was caused by SQL Server for the following reason:' + @suspendDesc ) END END ELSE BEGIN --check status, if not in a list of good statuses, insert the statement explaining the problem into the temp table, and switch the sendmail flag IF @syncStateDesc NOT IN ('SYNCHRONIZED','SYNCHRONIZING') BEGIN SET @send_mail = 1 INSERT INTO #ReplicaStateCheckResults VALUES( 'Problem on server:' + @serverName + '; sync state should be ' + @desiredState + ' and is ' + @syncStateDesc ) END --check status, if status is good, check the previous reported status. and if the status before was a bad status, notify saying that the situation has resolved IF @syncStateDesc IN ('SYNCHRONIZED','SYNCHRONIZING') BEGIN SET @prevState = (SELECT TOP 1 reportedState FROM msdb.dbo.ReplicaSyncStateHistory WHERE serverName = @serverName AND monitoredDatabase = @DatabaseToMonitor ORDER BY checkedAtTime DESC) IF @syncStateDesc = @prevState BEGIN PRINT 'No problems with node:' + @serverName END ELSE IF @syncStateDesc <> @prevState BEGIN SET @send_mail = 1 INSERT INTO #ReplicaStateCheckResults VALUES( 'Sync problem has resolved on: ' + @serverName + '; last sync state was ' + @prevState + ' and is now ' + @syncStateDesc ) END END END --insert results into database table for history INSERT INTO msdb.dbo.ReplicaSyncStateHistory ( [checkedAtTime], [serverName], [desiredState], [reportedState], [monitoredDatabase], [isSuspended], [suspend_reason_desc] ) VALUES( GETDATE(), @serverName, @desiredState, @syncStateDesc, DB_NAME(@db_id), @isSuspended, @suspendDesc ) --get next values FETCH NEXT FROM curs INTO @serverName, @syncStateDesc, @modeDesc, @isSuspended, @suspendDesc END --close and deallocate cursor CLOSE curs DEALLOCATE curs --if send_mail flag was tripped, send an email with the results IF @send_mail = 1 BEGIN SELECT @bodyResults = COALESCE(@bodyResults + '<br>' + NodeStatus, NodeStatus) FROM #ReplicaStateCheckResults SET @emailBody = @bodyHead + @bodyResults + @bodyFoot SET @emailSubj = 'Alert - Node Synchronization on ' + @DatabaseToMonitor + ' Availability Group' EXEC msdb.dbo.sp_send_dbmail @profile_name = 'public-default', @body = @emailBody, @body_format = 'HTML', @recipients = '<EMAIL>', @subject = @emailSubj; END --SELECT * FROM #ReplicaStateCheckResults DROP TABLE #ReplicaStateCheck DROP TABLE #ReplicaStateCheckResults --clean up records older than 30 days in the database table DELETE FROM msdb.dbo.ReplicaSyncStateHistory WHERE DATEDIFF(DAY, checkedAtTime, GETDATE()) > 30 END
-- /******************************************************* -- * -- * Drop civicrm_membershipperiod table -- * -- * Developed for interview purpose -- * -- * @author <NAME> -- * -- *******************************************************/ DROP TABLE IF EXISTS `civicrm_membershipperiod`;
insert into inventory_item(id, quantity, product_code, create_time, last_update_time) VALUES (1, 2, 'p1', now(), now()), (2, 5, 'p2', now(), now()), (3, 10, 'p3', now(), now()) on duplicate key update product_code=values(product_code);
CREATE TABLE "SystemUserSet" ("optevia_Language_Id" UUID, "optevia_Language_LogicalName" TEXT, "optevia_Language_Name" TEXT, "optevia_Number" TEXT, "QueueId_Id" UUID, "QueueId_LogicalName" TEXT, "QueueId_Name" TEXT, "CreatedBy_Id" UUID, "CreatedBy_LogicalName" TEXT, "CreatedBy_Name" TEXT, "PreferredAddressCode_Value" INTEGER, "NickName" TEXT, "Address1_Latitude" FLOAT, "Address2_StateOrProvince" TEXT, "optevia_Address2" TEXT, "optevia_OG_USERDATA_ID" TEXT, "optevia_UKRegion_Id" UUID, "optevia_UKRegion_LogicalName" TEXT, "optevia_UKRegion_Name" TEXT, "optevia_towncity" TEXT, "optevia_CountryCode" TEXT, "optevia_Extension" TEXT, "optevia_Address1" TEXT, "Address1_County" TEXT, "VersionNumber" BIGINT, "Address2_Country" TEXT, "optevia_ConcatenatedAddress" TEXT, "Address2_PostOfficeBox" TEXT, "PreferredPhoneCode_Value" INTEGER, "optevia_Serviceproviderprimaryaddress" TEXT, "Title" TEXT, "SetupUser" BOOLEAN, "optevia_LocallanguageSuffix" TEXT, "FirstName" TEXT, "optevia_Country_Id" UUID, "optevia_Country_LogicalName" TEXT, "optevia_Country_Name" TEXT, "EmployeeId" TEXT, "TerritoryId_Id" UUID, "TerritoryId_LogicalName" TEXT, "TerritoryId_Name" TEXT, "JobTitle" TEXT, "optevia_emailaddresstype_Id" UUID, "optevia_emailaddresstype_LogicalName" TEXT, "optevia_emailaddresstype_Name" TEXT, "optevia_OG_CREATED_BY" TEXT, "optevia_og_systemuser_id" TEXT, "Skills" TEXT, "CalendarId_Id" UUID, "CalendarId_LogicalName" TEXT, "CalendarId_Name" TEXT, "optevia_LocalLanguagePostcode" TEXT, "optevia_SecurityRoleConfiguration" TEXT, "IsIntegrationUser" BOOLEAN, "optevia_Title_Id" UUID, "optevia_Title_LogicalName" TEXT, "optevia_Title_Name" TEXT, "Address1_PostalCode" TEXT, "Address2_AddressId" UUID, "optevia_Nationality_Id" UUID, "optevia_Nationality_LogicalName" TEXT, "optevia_Nationality_Name" TEXT, "optevia_SourceObsolete" INTEGER, "WindowsLiveID" TEXT, "optevia_PostCode" TEXT, "Address1_Line3" TEXT, "DisabledReason" TEXT, "Address2_UTCOffset" INTEGER, "Address1_Line2" TEXT, "optevia_AddressComment" TEXT, "Address1_City" TEXT, "PersonalEMailAddress" TEXT, "optevia_Suffix" TEXT, "Address1_Telephone2" TEXT, "CreatedOnBehalfBy_Id" UUID, "CreatedOnBehalfBy_LogicalName" TEXT, "CreatedOnBehalfBy_Name" TEXT, "BusinessUnitId_Id" UUID, "BusinessUnitId_LogicalName" TEXT, "BusinessUnitId_Name" TEXT, "Address1_Longitude" FLOAT, "OrganizationId" UUID, "YomiFirstName" TEXT, "ExchangeRate" DECIMAL(10,0), "optevia_IsAdvisor" BOOLEAN, "Address1_ShippingMethodCode_Value" INTEGER, "YomiMiddleName" TEXT, "optevia_Address3" TEXT, "Address2_Line2" TEXT, "detica_SpeicalDeiliveryProviderAdvisorId_Id" UUID, "detica_SpeicalDeiliveryProviderAdvisorId_LogicalName" TEXT, "detica_SpeicalDeiliveryProviderAdvisorId_Name" TEXT, "DefaultFiltersPopulated" BOOLEAN, "Address1_Line1" TEXT, "Address1_Telephone1" TEXT, "SystemUserId" UUID NOT NULL, "optevia_epiphanyuserid" TEXT, "optevia_telephonetype_Id" UUID, "optevia_telephonetype_LogicalName" TEXT, "optevia_telephonetype_Name" TEXT, "YomiLastName" TEXT, "optevia_OG_MODIFIED_BY" TEXT, "Address2_Latitude" FLOAT, "CALType_Value" INTEGER, "AccessMode_Value" INTEGER, "LastName" TEXT, "optevia_OG_EMAILADDRESS_ID" TEXT, "optevia_OG_CREATED" TIMESTAMP, "optevia_LocallanguageTitle" TEXT, "optevia_OG_EPIPHANYUSER_ID" TEXT, "detica_SpecialistDeliveryProviderOrderId_Id" UUID, "detica_SpecialistDeliveryProviderOrderId_LogicalName" TEXT, "detica_SpecialistDeliveryProviderOrderId_Name" TEXT, "InternalEMailAddress" TEXT, "optevia_OG_ADDRESS_ID" TEXT, "YomiFullName" TEXT, "MobilePhone" TEXT, "PhotoUrl" TEXT, "SiteId_Id" UUID, "SiteId_LogicalName" TEXT, "SiteId_Name" TEXT, "TransactionCurrencyId_Id" UUID, "TransactionCurrencyId_LogicalName" TEXT, "TransactionCurrencyId_Name" TEXT, "IsDisabled" BOOLEAN, "DomainName" TEXT, "optevia_OG_SERVICEPROVIDER_ID" TEXT, "optevia_OG_MODIFIED" TIMESTAMP, "PassportLo" INTEGER, "Address1_Name" TEXT, "Address2_Telephone2" TEXT, "EmailRouterAccessApproval_Value" INTEGER, "ParentSystemUserId_Id" UUID, "ParentSystemUserId_LogicalName" TEXT, "ParentSystemUserId_Name" TEXT, "optevia_LocationType_Id" UUID, "optevia_LocationType_LogicalName" TEXT, "optevia_LocationType_Name" TEXT, "optevia_Gender_Id" UUID, "optevia_Gender_LogicalName" TEXT, "optevia_Gender_Name" TEXT, "FullName" TEXT, "Address2_Longitude" FLOAT, "optevia_StateCounty" TEXT, "Salutation" TEXT, "Address2_City" TEXT, "MiddleName" TEXT, "Address1_AddressTypeCode_Value" INTEGER, "Address2_County" TEXT, "optevia_locallanguageaddress" TEXT, "optevia_OG_AGENT_ID" TEXT, "InviteStatusCode_Value" INTEGER, "Address2_Line1" TEXT, "Address2_UPSZone" TEXT, "Address1_UTCOffset" INTEGER, "Address2_ShippingMethodCode_Value" INTEGER, "PassportHi" INTEGER, "Address1_Country" TEXT, "optevia_Address4" TEXT, "Address1_Telephone3" TEXT, "optevia_AddressType_Id" UUID, "optevia_AddressType_LogicalName" TEXT, "optevia_AddressType_Name" TEXT, "Address2_PostalCode" TEXT, "Address2_Telephone1" TEXT, "optevia_pafoverride" BOOLEAN, "IsLicensed" BOOLEAN, "optevia_TelephoneNumber" TEXT, "GovernmentId" TEXT, "ModifiedOnBehalfBy_Id" UUID, "ModifiedOnBehalfBy_LogicalName" TEXT, "ModifiedOnBehalfBy_Name" TEXT, "optevia_AreaCode" TEXT, "Address2_Line3" TEXT, "IsSyncWithDirectory" BOOLEAN, "optevia_fullname" TEXT, "UTCConversionTimeZoneCode" INTEGER, "detica_PrimaryMarketOrderId_Id" UUID, "detica_PrimaryMarketOrderId_LogicalName" TEXT, "detica_PrimaryMarketOrderId_Name" TEXT, "optevia_OG_TELEPHONE_ID" TEXT, "ModifiedOn" TIMESTAMP, "ModifiedBy_Id" UUID, "ModifiedBy_LogicalName" TEXT, "ModifiedBy_Name" TEXT, "HomePhone" TEXT, "optevia_LocallanguageName" TEXT, "PreferredEmailCode_Value" INTEGER, "Address2_Name" TEXT, "OverriddenCreatedOn" TIMESTAMP, "Address1_UPSZone" TEXT, "ImportSequenceNumber" INTEGER, "Address1_AddressId" UUID, "optevia_Website" TEXT, "OutgoingEmailDeliveryMethod_Value" INTEGER, "MobileAlertEMail" TEXT, "optevia_fulltelephonenumber" TEXT, "Address2_AddressTypeCode_Value" INTEGER, "Address1_Fax" TEXT, "CreatedOn" TIMESTAMP, "optevia_HasServiceProviderChanged" BOOLEAN, "Address2_Telephone3" TEXT, "Address1_PostOfficeBox" TEXT, "IncomingEmailDeliveryMethod_Value" INTEGER, "optevia_LastUpdatedDateTime" TIMESTAMP, "Address1_StateOrProvince" TEXT, "detica_AdvisorsId_Id" UUID, "detica_AdvisorsId_LogicalName" TEXT, "detica_AdvisorsId_Name" TEXT, "DisplayInServiceViews" BOOLEAN, "TimeZoneRuleVersionNumber" INTEGER, "Address2_Fax" TEXT, "SystemUsercalendar_system_usersCalendar_CalendarId" UUID, "SystemUserterritory_system_usersTerritory_TerritoryId" UUID, "SystemUseroptevia_systemuser_Languageoptevia_language_optevia_languageId" UUID, "SystemUserdetica_detica_specialistdeliveryprovider_systemudetica_specialistdeliveryprovider_detica_specialistdeliveryproviderId" UUID, "SystemUserTransactionCurrency_SystemUserTransactionCurrency_TransactionCurrencyId" UUID, "SystemUserdetica_detica_omisorder_systemusersdetica_omisorder_detica_omisorderId" UUID, "SystemUserorganization_system_usersOrganization_OrganizationId" UUID, "SystemUserdetica_detica_omisorder_systemuser_Speicalistdetica_omisorder_detica_omisorderId" UUID, "SystemUserlk_systemuserbase_modifiedbySystemUser_SystemUserId" UUID, "SystemUsersite_system_usersSite_SiteId" UUID, "SystemUseroptevia_systemuser_UKRegionoptevia_ukregion_optevia_ukregionId" UUID, "SystemUseroptevia_advisor_nationalityoptevia_nationality_optevia_nationalityId" UUID, "SystemUseroptevia_optevia_country_systemuser_Countryoptevia_country_optevia_countryId" UUID, "SystemUserdetica_detica_omisorder_systemuserdetica_omisorder_detica_omisorderId" UUID, "SystemUserlk_systemuserbase_createdbySystemUser_SystemUserId" UUID, "SystemUseruser_parent_userSystemUser_SystemUserId" UUID, "SystemUseroptevia_advisor_genderoptevia_gender_optevia_genderId" UUID, "SystemUseroptevia_advisor_emailaddresstypeoptevia_emailaddresstype_optevia_emailaddresstypeId" UUID, "SystemUserqueue_system_userQueue_QueueId" UUID, "SystemUseroptevia_advisor_titleoptevia_title_optevia_titleId" UUID, "SystemUserlk_systemuser_modifiedonbehalfbySystemUser_SystemUserId" UUID, "SystemUseroptevia_advisor_addresstypeoptevia_addresstype_optevia_addresstypeId" UUID, "SystemUserlk_systemuser_createdonbehalfbySystemUser_SystemUserId" UUID, "SystemUserbusiness_unit_system_usersBusinessUnit_BusinessUnitId" UUID, "SystemUseroptevia_advisor_locationtypeoptevia_locationtype_optevia_locationtypeId" UUID, "SystemUseroptevia_advisor_telephoneoptevia_telephonetype_optevia_telephonetypeId" UUID, PRIMARY KEY ("SystemUserId"), CONSTRAINT "SystemUsercalendar_system_usersCalendar" FOREIGN KEY ("SystemUsercalendar_system_usersCalendar_CalendarId") REFERENCES "CalendarSet"("CalendarId"), CONSTRAINT "SystemUserterritory_system_usersTerritory" FOREIGN KEY ("SystemUserterritory_system_usersTerritory_TerritoryId") REFERENCES "TerritorySet"("TerritoryId"), CONSTRAINT "SystemUseroptevia_systemuser_Languageoptevia_language" FOREIGN KEY ("SystemUseroptevia_systemuser_Languageoptevia_language_optevia_languageId") REFERENCES "optevia_languageSet"("optevia_languageId"), CONSTRAINT "SystemUserdetica_detica_specialistdeliveryprovider_systemudetica_specialistdeliveryprovider" FOREIGN KEY ("SystemUserdetica_detica_specialistdeliveryprovider_systemudetica_specialistdeliveryprovider_detica_specialistdeliveryproviderId") REFERENCES "detica_specialistdeliveryproviderSet"("detica_specialistdeliveryproviderId"), CONSTRAINT "SystemUserTransactionCurrency_SystemUserTransactionCurrency" FOREIGN KEY ("SystemUserTransactionCurrency_SystemUserTransactionCurrency_TransactionCurrencyId") REFERENCES "TransactionCurrencySet"("TransactionCurrencyId"), CONSTRAINT "SystemUserdetica_detica_omisorder_systemusersdetica_omisorder" FOREIGN KEY ("SystemUserdetica_detica_omisorder_systemusersdetica_omisorder_detica_omisorderId") REFERENCES "detica_omisorderSet"("detica_omisorderId"), CONSTRAINT "SystemUserorganization_system_usersOrganization" FOREIGN KEY ("SystemUserorganization_system_usersOrganization_OrganizationId") REFERENCES "OrganizationSet"("OrganizationId"), CONSTRAINT "SystemUserdetica_detica_omisorder_systemuser_Speicalistdetica_omisorder" FOREIGN KEY ("SystemUserdetica_detica_omisorder_systemuser_Speicalistdetica_omisorder_detica_omisorderId") REFERENCES "detica_omisorderSet"("detica_omisorderId"), CONSTRAINT "SystemUserlk_systemuserbase_modifiedbySystemUser" FOREIGN KEY ("SystemUserlk_systemuserbase_modifiedbySystemUser_SystemUserId") REFERENCES "SystemUserSet"("SystemUserId"), CONSTRAINT "SystemUsersite_system_usersSite" FOREIGN KEY ("SystemUsersite_system_usersSite_SiteId") REFERENCES "SiteSet"("SiteId"), CONSTRAINT "SystemUseroptevia_systemuser_UKRegionoptevia_ukregion" FOREIGN KEY ("SystemUseroptevia_systemuser_UKRegionoptevia_ukregion_optevia_ukregionId") REFERENCES "optevia_ukregionSet"("optevia_ukregionId"), CONSTRAINT "SystemUseroptevia_advisor_nationalityoptevia_nationality" FOREIGN KEY ("SystemUseroptevia_advisor_nationalityoptevia_nationality_optevia_nationalityId") REFERENCES "optevia_nationalitySet"("optevia_nationalityId"), CONSTRAINT "SystemUseroptevia_optevia_country_systemuser_Countryoptevia_country" FOREIGN KEY ("SystemUseroptevia_optevia_country_systemuser_Countryoptevia_country_optevia_countryId") REFERENCES "optevia_countrySet"("optevia_countryId"), CONSTRAINT "SystemUserdetica_detica_omisorder_systemuserdetica_omisorder" FOREIGN KEY ("SystemUserdetica_detica_omisorder_systemuserdetica_omisorder_detica_omisorderId") REFERENCES "detica_omisorderSet"("detica_omisorderId"), CONSTRAINT "SystemUserlk_systemuserbase_createdbySystemUser" FOREIGN KEY ("SystemUserlk_systemuserbase_createdbySystemUser_SystemUserId") REFERENCES "SystemUserSet"("SystemUserId"), CONSTRAINT "SystemUseruser_parent_userSystemUser" FOREIGN KEY ("SystemUseruser_parent_userSystemUser_SystemUserId") REFERENCES "SystemUserSet"("SystemUserId"), CONSTRAINT "SystemUseroptevia_advisor_genderoptevia_gender" FOREIGN KEY ("SystemUseroptevia_advisor_genderoptevia_gender_optevia_genderId") REFERENCES "optevia_genderSet"("optevia_genderId"), CONSTRAINT "SystemUseroptevia_advisor_emailaddresstypeoptevia_emailaddresstype" FOREIGN KEY ("SystemUseroptevia_advisor_emailaddresstypeoptevia_emailaddresstype_optevia_emailaddresstypeId") REFERENCES "optevia_emailaddresstypeSet"("optevia_emailaddresstypeId"), CONSTRAINT "SystemUserqueue_system_userQueue" FOREIGN KEY ("SystemUserqueue_system_userQueue_QueueId") REFERENCES "QueueSet"("QueueId"), CONSTRAINT "SystemUseroptevia_advisor_titleoptevia_title" FOREIGN KEY ("SystemUseroptevia_advisor_titleoptevia_title_optevia_titleId") REFERENCES "optevia_titleSet"("optevia_titleId"), CONSTRAINT "SystemUserlk_systemuser_modifiedonbehalfbySystemUser" FOREIGN KEY ("SystemUserlk_systemuser_modifiedonbehalfbySystemUser_SystemUserId") REFERENCES "SystemUserSet"("SystemUserId"), CONSTRAINT "SystemUseroptevia_advisor_addresstypeoptevia_addresstype" FOREIGN KEY ("SystemUseroptevia_advisor_addresstypeoptevia_addresstype_optevia_addresstypeId") REFERENCES "optevia_addresstypeSet"("optevia_addresstypeId"), CONSTRAINT "SystemUserlk_systemuser_createdonbehalfbySystemUser" FOREIGN KEY ("SystemUserlk_systemuser_createdonbehalfbySystemUser_SystemUserId") REFERENCES "SystemUserSet"("SystemUserId"), CONSTRAINT "SystemUserbusiness_unit_system_usersBusinessUnit" FOREIGN KEY ("SystemUserbusiness_unit_system_usersBusinessUnit_BusinessUnitId") REFERENCES "BusinessUnitSet"("BusinessUnitId"), CONSTRAINT "SystemUseroptevia_advisor_locationtypeoptevia_locationtype" FOREIGN KEY ("SystemUseroptevia_advisor_locationtypeoptevia_locationtype_optevia_locationtypeId") REFERENCES "optevia_locationtypeSet"("optevia_locationtypeId"), CONSTRAINT "SystemUseroptevia_advisor_telephoneoptevia_telephonetype" FOREIGN KEY ("SystemUseroptevia_advisor_telephoneoptevia_telephonetype_optevia_telephonetypeId") REFERENCES "optevia_telephonetypeSet"("optevia_telephonetypeId"));
-- 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 -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `mpd_oc_escalade`; -- ----------------------------------------------------- -- Schema -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `mpd_oc_escalade` DEFAULT CHARACTER SET utf8 ; USE `mpd_oc_escalade` ; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`site` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`site` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`site` ( `id` INT NOT NULL AUTO_INCREMENT, `libelle` VARCHAR(45) NULL, `hauteur` FLOAT NULL, `tagY_N` TINYINT NULL, `ville` VARCHAR(100) NULL, `pays` VARCHAR(100) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`utilisateur` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`utilisateur` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`utilisateur` ( `id` INT NOT NULL AUTO_INCREMENT, `nom` VARCHAR(45) NULL, `prenom` VARCHAR(45) NULL, `numeroTel` VARCHAR(20) NULL, `adresse` VARCHAR(45) NULL, `codePostal` VARCHAR(45) NULL, `email` VARCHAR(45) NULL, `pseudo` VARCHAR(45) NULL, `motDePasse` VARCHAR(45) NULL, `membreAssoY_N` TINYINT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`secteur` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`secteur` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`secteur` ( `id` INT NOT NULL AUTO_INCREMENT, `libelle` VARCHAR(255) NULL, `site_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_Secteur_Site1_idx` (`site_id` ASC) , CONSTRAINT `fk_Secteur_Site1` FOREIGN KEY (`site_id`) REFERENCES `mpd_oc_escalade`.`site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`cotation` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`cotation` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`cotation` ( `id` INT NOT NULL, `libelle` VARCHAR(2) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`voie` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`voie` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`voie` ( `id` INT NOT NULL AUTO_INCREMENT, `equipeeY_N` TINYINT NOT NULL, `cotation_id` INT NOT NULL, `secteur_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_Voie_Cotation1_idx` (`cotation_id` ASC), INDEX `fk_Voie_Secteur1_idx` (`secteur_id` ASC), CONSTRAINT `fk_Voie_Cotation1` FOREIGN KEY (`cotation_id`) REFERENCES `mpd_oc_escalade`.`cotation` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Voie_Secteur1` FOREIGN KEY (`secteur_id`) REFERENCES `mpd_oc_escalade`.`secteur` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`longueur` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`longueur` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`longueur` ( `id` INT NOT NULL AUTO_INCREMENT, `relaiY_N` TINYINT NOT NULL, `cotation_id` INT NOT NULL, `voie_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_Longueur_Cotation1_idx` (`cotation_id` ASC), INDEX `fk_Longueur_Voie1_idx` (`voie_id` ASC), CONSTRAINT `fk_Longueur_Cotation1` FOREIGN KEY (`cotation_id`) REFERENCES `mpd_oc_escalade`.`cotation` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Longueur_Voie1` FOREIGN KEY (`voie_id`) REFERENCES `mpd_oc_escalade`.`voie` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`commentaire` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`commentaire` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`commentaire` ( `id` INT NOT NULL AUTO_INCREMENT, `contenu` VARCHAR(255) NULL, `utilisateur_id` INT NOT NULL, `site_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_Commentaire_Utilisateur1_idx` (`utilisateur_id` ASC) , INDEX `fk_Commentaire_Site1_idx` (`site_id` ASC) , CONSTRAINT `fk_Commentaire_Utilisateur1` FOREIGN KEY (`utilisateur_id`) REFERENCES `mpd_oc_escalade`.`utilisateur` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Commentaire_Site1` FOREIGN KEY (`site_id`) REFERENCES `mpd_oc_escalade`.`site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`statut_topo` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`statut_topo` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`statut_topo` ( `id` INT NOT NULL, `libelle` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mpd_oc_escalade`.`topo` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mpd_oc_escalade`.`topo` ; CREATE TABLE IF NOT EXISTS `mpd_oc_escalade`.`topo` ( `id` INT NOT NULL AUTO_INCREMENT, `nom` VARCHAR(50) NULL, `description` VARCHAR(250) NULL, `date_parution` DATE NULL, `statut_topo_id` INT NOT NULL, `proprietaire_id` INT NOT NULL, `emprunteur_id` INT NULL, `site_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_Topo_StatutTopo1_idx` (`statut_topo_id` ASC) , INDEX `fk_Topo_Utilisateur1_idx` (`proprietaire_id` ASC) , INDEX `fk_Topo_Utilisateur2_idx` (`emprunteur_id` ASC) , INDEX `fk_Topo_Site1_idx` (`site_id` ASC) , CONSTRAINT `fk_Topo_StatutTopo1` FOREIGN KEY (`statut_topo_id`) REFERENCES `mpd_oc_escalade`.`statut_topo` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Topo_Utilisateur1` FOREIGN KEY (`proprietaire_id`) REFERENCES `mpd_oc_escalade`.`utilisateur` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Topo_Utilisateur2` FOREIGN KEY (`emprunteur_id`) REFERENCES `mpd_oc_escalade`.`utilisateur` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Topo_Site1` FOREIGN KEY (`site_id`) REFERENCES `mpd_oc_escalade`.`site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
drop type bitcoin_transaction cascade ; drop type bitcoin_transaction_input ; drop type bitcoin_transaction_input_outpoint ; drop type bitcoin_transaction_output ; drop type bitcoin_transaction_witness ; create type bitcoin_transaction_input_outpoint as ( hash char(64), index bigint ); create type bitcoin_transaction_input as ( outpoint bitcoin_transaction_input_outpoint, script char(46), sequence bigint ); create type bitcoin_transaction_output as ( value bigint, script text ); create type bitcoin_transaction_witness as ( number bigint, "scriptCode" char(212) ); create type bitcoin_transaction as ( ins bitcoin_transaction_input[], outs bitcoin_transaction_output[], version int, marker int, flag int, witness bitcoin_transaction_witness[], locktime bigint ); create or replace function btcd_bitcoin_raw_transaction(arg_url text, arg_raw_transaction text default '9d609c57efa02ec1e897e467298f1db8b4a9aa2ac611c4684aa24e243da251e5') returns bitcoin_transaction as $$ from os import environ # The install procedure for these packages depends on how pl/Python # support was compiled for Postgres (e.g. which interpreter is used) from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from cryptos import deserialize as tx_deserialize url = None if arg_url is not None: # Use a "http://user:password@host:port" URL string from the argument list url = arg_url else: # Postgres must be started with the # following variables in the environment, # each prefixed by btcd_rpc_ (e.g. btcd_rpc_host) rpc_vars = ['host', 'port', 'user', 'password'] required_vars = set('btcd_rpc_' + v for v in rpc_vars) defined_vars = set(environ).intersection(required_vars) missing_vars = required_vars.difference(defined_vars) if missing_vars and not arg_url: message = "The following " if len(defined_vars) else "No " message += "environment variables were detected..." plpy.notice(message) plpy.notice(defined_vars if len(defined_vars) else '') plpy.notice("") plpy.notice("Please set these environment variables in the postgres user environment and restart:") plpy.notice(" '" + "', '".join(missing_vars) + "'") plpy.notice("") plpy.error("Missing required btcd environment variables or URL argument") rpc_config = { k: environ.get('btcd_rpc_' + k) for k in rpc_vars } url = "http://{user}:{password}@{host}:{port}".format(**rpc_config) try: rpc_connection = AuthServiceProxy(url) node_info = rpc_connection.getblockchaininfo() plpy.info("Current block height: {}".format(node_info.get('headers'))) except JSONRPCException as e: plpy.error(e.message) tx = tx_deserialize(rpc_connection.getrawtransaction(arg_raw_transaction)) # Note: the following two statements could be used to # flatten the transaction inputs but it was interesting to # see how far nesting Postgres user-defined types would go # # unnestIns = lambda d: { 'script': d.get('script'), # 'sequence': d.get('sequence'), # 'hash': d.get('outpoint').get('hash'), # 'index': d.get('outpoint').get('index') } # # tx['ins'] = [unnestIns(i) for i in tx['ins']] # Use a template for compatibility with earlier transactions txTemplate = { 'ins': None, 'outs': None, 'version': None, 'marker': None, 'flag': None, 'witness': None, 'locktime': None } return { **txTemplate, **tx } $$ language plpython3u volatile; -- example query for deepest nesting level: -- -- select ins[1].outpoint.hash -- from btcd_bitcoin_raw_transaction('http://nobody:supersecret@some.mine:8332'); --- Block-related objects drop type bitcoin_block cascade ; create type bitcoin_block as ( hash char(64), confirmations int, strippedsize int, size int, weight int, height int, version int, "versionHex" char(8), merkleroot char(64), tx char(64)[], time int, mediantime int, nonce bigint, bits char(8), difficulty numeric, chainwork char(64), "nTx" int, previousblockhash char(64), nextblockhash char(64) ) ; create or replace function btcd_bitcoin_block(arg_url text, arg_block_hash text default '00000000000000000009c78d56ba39c076acf1233243beaa4f07daf221eb41a3') returns bitcoin_block as $$ from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from os import environ url = None if arg_url is not None: # Use a "http://user:password@host:port" URL string from the argument list url = arg_url else: # Postgres must be started with the # following variables in the environment, # each prefixed by btcd_rpc_ (e.g. btcd_rpc_host) rpc_vars = ['host', 'port', 'user', 'password'] required_vars = set('btcd_rpc_' + v for v in rpc_vars) defined_vars = set(environ).intersection(required_vars) missing_vars = required_vars.difference(defined_vars) if missing_vars and not arg_url: message = "The following " if len(defined_vars) else "No " message += "environment variables were detected..." plpy.notice(message) plpy.notice(defined_vars if len(defined_vars) else '') plpy.notice("") plpy.notice("Please set these environment variables in the postgres user environment and restart:") plpy.notice(" '" + "', '".join(missing_vars) + "'") plpy.notice("") plpy.error("Missing required btcd environment variables or URL argument") rpc_config = { k: environ.get('btcd_rpc_' + k) for k in rpc_vars } url = "http://{user}:{password}@{host}:{port}".format(**rpc_config) try: rpc_connection = AuthServiceProxy(url) node_info = rpc_connection.getblockchaininfo() plpy.info("Current block height: {}".format(node_info.get('headers'))) except JSONRPCException as e: plpy.error(e.message) return rpc_connection.getblock(arg_block_hash) $$ language plpython3u volatile; create or replace function btcd_bitcoin_blocknumber(arg_url text, arg_block_number bigint default 1) returns bitcoin_block as $$ from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from os import environ url = None if arg_url is not None: # Use a "http://user:password@host:port" URL string from the argument list url = arg_url else: # Postgres must be started with the # following variables in the environment, # each prefixed by btcd_rpc_ (e.g. btcd_rpc_host) rpc_vars = ['host', 'port', 'user', 'password'] required_vars = set('btcd_rpc_' + v for v in rpc_vars) defined_vars = set(environ).intersection(required_vars) missing_vars = required_vars.difference(defined_vars) if missing_vars and not arg_url: message = "The following " if len(defined_vars) else "No " message += "environment variables were detected..." plpy.notice(message) plpy.notice(defined_vars if len(defined_vars) else '') plpy.notice("") plpy.notice("Please set these environment variables in the postgres user environment and restart:") plpy.notice(" '" + "', '".join(missing_vars) + "'") plpy.notice("") plpy.error("Missing required btcd environment variables or URL argument") rpc_config = { k: environ.get('btcd_rpc_' + k) for k in rpc_vars } url = "http://{user}:{password}@{host}:{port}".format(**rpc_config) try: rpc_connection = AuthServiceProxy(url) node_info = rpc_connection.getblockchaininfo() plpy.info("Current block height: {}".format(node_info.get('headers'))) except JSONRPCException as e: plpy.error(e.message) return rpc_connection.getblock(rpc_connection.getblockhash(arg_block_number)) $$ language plpython3u volatile; --- Metadata/network info related objects drop type bitcoin_blockchain_info cascade; drop type bitcoin_bip9_softforks; drop type bitcoin_bip9_softfork_meta; drop type bitcoin_softfork; drop type bitcoin_softfork_status; create type bitcoin_softfork_status as ( status boolean ); create type bitcoin_softfork as ( id text, version int, reject bitcoin_softfork_status ); create type bitcoin_bip9_softfork_meta as ( status text, "startTime" int, timeout int, since int ); create type bitcoin_bip9_softforks as ( csv bitcoin_bip9_softfork_meta, segwit bitcoin_bip9_softfork_meta ); create type bitcoin_blockchain_info as ( chain text, blocks int, headers int, bestblockhash char(64), difficulty numeric, mediantime int, verificationprogress numeric, initialblockdownload boolean, chainwork char(64), size_on_disk bigint, pruned boolean, softforks bitcoin_softfork[], "bip9_softforks" bitcoin_bip9_softforks, warnings text ); create or replace function btcd_bitcoin_network_info(arg_url text) returns bitcoin_blockchain_info as $$ from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from os import environ url = None if arg_url is not None: # Use a "http://user:password@host:port" URL string from the argument list url = arg_url else: # Postgres must be started with the # following variables in the environment, # each prefixed by btcd_rpc_ (e.g. btcd_rpc_host) rpc_vars = ['host', 'port', 'user', 'password'] required_vars = set('btcd_rpc_' + v for v in rpc_vars) defined_vars = set(environ).intersection(required_vars) missing_vars = required_vars.difference(defined_vars) if missing_vars and not arg_url: message = "The following " if len(defined_vars) else "No " message += "environment variables were detected..." plpy.notice(message) plpy.notice(defined_vars if len(defined_vars) else '') plpy.notice("") plpy.notice("Please set these environment variables in the postgres user environment and restart:") plpy.notice(" '" + "', '".join(missing_vars) + "'") plpy.notice("") plpy.error("Missing required btcd environment variables or URL argument") rpc_config = { k: environ.get('btcd_rpc_' + k) for k in rpc_vars } url = "http://{user}:{password}@{host}:{port}".format(**rpc_config) try: rpc_connection = AuthServiceProxy(url) info = rpc_connection.getblockchaininfo() plpy.info("Current block height: {}".format(info.get('headers'))) except JSONRPCException as e: plpy.error(e.message) return info $$ language plpython3u volatile; -- example query for deepest nesting level: -- (note: Postgres arrays are indexed starting from 1) -- -- select softforks[1].id -- from btcd_bitcoin_network_info('http://nobody:supersecret@some.mine:8332');
<filename>_database/queries.sql --CREATE DATABASE PAAdminUsers; --DROP TABLE paadminusers.users; DROP TABLE users; CREATE TABLE admin_users ( id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, username VARCHAR(100) NOT NULL UNIQUE, email VARCHAR(100) NOT NULL UNIQUE, password VARCHAR(200) NOT NULL, phone VARCHAR(30), date_created TIMESTAMP DEFAULT CURRENT_DATE, last_login TIMESTAMP DEFAULT NULL ); INSERT INTO admin_users (name, username, email, password, phone) VALUES ('Dan', 'dan', '<EMAIL>', 'hello', 'test'); SELECT * FROM product WHERE name LIKE '%O%'; SELECT * FROM productcategories; -- Query to get all drinks and type of beer SELECT product.productid, product.name, product.country_of_origin, product.percentage, categories.name FROM product INNER JOIN productcategories ON product.prodcatid = productcategories.prodcatid INNER JOIN categories ON productcategories.catid = categories.catid WHERE product.productid = 1; SELECT * FROM categories; SELECT name, address, location FROM pub WHERE pubid = 1; SELECT * FROM pubcategories; SELECT * FROM categories;
use VehicleDB; INSERT INTO Vehicle (Vehicle_ID, Vehicle_type, Vehicle_colour, Vehicle_licence) VALUES (12, '<NAME>', 'Blue', 'LB15AJL'), (13, 'Ferrari 458', 'Red', 'MY64PRE'), (14, 'Vauxhall Astra', 'Silver', 'FD65WPQ'), (15, 'Honda Civic', 'Green', 'FJ17AUG'), (16, 'Toyota Prius', 'Silver', 'FP16KKE'), (17, 'Ford Mondeo', 'Black', 'FP66KLM'), (18, 'Ford Focus', 'White', 'DJ14SLE'), (20, '<NAME>', 'Red', 'NY64KWD'), (21, 'Renault Scenic', 'Silver', 'BC16OEA');
<gh_stars>1-10 use DevweekDemo go with cte as ( select [OrderDate], [TerritoryID], Quantity = sum([OrderQty]), [LineTotal], ProductSubcategoryName, ProductCategoryName, ProductName from dbo.SalesOrderDetail group by [OrderDate], [TerritoryID], [OrderQty], [LineTotal], ProductSubcategoryName, ProductCategoryName, ProductName ) select * from cte where [TerritoryID] in (select [output] from dbo.[SplitString]('{{ @TerritoryID }}', ','))
SELECT TOP 100 f.XFileName AS FileName , f.XFileDesc AS Description , LOWER(RIGHT(XFileName, 4)) AS FileExt FROM XFileAttch fa with(nolock) INNER JOIN XFileRef f with(nolock) ON f.Company = fa.Company AND f.XFileRefNum = fa.XFileRefNum WHERE --fa.RelatedToSchemaName = 'Erp' AND fa.RelatedToFile = 'Customer' AND fa.Key1 = {CustNum} --AND fa.Company = 'YourCompanyID' -- Set this to a specific company ID if you have more than one ORDER BY f.XFileName
<gh_stars>1-10 CREATE TABLE [dbo].[dnn_HtmlText] ( [ModuleID] INT NOT NULL, [ItemID] INT IDENTITY (1, 1) NOT NULL, [Content] NTEXT NULL, [Version] INT NULL, [StateID] INT NULL, [IsPublished] BIT NULL, [CreatedByUserID] INT NULL, [CreatedOnDate] DATETIME NULL, [LastModifiedByUserID] INT NULL, [LastModifiedOnDate] DATETIME NULL, [Summary] NTEXT NULL, CONSTRAINT [PK_dnn_HtmlText] PRIMARY KEY CLUSTERED ([ItemID] ASC), CONSTRAINT [FK_dnn_HtmlText_dnn_Modules] FOREIGN KEY ([ModuleID]) REFERENCES [dbo].[dnn_Modules] ([ModuleID]) ON DELETE CASCADE, CONSTRAINT [FK_dnn_HtmlText_dnn_WorkflowStates] FOREIGN KEY ([StateID]) REFERENCES [dbo].[dnn_WorkflowStates] ([StateID]) ); GO CREATE NONCLUSTERED INDEX [IX_dnn_HtmlText_ModuleID_Version] ON [dbo].[dnn_HtmlText]([ModuleID] ASC, [Version] ASC);
-- Procedure Registration_Del SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE dbo.Registration_Del ( @Id int ) AS SET NOCOUNT ON IF(@Id > 0) DELETE FROM Registration WHERE Id=@Id; RETURN GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO
<filename>src/test/resources/sqls/selectsqls.sql SELECT table_name FROM information_schema.tables WHERE table_schema = 'wifdemo'; SELECT column_name FROM information_schema.columns WHERE table_name ='uaz_demonstration'; SELECT column_name FROM information_schema.columns WHERE table_name ='uaz_herveybay'; SELECT column_name FROM information_schema.columns WHERE table_name ='wif_03a0cc924954a0dde9db5b873d51f7bd'; SELECT "score_industrial" FROM wifdemo.wif_03a0cc924954a0dde9db5b873d51f7bd order by "score_industrial" desc; UPDATE wifmodel.factortype SET "value"='3.0' WHERE id=267; UPDATE wifdemo.uaz_demonstration SET "ALU_1"=0.0; UPDATE wifdemo.uaz_demonstration SET "ALU_2"=0.0; UPDATE wifdemo.uaz_demonstration SET "ALU_3"=0.0; UPDATE wifdemo.uaz_demonstration SET "SCORE_1"=0.0; --WA ALTER TABLE wifdemo.wif_d80ef1c0e0841a1850ea154819ac53f2 ADD COLUMN "score_conservation" double precision; ALTER TABLE wifdemo.wif_d80ef1c0e0841a1850ea154819ac53f2 ADD COLUMN "score_commercial" double precision; ALTER TABLE wifdemo.wif_d80ef1c0e0841a1850ea154819ac53f2 ADD COLUMN "score_residential" double precision; ALTER TABLE wifdemo.wif_d80ef1c0e0841a1850ea154819ac53f2 ADD COLUMN "score_industrial" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "" double precision; --to support values not funding union file andthe new way to name score for columns in demonstration as well ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "TOTPOP_CY" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "POLITICAL" character varying; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "CLIP_ACRES" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "BG_ACRES" double precision; UPDATE wifdemo.uaz_demonstration SET "CLIP_ACRES"=1.0; UPDATE wifdemo.uaz_demonstration SET "BG_ACRES"=1.0; -- alis ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "BLK_GRP" double precision; UPDATE wifdemo.uaz_demonstration SET "BLK_GRP"=1.0; --ali -- --------------------------------- Should run after importing UAZ ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "score_mixed_use" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "score_office" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "score_residential" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "score_retail" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "score_conservation" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "score_industrial" double precision; ALTER TABLE wifdemo.uaz_demonstration ADD COLUMN "UAZ_AREA" double precision; -- ------------- UPDATE wifdemo.uaz_demonstration SET "SCORE_1"="score_residential"; UPDATE wifdemo.uaz_demonstration SET "SCORE_4"="score_office"; UPDATE wifdemo.uaz_demonstration SET "SCORE_2"="score_mixed_use"; UPDATE wifdemo.uaz_demonstration SET "SCORE_3"="score_retail"; UPDATE wifdemo.uaz_demonstration SET "SCORE_5"="score_industrial"; UPDATE wifdemo.uaz_demonstration SET "SCORE_6"="score_conservation"; ALTER TABLE wifdemo.nw_demo ADD COLUMN "score_industry" double precision; ALTER TABLE wifdemo.nw_demo ADD COLUMN "score_cons" double precision; ALTER TABLE wifdemo.nw_demo ADD COLUMN "score_res" double precision; UPDATE wifdemo.uaz_demonstration SET "UAZ_AREA"=(ST_Area(the_geom)); SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration ; SELECT * FROM wifdemo.uaz_hervey_bay order by ogc_fid asc; SELECT * FROM wifdemo.uaz_demonstration order by gid asc; SELECT gid,"FACTOR_1" FROM wifdemo.uaz_demonstration order by gid asc; SELECT COUNT (*) FROM wifdemo.uaz_demonstration; SELECT COUNT (*) FROM wifdemo.demonstration_union; SELECT COUNT (*) FROM wifdemo.uaz_demonstration WHERE "SCORE_5">0; SELECT ST_Area(the_geom) As Area FROM wifdemo.demonstration_union; SELECT gid, "ELU", "ALU_1" FROM wifdemo.uaz_demonstration WHERE "ELU" = '1.0' AND "ALU_1" = '0.0'; SELECT SUM (DISTINCT ("UAZ_AREA")) FROM wifdemo.uaz_demonstration WHERE "ELU" = '1.0' AND "ALU_1" = '0.0'; SELECT SUM (DISTINCT ("UAZ_AREA")) FROM wifdemo.uaz_demonstration WHERE "SCORE_1" BETWEEN 6001 AND 9000.0; SELECT SUM(DISTINCT ("UAZ_AREA")) FROM wifdemo.uaz_demonstration WHERE "SCORE_6"=-100.0; SELECT SUM(DISTINCT ("UAZ_AREA")) FROM wifdemo.uaz_demonstration WHERE "FACTOR_1"=-98.0; SELECT "UAZ_AREA", "ELU" FROM wifdemo.uaz_demonstration WHERE "ALU_1"='1.0'; SELECT gid, "UAZ_AREA","SCORE_1" FROM wifdemo.uaz_demonstration order by "SCORE_1" desc; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='1.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='2.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='3.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='4.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='11.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='12.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='13.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='21.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='41.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='51.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='81.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='82.0'; SELECT SUM("UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='83.0'; SELECT SUM(DISTINCT "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "SCORE_6"'81.0'; SELECT SUM( "UAZ_AREA") FROM wifdemo.uaz_demonstration WHERE "ELU"='12.0'; SELECT * FROM wifdemo.uaz_demonstration limit 10; SELECT SUM(DISTINCT "UAZ_POP") FROM wifdemo.uaz_demonstration; SELECT SUM(DISTINCT ("TOTPOP_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo.demonstration_union; SELECT SUM(DISTINCT ("TOTHH_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo.demonstration_union; SELECT SUM(DISTINCT ("TOTHU_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo.demonstration_union; SELECT SUM(DISTINCT ("VACANT_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo.demonstration_union; SELECT SUM(DISTINCT ("TOTHU_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT SUM (DISTINCT ("TOTHU_CY")) FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT SUM ("TOTHU_CY") FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT "TOTHU_CY" FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT gid, "UAZ_AREA", "ELU" FROM wifdemo.uaz_demonstration WHERE "ELU"='1.0' order by "UAZ_AREA"; SELECT "UAZ_AREA", "ELU" FROM wifdemo.uaz_demonstration WHERE "ELU"='1.0' AND "UAZ_AREA" BETWEEN 34222 AND 34224; SELECT SUM (DISTINCT "AREA") FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT "AREA","LAND_USE" FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT SUM("AREA") FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Low Density Res.'; SELECT SUM (DISTINCT ("TOTHU_CY")) FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Mixed Use'; SELECT SUM (DISTINCT ("TOTHU_CY")) FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Med. Density Res'; SELECT SUM(DISTINCT ("TOTHU_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo.demonstration_union WHERE "LAND_USE" = 'Med. Density Res'; SELECT SUM(DISTINCT ("TOTPOP_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo."Demonstration_union"; SELECT SUM(DISTINCT ("TOTHU_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo."Demonstration_union"; SELECT SUM(DISTINCT ("VACANT_CY"*("CLIP_ACRES"/ "BG_ACRES"))) FROM wifdemo."Demonstration_union"; SELECT DISTINCT "ELU" FROM wifdemo.uaz_demonstration; SELECT DISTINCT "FACTOR_1" FROM wifdemo.uaz_demonstration; SELECT DISTINCT "FACTOR_6" FROM wifdemo.uaz_demonstration;
<filename>extension/tpcds/dsdgen/queries/62.sql SELECT w_substr, sm_type, web_name, sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1 ELSE 0 END) AS "30 days", sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 30) AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1 ELSE 0 END) AS "31-60 days", sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 60) AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1 ELSE 0 END) AS "61-90 days", sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 90) AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1 ELSE 0 END) AS "91-120 days", sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1 ELSE 0 END) AS ">120 days" FROM web_sales, (SELECT SUBSTRING(w_warehouse_name,1,20) w_substr, * FROM warehouse) sq1, ship_mode, web_site, date_dim WHERE d_month_seq BETWEEN 1200 AND 1200 + 11 AND ws_ship_date_sk = d_date_sk AND ws_warehouse_sk = w_warehouse_sk AND ws_ship_mode_sk = sm_ship_mode_sk AND ws_web_site_sk = web_site_sk GROUP BY w_substr, sm_type, web_name ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST LIMIT 100;
<filename>cmqueries/cmdepsummary.sql select distinct SoftwareName, CollectionName, CollectionID, case when (featuretype = 1) then 'Application' when (featuretype = 2) then 'Program' when (featuretype = 3) then 'MobileProgram' when (featuretype = 4) then 'Script' when (featuretype = 5) then 'SoftwareUpdate' when (featuretype = 6) then 'Baseline' when (featuretype = 7) then 'TaskSequence' when (featuretype = 8) then 'ContentDistribution' when (featuretype = 9) then 'DistributionPointGroup' when (featuretype = 10) then 'DistributionPointHealth' when (featuretype = 11) then 'ConfigurationPolicy' when (featuretype = 28) then 'AbstractConfigurationItem' end as FeatureType, NumberTotal as Total, NumberSuccess as Success, NumberErrors as Failed, NumberInProgress as InProgress, NumberUnknown as Unknown, NumberOther as Other from vDeploymentSummary where RTRIM(SoftwareName) <> '' order by SoftwareName
USE [VipunenTK_DW] GO ALTER TABLE [dbo].[d_koulutuslaji] DROP CONSTRAINT IF EXISTS [DF__d_koulutuslaji__tietolahde] GO ALTER TABLE [dbo].[d_koulutuslaji] DROP CONSTRAINT IF EXISTS [DF__d_koulutuslaji__paattyy] GO ALTER TABLE [dbo].[d_koulutuslaji] DROP CONSTRAINT IF EXISTS [DF__d_koulutuslaji__alkaa] GO /****** Object: Table [dbo].[d_koulutuslaji] Script Date: 6.8.2021 11:32:49 ******/ DROP TABLE [dbo].[d_koulutuslaji] GO /****** Object: Table [dbo].[d_koulutuslaji] Script Date: 6.8.2021 11:32:49 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[d_koulutuslaji]( [id] [int] NOT NULL, [luotu] [date] NULL, [alkaa] [date] NULL, [paattyy] [date] NULL, [koulutuslaji_koodi] [nvarchar](10) NULL, [koulutuslaji] [nvarchar](250) NULL, [koulutuslaji_SV] [nvarchar](250) NULL, [koulutuslaji_EN] [nvarchar](250) NULL, [jarjestys] [nvarchar](50) NULL, [virhetilanne] [nchar](1) NULL, [poistettu] [nchar](1) NULL, [tietolahde] [nvarchar](50) NULL, [kommentti] [nvarchar](250) NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[d_koulutuslaji] ADD CONSTRAINT [DF__d_koulutuslaji__alkaa] DEFAULT ('1900-01-01') FOR [alkaa] GO ALTER TABLE [dbo].[d_koulutuslaji] ADD CONSTRAINT [DF__d_koulutuslaji__paattyy] DEFAULT ('9999-01-01') FOR [paattyy] GO ALTER TABLE [dbo].[d_koulutuslaji] ADD CONSTRAINT [DF__d_koulutuslaji__tietolahde] DEFAULT ('Tilastokeskus') FOR [tietolahde] GO
<gh_stars>10-100 -- file:updatable_views.sql ln:846 expect:true DROP FUNCTION rw_view1_trig_fn()
<gh_stars>0 UPDATE ?:company_descriptions SET terms = '<p>Please read the Simtech\'s Terms and Conditions (\"Terms\", \"Terms and Conditions\") carefully before purchasing products from the Vendor via the <a href=\"http://www.mywebsite.com\">http://www.mywebsite.com</a> website and the My Mobile App mobile application (the \"Service\") operated by My Company (\"us\", \"we\", or \"our\").</p>\r\n<p><strong>By submitting the order you agree to be bound by these Terms. If you disagree with any part of the Terms then you may not access the Service.</strong></p>\r\n<p><strong>Purchases</strong></p>\r\n<p>If you wish to purchase any product or service made available through the Service (\"Purchase\"), you may be asked to supply certain information relevant to your Purchase including, without limitation, your ...</p>\r\n<p><span></span><strong>Content</strong></p>\r\n<p>Our Service allows you to post, link, store, share and otherwise make available certain information, text, graphics, videos, or other material (\"Content\"). You are responsible for the ...</p>\r\n<p><span></span><strong>Changes</strong></p>\r\n<p>We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material we will try to provide at least 30 days\' notice prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion.</p>\r\n<p><span></span><strong>Contact Us</strong></p>\r\n<p>If you have any questions about these Terms, please contact us.</p>' WHERE company_id = 1;
<gh_stars>0 -- User related tables changes needed after 2.1.0.004 ALTER TABLE SAKAI_USER ADD (EMAIL_LC VARCHAR2 (255)); UPDATE SAKAI_USER SET EMAIL_LC = LOWER(EMAIL); DROP INDEX IE_SAKAI_USER_EMAIL; CREATE INDEX IE_SAKAI_USER_EMAIL ON SAKAI_USER( EMAIL_LC ASC );
-- 1411 Number of persons by payer plan period start month --HINT DISTRIBUTE_ON_KEY(stratum_1) select 1411 as analysis_id, DATEFROMPARTS(YEAR(payer_plan_period_start_date), MONTH(payer_plan_period_start_date), 1) as stratum_1, cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(null as varchar(255)) as stratum_4, cast(null as varchar(255)) as stratum_5, COUNT_BIG(distinct p1.PERSON_ID) as count_value into @scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_1411 from @cdmDatabaseSchema.person p1 inner join @cdmDatabaseSchema.payer_plan_period ppp1 on p1.person_id = ppp1.person_id group by DATEFROMPARTS(YEAR(payer_plan_period_start_date), MONTH(payer_plan_period_start_date), 1) ;
REPLACE PROCEDURE dbt_test.dbt_drop_relation_if_exists( IN relation_type VARCHAR(10), IN full_name VARCHAR(256) ) BEGIN DECLARE sql_stmt VARCHAR(500) CHARACTER SET Unicode; DECLARE msg VARCHAR(400) CHARACTER SET Unicode; DECLARE exit HANDLER FOR SqlException BEGIN IF SqlCode = 3807 THEN SET msg = full_name || ' does not exist.'; ELSEIF SqlCode = 3853 THEN SET msg = full_name || ' is not a table.'; ELSEIF SqlCode = 3854 THEN SET msg = full_name || ' is not a view.'; ELSE RESIGNAL; END IF; END; SET sql_stmt = 'DROP ' || relation_type || ' ' || full_name || ';'; EXECUTE IMMEDIATE sql_stmt; END;
ALTER TABLE responsibility DROP CONSTRAINT responsibility_project_id_fkey, ADD FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE; ALTER TABLE invitation DROP CONSTRAINT invitation_project_id_fkey, ADD FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE;
<reponame>Ycl24/admin -- MySQL dump 10.13 Distrib 5.5.53, for Win32 (AMD64) -- -- Host: localhost Database: box -- ------------------------------------------------------ -- Server version 5.5.53 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `box_config` -- DROP TABLE IF EXISTS `box_config`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `box_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `url` varchar(255) DEFAULT NULL COMMENT 'web网址', `createtime` datetime DEFAULT NULL, `updatetime` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='网站配置表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `box_config` -- LOCK TABLES `box_config` WRITE; /*!40000 ALTER TABLE `box_config` DISABLE KEYS */; INSERT INTO `box_config` VALUES (1,'http://www.box.com','2017-12-19 12:11:59','2017-12-19 12:12:01'); /*!40000 ALTER TABLE `box_config` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `box_nav` -- DROP TABLE IF EXISTS `box_nav`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `box_nav` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) DEFAULT NULL COMMENT '导航名称', `url` varchar(255) DEFAULT NULL COMMENT '导航地址', `status` tinyint(4) DEFAULT '0' COMMENT '是否显示 1)是 0)否', `icon` varchar(255) DEFAULT NULL COMMENT '图标', `sort` tinyint(4) DEFAULT NULL COMMENT '排序', `createtime` datetime DEFAULT NULL COMMENT '创建时间', `updatetime` datetime DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='导航信息表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `box_nav` -- LOCK TABLES `box_nav` WRITE; /*!40000 ALTER TABLE `box_nav` DISABLE KEYS */; INSERT INTO `box_nav` VALUES (54,'1','1',0,'',1,'2017-12-27 20:29:49','2017-12-27 20:29:49'),(55,'test','test',0,'/public/upload/images/20171227/d46fffcd7fea1947506235a26e1f342e.png',1,'2017-12-27 20:29:59','2017-12-27 20:30:55'); /*!40000 ALTER TABLE `box_nav` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `box_operation` -- DROP TABLE IF EXISTS `box_operation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `box_operation` ( `id` int(11) NOT NULL AUTO_INCREMENT, `operation_name` varchar(255) DEFAULT NULL COMMENT '操作名称', `operation_controllerurl` varchar(255) DEFAULT NULL COMMENT '操作控制器/方法', `remarks` varchar(255) DEFAULT NULL COMMENT '备注', `createtime` datetime DEFAULT NULL, `admin_id` int(11) DEFAULT '1' COMMENT '管理人ID', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=455 DEFAULT CHARSET=utf8 COMMENT='操作表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `box_operation` -- LOCK TABLES `box_operation` WRITE; /*!40000 ALTER TABLE `box_operation` DISABLE KEYS */; INSERT INTO `box_operation` VALUES (1,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 15:28:22',1),(2,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 15:28:50',1),(3,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 15:32:23',1),(4,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:22:54',1),(5,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:23:53',1),(6,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:25:08',1),(7,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:25:41',1),(8,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:26:06',1),(9,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:26:28',1),(10,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:26:57',1),(11,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:27:28',1),(12,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:28:32',1),(13,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:28:39',1),(14,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:28:49',1),(15,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:29:03',1),(16,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:30:00',1),(17,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:39:31',1),(18,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:48:58',1),(19,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:49:31',1),(20,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:50:25',1),(21,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:52:48',1),(22,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:53:04',1),(23,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:53:36',1),(24,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:53:51',1),(25,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:54:08',1),(26,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:55:11',1),(27,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:56:02',1),(28,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:56:30',1),(29,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:58:15',1),(30,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:59:07',1),(31,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 16:59:22',1),(32,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:00:05',1),(33,'导航操作','Nav/add','添加导航','2017-12-19 17:00:14',1),(34,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:01:06',1),(35,'导航操作','Nav/add','添加导航','2017-12-19 17:02:47',1),(36,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:03:23',1),(37,'导航操作','Nav/add','添加导航','2017-12-19 17:03:30',1),(38,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:04:22',1),(39,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:06:22',1),(40,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:12:27',1),(41,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:14:27',1),(42,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:15:54',1),(43,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:18:38',1),(44,'导航操作','Nav/add','添加导航','2017-12-19 17:18:45',1),(45,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:19:11',1),(46,'导航操作','Nav/add','添加导航','2017-12-19 17:19:17',1),(47,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:20:13',1),(48,'导航操作','Nav/add','添加导航','2017-12-19 17:20:19',1),(49,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:20:30',1),(50,'导航操作','Nav/add','添加导航','2017-12-19 17:20:37',1),(51,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:21:09',1),(52,'导航操作','Nav/add','添加导航','2017-12-19 17:21:15',1),(53,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:21:41',1),(54,'导航操作','Nav/add','添加导航','2017-12-19 17:21:47',1),(55,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:23:18',1),(56,'导航操作','Nav/add','添加导航','2017-12-19 17:23:24',1),(57,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:24:22',1),(58,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:29:07',1),(59,'导航操作','Nav/add','添加导航','2017-12-19 17:29:14',1),(60,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:31:15',1),(61,'导航操作','Nav/add','添加导航','2017-12-19 17:31:25',1),(62,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:31:42',1),(63,'导航操作','Nav/add','添加导航','2017-12-19 17:31:55',1),(64,'导航操作','Nav/add','添加导航','2017-12-19 17:32:01',1),(65,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:38:23',1),(66,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:38:24',1),(67,'导航操作','Nav/add','添加导航','2017-12-19 17:38:29',1),(68,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:38:51',1),(69,'导航操作','Nav/add','添加导航','2017-12-19 17:39:01',1),(70,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:44:54',1),(71,'导航操作','Nav/add','添加导航','2017-12-19 17:45:02',1),(72,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:45:28',1),(73,'导航操作','Nav/add','添加导航失败,导航名为123','2017-12-19 17:45:33',1),(74,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:45:58',1),(75,'导航操作','Nav/add','添加导航失败,导航名为123','2017-12-19 17:46:04',1),(76,'导航操作','Nav/add','添加导航','2017-12-19 17:46:11',1),(77,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:49:31',1),(78,'导航操作','Nav/add','添加导航','2017-12-19 17:49:50',1),(79,'导航操作','Nav/add','添加导航','2017-12-19 17:50:02',1),(80,'导航操作','Nav/add','添加导航失败,导航名为aaa','2017-12-19 17:50:13',1),(81,'导航操作','Nav/add','添加导航失败,导航名为aaa','2017-12-19 17:50:16',1),(82,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 17:53:20',1),(83,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 19:13:51',1),(84,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 19:19:50',1),(85,'导航操作','Nav/add','添加导航失败,导航名为123','2017-12-19 19:57:30',1),(86,'导航操作','Nav/add','添加导航','2017-12-19 19:57:34',1),(87,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 20:03:08',1),(88,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-19 20:04:31',1),(89,'导航操作','Nav/add','添加导航','2017-12-20 14:55:11',1),(90,'导航操作','Nav/add','添加导航失败,导航名为搜索','2017-12-20 14:55:49',1),(91,'导航操作','Nav/add','添加导航','2017-12-20 14:57:23',1),(92,'导航操作','Nav/add','添加导航,导航名为qq','2017-12-20 14:59:43',1),(93,'导航操作','Nav/add','添加导航失败,导航名为qq','2017-12-20 14:59:55',1),(94,'导航操作','Nav/add','添加导航,导航名为qqz','2017-12-20 15:00:02',1),(95,'导航操作','Nav/add','添加导航,导航名为bb','2017-12-20 15:06:12',1),(96,'导航操作','Nav/add','添加导航,导航名为uu','2017-12-20 15:06:26',1),(97,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-20 15:46:23',1),(98,'导航操作','Nav/add','添加导航,导航名为哦','2017-12-20 15:49:20',1),(99,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-20 17:03:35',1),(100,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-20 17:25:09',1),(101,'导航操作','Nav/add','添加导航,导航名为11','2017-12-20 17:25:39',1),(102,'导航操作','Nav/add','添加导航,导航名为测试','2017-12-20 18:17:05',1),(103,'导航操作','Nav/add','添加导航,导航名为22111','2017-12-20 18:18:13',1),(104,'导航操作','Nav/add','添加导航,导航名为2公告','2017-12-20 18:19:00',1),(105,'导航操作','Nav/add','添加导航,导航名为此次','2017-12-20 18:21:01',1),(106,'导航操作','Nav/add','添加导航失败,导航名为此次','2017-12-20 18:21:15',1),(107,'导航操作','Nav/add','添加导航,导航名为测试123','2017-12-20 18:21:59',1),(108,'导航操作','Nav/add','添加导航,导航名为哈哈','2017-12-20 18:24:15',1),(109,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-20 19:07:24',1),(110,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-22 18:08:11',1),(111,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-22 18:10:15',1),(112,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-22 18:10:27',1),(113,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-22 18:10:54',1),(114,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-22 18:22:19',1),(115,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 12:04:06',1),(116,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 12:09:01',1),(117,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 12:14:26',1),(118,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 12:24:05',1),(119,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:04:54',1),(120,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:06:18',1),(121,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:32:28',1),(122,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:32:56',1),(123,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:33:25',1),(124,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:39:20',1),(125,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:39:45',1),(126,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:45:07',1),(127,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:46:57',1),(128,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:48:03',1),(129,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:50:55',1),(130,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:51:42',1),(131,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:51:42',1),(132,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 14:55:59',1),(133,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:00:03',1),(134,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:00:39',1),(135,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:04:41',1),(136,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:31:57',1),(137,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:33:31',1),(138,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:35:27',1),(139,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:35:54',1),(140,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:44:16',1),(141,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:44:36',1),(142,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:44:55',1),(143,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:45:16',1),(144,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:46:07',1),(145,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:46:24',1),(146,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:46:42',1),(147,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:46:54',1),(148,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:47:09',1),(149,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:47:59',1),(150,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:48:30',1),(151,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:49:54',1),(152,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:51:44',1),(153,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:52:56',1),(154,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:53:10',1),(155,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:54:36',1),(156,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:58:08',1),(157,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:58:34',1),(158,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 15:59:44',1),(159,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:01:58',1),(160,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:02:56',1),(161,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:03:16',1),(162,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:03:36',1),(163,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:04:09',1),(164,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:04:30',1),(165,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:04:40',1),(166,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:06:16',1),(167,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:06:52',1),(168,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:13:02',1),(169,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:13:15',1),(170,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:13:50',1),(171,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:14:37',1),(172,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:14:58',1),(173,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:15:17',1),(174,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:15:56',1),(175,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:16:11',1),(176,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:18:32',1),(177,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:19:12',1),(178,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:25:27',1),(179,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:25:44',1),(180,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:25:59',1),(181,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:26:41',1),(182,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:27:31',1),(183,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:28:10',1),(184,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:28:26',1),(185,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:29:00',1),(186,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:30:15',1),(187,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:30:31',1),(188,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:31:09',1),(189,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:33:24',1),(190,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:34:04',1),(191,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:34:21',1),(192,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:35:13',1),(193,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:36:07',1),(194,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:36:17',1),(195,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:36:28',1),(196,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:37:11',1),(197,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:37:49',1),(198,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:38:44',1),(199,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:40:33',1),(200,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:41:22',1),(201,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:43:48',1),(202,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:44:06',1),(203,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:44:54',1),(204,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:45:36',1),(205,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:46:35',1),(206,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:52:09',1),(207,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:52:10',1),(208,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 16:52:37',1),(209,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:01:52',1),(210,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:02:13',1),(211,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:03:13',1),(212,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:03:26',1),(213,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:17:13',1),(214,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:17:32',1),(215,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:19:37',1),(216,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:19:58',1),(217,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:20:51',1),(218,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:21:28',1),(219,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:24:47',1),(220,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:25:02',1),(221,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:26:24',1),(222,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:27:30',1),(223,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:31:36',1),(224,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:35:54',1),(225,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:48:35',1),(226,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 17:55:13',1),(227,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:06:42',1),(228,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:07:05',1),(229,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:08:59',1),(230,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:09:50',1),(231,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:10:46',1),(232,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:12:53',1),(233,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:13:48',1),(234,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:17:03',1),(235,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:21:39',1),(236,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:22:12',1),(237,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:22:36',1),(238,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:25:00',1),(239,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:27:31',1),(240,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:53:28',1),(241,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:58:40',1),(242,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 18:59:25',1),(243,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:00:51',1),(244,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:01:12',1),(245,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:02:51',1),(246,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:03:14',1),(247,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:04:51',1),(248,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:05:18',1),(249,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:06:56',1),(250,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:07:53',1),(251,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:08:24',1),(252,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:09:16',1),(253,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:10:08',1),(254,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:11:44',1),(255,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:13:23',1),(256,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:14:45',1),(257,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:14:58',1),(258,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:15:13',1),(259,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:16:30',1),(260,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:16:54',1),(261,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:17:18',1),(262,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:18:15',1),(263,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:19:20',1),(264,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:21:41',1),(265,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:24:03',1),(266,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:24:49',1),(267,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:25:08',1),(268,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:25:53',1),(269,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:28:31',1),(270,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:29:09',1),(271,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:30:07',1),(272,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:30:54',1),(273,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:31:01',1),(274,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:35:28',1),(275,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:38:37',1),(276,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:39:22',1),(277,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:39:38',1),(278,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:41:07',1),(279,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:42:17',1),(280,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:42:39',1),(281,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:44:50',1),(282,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:45:03',1),(283,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:45:16',1),(284,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:48:01',1),(285,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:51:56',1),(286,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 19:52:17',1),(287,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:01:28',1),(288,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:01:36',1),(289,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:02:30',1),(290,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:02:55',1),(291,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:03:47',1),(292,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:05:41',1),(293,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:07:46',1),(294,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:08:28',1),(295,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:08:42',1),(296,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:08:55',1),(297,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:10:24',1),(298,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:10:29',1),(299,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:11:20',1),(300,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:11:50',1),(301,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:12:27',1),(302,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:13:10',1),(303,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:13:39',1),(304,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:13:59',1),(305,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:14:12',1),(306,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:16:46',1),(307,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:17:36',1),(308,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:18:48',1),(309,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:19:04',1),(310,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:20:49',1),(311,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:22:36',1),(312,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:23:31',1),(313,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:23:54',1),(314,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:24:36',1),(315,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:25:13',1),(316,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:25:59',1),(317,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:26:52',1),(318,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:27:12',1),(319,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:27:41',1),(320,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:29:28',1),(321,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:29:53',1),(322,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:30:28',1),(323,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:30:55',1),(324,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:47:19',1),(325,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:47:57',1),(326,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:48:42',1),(327,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-25 20:59:15',1),(328,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 09:58:17',1),(329,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 09:59:00',1),(330,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:22:28',1),(331,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:24:43',1),(332,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:27:22',1),(333,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:28:44',1),(334,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:30:07',1),(335,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:30:50',1),(336,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 12:31:53',1),(337,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:46:47',1),(338,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:51:08',1),(339,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:57:05',1),(340,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:58:05',1),(341,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:58:13',1),(342,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:59:11',1),(343,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 14:59:13',1),(344,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:00:10',1),(345,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:01:15',1),(346,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:01:18',1),(347,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:03:08',1),(348,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:03:42',1),(349,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:05:17',1),(350,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:05:51',1),(351,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:11:30',1),(352,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:11:57',1),(353,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:14:34',1),(354,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:15:46',1),(355,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:18:01',1),(356,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:18:57',1),(357,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:19:15',1),(358,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:19:52',1),(359,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:21:12',1),(360,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:21:55',1),(361,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:22:36',1),(362,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:24:33',1),(363,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:24:53',1),(364,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:25:01',1),(365,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:28:09',1),(366,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:28:55',1),(367,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:29:31',1),(368,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:30:37',1),(369,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:31:38',1),(370,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:36:29',1),(371,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:44:08',1),(372,'导航操作','Nav/add','添加导航,导航名为123','2017-12-26 15:44:39',1),(373,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:45:10',1),(374,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:46:20',1),(375,'导航操作','Nav/add','添加导航,导航名为123','2017-12-26 15:46:31',1),(376,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:47:33',1),(377,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:48:17',1),(378,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 15:49:14',1),(379,'导航操作','Nav/add','添加导航,导航名为此时','2017-12-26 15:49:43',1),(380,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:05:55',1),(381,'导航操作','Nav/add','添加导航,导航名为PP','2017-12-26 16:06:09',1),(382,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:18:37',1),(383,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:36:31',1),(384,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:45:21',1),(385,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:47:00',1),(386,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:47:14',1),(387,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:48:26',1),(388,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:49:26',1),(389,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:49:51',1),(390,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:50:04',1),(391,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:50:37',1),(392,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:55:24',1),(393,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:56:06',1),(394,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:58:51',1),(395,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:59:21',1),(396,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 16:59:52',1),(397,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:03:43',1),(398,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:04:09',1),(399,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:06:32',1),(400,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:08:48',1),(401,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:10:42',1),(402,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:11:27',1),(403,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:11:41',1),(404,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-26 17:12:03',1),(405,'导航操作','Nav/add','添加导航,导航名为打算','2017-12-27 10:58:20',1),(406,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:43:42',1),(407,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:48:17',1),(408,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:54:02',1),(409,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:55:04',1),(410,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:55:36',1),(411,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:56:47',1),(412,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:58:52',1),(413,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:59:03',1),(414,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 11:59:22',1),(415,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 12:00:47',1),(416,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 12:03:53',1),(417,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 14:16:59',1),(418,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 14:17:57',1),(419,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 14:45:09',1),(420,'更新缓存操作','Common/clearcache','后台更新缓存','2017-12-27 14:49:30',1),(421,'导航操作','Nav/editajax','修改导航状态,操作成功!,导航id为38','2017-12-27 17:53:06',1),(422,'导航操作','Nav/editajax','修改导航状态,操作成功!,导航id为38','2017-12-27 17:54:06',1),(423,'导航操作','Nav/add','添加导航,操作成功!,导航名为测试','2017-12-27 18:09:14',1),(424,'导航操作','Nav/add','添加导航,操作成功!,导航名为1','2017-12-27 19:41:25',1),(425,'导航操作','Nav/add','添加导航,操作成功!,导航名为2','2017-12-27 19:44:25',1),(426,'导航操作','Nav/add','添加导航,操作成功!,导航名为','2017-12-27 19:44:50',1),(427,'导航操作','Nav/add','添加导航,操作成功!,导航名为3','2017-12-27 20:09:54',1),(428,'导航操作','Nav/edit','添加导航失败,导航名为2','2017-12-27 20:11:49',1),(429,'导航操作','Nav/add','添加导航,操作成功!,导航名为3','2017-12-27 20:13:20',1),(430,'导航操作','Nav/edit','修改导航,导航id为50','2017-12-27 20:14:45',1),(431,'导航操作','Nav/add','添加导航,操作成功!,导航名为33','2017-12-27 20:14:59',1),(432,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:15:14',1),(433,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:17:41',1),(434,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:18:41',1),(435,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:19:18',1),(436,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:19:45',1),(437,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:20:01',1),(438,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:20:10',1),(439,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:20:41',1),(440,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:21:52',1),(441,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:22:05',1),(442,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:22:45',1),(443,'导航操作','Nav/edit','修改导航,导航id为51','2017-12-27 20:23:58',1),(444,'导航操作','Nav/add','添加导航,操作成功!,导航名为7','2017-12-27 20:24:23',1),(445,'导航操作','Nav/edit','修改导航,导航id为52','2017-12-27 20:25:07',1),(446,'导航操作','Nav/edit','修改导航,导航id为52','2017-12-27 20:25:16',1),(447,'导航操作','Nav/add','添加导航,操作成功!,导航名为12','2017-12-27 20:26:16',1),(448,'导航操作','Nav/edit','修改导航,导航id为53','2017-12-27 20:27:26',1),(449,'导航操作','Nav/edit','修改导航,导航id为53','2017-12-27 20:27:55',1),(450,'导航操作','Nav/edit','修改导航,导航id为53','2017-12-27 20:29:17',1),(451,'导航操作','Nav/add','添加导航,操作成功!,导航名为1','2017-12-27 20:29:49',1),(452,'导航操作','Nav/add','添加导航,操作成功!,导航名为test','2017-12-27 20:29:59',1),(453,'导航操作','Nav/edit','修改导航,导航id为55','2017-12-27 20:30:55',1),(454,'导航操作','Nav/edit','导航不存在,参数id错误','2017-12-27 20:31:35',1); /*!40000 ALTER TABLE `box_operation` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `box_version` -- DROP TABLE IF EXISTS `box_version`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `box_version` ( `id` int(11) NOT NULL AUTO_INCREMENT, `version_start` varchar(255) DEFAULT '1.0' COMMENT '版本号-前缀', `version_end` int(11) DEFAULT '123456' COMMENT '版本号-前缀', `createtime` datetime DEFAULT NULL, `updatetime` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='版本号表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `box_version` -- LOCK TABLES `box_version` WRITE; /*!40000 ALTER TABLE `box_version` DISABLE KEYS */; INSERT INTO `box_version` VALUES (1,'1.1',1514357370,'2017-12-19 11:09:02','2017-12-19 11:09:04'); /*!40000 ALTER TABLE `box_version` 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-05-24 11:27:17
-- phpMyAdmin SQL Dump -- http://www.phpmyadmin.net -- -- 生成日期: 2016 年 11 月 17 日 21:54 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 */; -- -- 数据库: `yiiwork` -- -- -------------------------------------------------------- -- -- 表的结构 `yw_admin` -- CREATE TABLE IF NOT EXISTS `yw_admin` ( `uid` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(15) NOT NULL DEFAULT '', `password` char(32) NOT NULL DEFAULT '', PRIMARY KEY (`uid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- 转存表中的数据 `yw_admin` -- INSERT INTO `yw_admin` (`uid`, `username`, `password`) VALUES (1, 'admin', '<PASSWORD>'); -- -------------------------------------------------------- -- -- 表的结构 `yw_article` -- CREATE TABLE IF NOT EXISTS `yw_article` ( `aid` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(150) DEFAULT NULL, `time` int(10) unsigned NOT NULL DEFAULT '0', `thumb` varchar(255) DEFAULT NULL, `content` text, `type` tinyint(1) unsigned NOT NULL DEFAULT '0', `info` varchar(500) DEFAULT NULL, `cid` int(10) unsigned NOT NULL DEFAULT '0', `view` int(10) unsigned NOT NULL DEFAULT '0', `author` varchar(100) NOT NULL DEFAULT '', PRIMARY KEY (`aid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; -- -- 转存表中的数据 `yw_article` -- INSERT INTO `yw_article` (`aid`, `title`, `time`, `thumb`, `content`, `type`, `info`, `cid`, `view`, `author`) VALUES (1, 'YiiWork博客上线第一篇', 1479390838, 'http://ww1.sinaimg.cn/mw690/c5e04220gw1ei47trzpsaj20e609hae2.jpg', '<p>YiiWork经过了为期一周的线下、线上测试,在今天正式上线。我是YiiWork的博主。</p><p>我是一枚地地道道的程序员,我热爱编程。我不会华丽的词藻,也没有犀利的文笔,写不出动人的文章。我只想记录成长中的点滴,我开发了YiiWork博客程序,为我见证,为我记录。</p><p><img alt="Image" src="http://ww1.sinaimg.cn/mw690/c5e04220gw1ei47trzpsaj20e609hae2.jpg" width="510" height="341" data-image-size="510,341"><br></p>', 0, 'YiiWork经过了为期一周的线下、线上测试,在今天正式上线。我是YiiWork的博主。我是一枚地地道道的程序员,我热爱编程。我不会华丽的词藻,也没有犀利的文笔,写不出动人的文章。我只想记录成长中的点滴,我开发了YiiWork博客程序,为我见证,为我记录。', 2, 28, '唐际忠'), (2, 'weiphp插件开发,无法创建数据表', 1479311658, '', '<p>weiphp是一个开源的微信公众号管理平台,具体不多做介绍了。主要说说此次在使用weiphp做二次开发时碰到的一个问题。在做weiphp插件开发时,创建模型生成的表结构,在安装插件时无法创建。但插件却提示安装成功。</p><p>初步分析是字符集编码不对导致:</p><p>1、确定数据库及表结构是utf8(在创建数据库和表时可以手动指定);</p><p>2、install.sql也要是utf-8编码;</p><p>3、如果是在控制台导入脚本,请先 set names utf8;</p><p>在安装插件脚本时必须同时满足上面个条件,否则可能会导致无法创建数据表或出现乱码。</p>', 0, 'weiphp是一个开源的微信公众号管理平台,具体不多做介绍了。主要说说此次在使用weiphp做二次开发时碰到的一个问题。在做weiphp插件开发时,创建模型生成的表结构,在安装插件时无法创建。但插件却提示安装成功。初步分析是字符集编码不对导致:1、确定数据库及表结构是utf8(在创建数据库和表时可以手动指定);2、install.sql也要是utf-8编码;3、如果是在控制台导入脚本,请先 set names utf8;在安装插件脚本时必须同时满足上面个条件,否则可能会导致无法创建数据表或出现乱码。', 1, 29, '唐际忠'), (3, '修改weiphp的固定token', 1479311672, 'http://ww1.sinaimg.cn/mw690/c5e04220gw1ei4al63rtzj211i0k2ag9.jpg', '<p>自weiphp2.0后其token是固定的,显示为weiphp。有些可能就不太喜欢,我就是其中之一。下面,我说说如何将其修改成自己喜欢的值。</p><p>在根目录下找到index.php</p><p>然后找到如下代码:</p><pre class="">$tmpArr = array (\r\n ''weiphp'', \r\n $timestamp, \r\n $nonce&nbsp;\r\n);\r\n</pre><p>将其中的weiphp改成自己喜欢的值就行了。</p><p>如果你想将 “使用说明” 这个页面也改了,那就需要找到weiphp/Application/Home/View/default/Index/help.html文件了。如下图:</p><p><img alt="Image" src="http://ww1.sinaimg.cn/mw690/c5e04220gw1ei4al63rtzj211i0k2ag9.jpg" width="690" height="369" data-image-size="690,369"><br></p><p><img alt="Image" src="http://ww4.sinaimg.cn/mw690/c5e04220gw1ei4ai92utdj20v60750u4.jpg" width="690" height="158" data-image-size="690,158"><br></p>', 0, '自weiphp2.0后其token是固定的,显示为weiphp。有些可能就不太喜欢,我就是其中之一。下面,我说说如何将其修改成自己喜欢的值。在根目录下找到index.php然后找到如下代码:$tmpArr = array (\r\n ''weiphp'', \r\n $timestamp, \r\n $nonce&nbsp;\r\n);\r\n将其中的weiphp改成自己喜欢的值就行了。如果你想将 “使用说明” 这个页面也改了,那就需要找到weiphp/Application/Home/View/default/Index/help.html文件了。如下图:', 1, 26, '唐际忠'), (4, '云时代下的,国内paas介绍', 1479311682, 'http://ww3.sinaimg.cn/mw690/c5e04220gw1ei4bbfmda4j20kt0e875h.jpg', '<p><img alt="Image" src="http://ww3.sinaimg.cn/mw690/c5e04220gw1ei4bbfmda4j20kt0e875h.jpg" width="690" height="471" data-image-size="690,471"><br></p><p>我个人认为在如今云时代下,paas绝对是我们这些小站长们的福音。其价格便宜、支持多种语言、性能也较高。按需灵活付费。<br></p><p>今天也是突然心血来潮,想介绍下几款国产paas平台。<br></p><p>1、百度云擎(BAE),速度快,价格还算实惠,数据库提供phpmyadmin管理。支持java、php、node js、python。提供svn、git管理工程文件。</p><p>2、京东云擎(JAE),速度快,暂时免费,数据库管理是京东自己开发的一套,使用起来没有phpmyadmin方便,受限制较多。支持java、php、node js、python、Ruby。</p><p>3、Sina App Engine(SAE),一看就知道是新浪的东西了。这个平台我没有用过,但也是收费的,价格也很便宜,使用他们的云豆支付。其实云豆也是可以免费赚取的。实名认证后送2000云豆,还可以申请成为开发者,之后基本可以一直免费使用了。支持java、php、python。</p><p>暂时只作这三家介绍,还有其它的没了解过,就不说了。 但是不管是哪家pass,都有一个不得不说的缺点,对于不熟悉技术的站长来说,使用起来有点难度,因为pass不是通过ftp管理工程文件的了,而是svn或git,需要熟悉svn和git命令/工具。</p>', 0, '我个人认为在如今云时代下,paas绝对是我们这些小站长们的福音。其价格便宜、支持多种语言、性能也较高。按需灵活付费。今天也是突然心血来潮,想介绍下几款国产paas平台。1、百度云擎(BAE),速度快,价格还算实惠,数据库提供phpmyadmin管理。支持java、php、node js、python。提供svn、git管理工程文件。2、京东云擎(JAE),速度快,暂时免费,数据库管理是京东自己开发的一套,使用起来没有phpmyadmin方便,受限制较多。支持java、php、node js、python、Ruby。3、Sina App Engine(SAE),一看就知道是新浪的东西了。这个平台我', 3, 22, '唐际忠'), (5, '触发onclick事件,弹出一个编辑框', 1479311790, 'http://ww3.sinaimg.cn/mw690/c5e04220gw1ei5hnsb917j20o30cggnp.jpg', '<p>今天有位朋友问我,用户出发onclick事件后,在没有使用dialog插件的情况下,如何弹出一个编辑框。</p><p>其实在js中可以使用,window下的弹出框以及模态框,即是open和showModalDialog或showModelessDialog。</p><p>这里以模态框为例,使用方式如下:</p><pre class="">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset="utf-8"&gt;\r\n&nbsp;&nbsp;&lt;script type="text/javascript"&gt; \r\n&nbsp;&nbsp;function show(){\r\n&nbsp;&nbsp;&nbsp;&nbsp;window.showModalDialog(''file:///D:/workspace/php/cms/um/_examples/customPluginDemo.html'',''1'',''dialogWidth=630px;dialogHeight=330px;'');\r\n&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&nbsp;&nbsp;&lt;input type="button" value="点击进行编辑" onclick="show()"&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n</pre><pre class="">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset="utf-8"&gt;\r\n&nbsp;&nbsp;&lt;link href="../themes/default/_css/umeditor.css" type="text/css" rel="stylesheet"&gt;\r\n&nbsp;&nbsp;&lt;script type="text/javascript" src="../third-party/jquery.min.js"&gt;&lt;/script&gt;\r\n&nbsp;&nbsp;&lt;script type="text/javascript" charset="utf-8" src="../umeditor.config.js"&gt;&lt;/script&gt;\r\n&nbsp;&nbsp;&lt;script type="text/javascript" charset="utf-8" src="editor_api.js"&gt;&lt;/script&gt;\r\n&nbsp;&nbsp;&lt;script type="text/javascript" src="../lang/zh-cn/zh-cn.js"&gt;&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;&nbsp; &nbsp;\r\n&nbsp;&nbsp;&lt;script type="text/plain" id="myEditor" style="width:600px;height:240px;"&gt;&lt;/script&gt;&nbsp; \r\n&nbsp;&nbsp;&lt;script type="text/javascript"&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;var ums = UM.getEditor(''myEditor'');\r\n&nbsp;&nbsp;&lt;/script&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n</pre><p><img alt="Image" src="http://ww3.sinaimg.cn/mw690/c5e04220gw1ei5hnsb917j20o30cggnp.jpg" width="690" height="356" data-image-size="690,356"><br></p>', 0, '今天有位朋友问我,用户出发onclick事件后,在没有使用dialog插件的情况下,如何弹出一个编辑框。其实在js中可以使用,window下的弹出框以及模态框,即是open和showModalDialog或showModelessDialog。这里以模态框为例,使用方式如下:&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset="utf-8"&gt;\r\n&nbsp;&nbsp;&lt;script type="text/javascript"&gt; \r\n&nbsp;&nbsp;function show(){\r\n&nbsp;&nbsp;&nbsp;&nbsp;window.showModalDialog(''file:///D:/workspace/php/cms/um/_examples/customPluginDemo.html'',''1'',''dialogWidth=630px;dialogHeight=330px', 1, 23, '唐际忠'), (6, '简单的chrome插件开发', 1479311694, 'http://ww2.sinaimg.cn/mw690/c5e04220gw1ei6o0mtl77j211y0k3qa4.jpg', '<p>今天学习了下chrome插件开发,现在来做一个非常简单的插件。</p><p>制作目标:</p><p>  在chrome地址栏后面显示一个插件图标,点击插件时弹出一个界面,可以点击进入博客。</p><p>开始制作插件:</p><p>  1、创建一个qinhen文件夹;</p><p>  2、在qinhen文件夹里面创建一个manifest.json的文件;</p><p>  3、在json文件中进行配置</p><pre class="">{\r\n&nbsp;&nbsp;"name":&nbsp;"沁痕博客",\r\n&nbsp;&nbsp;"version":&nbsp;"1.0",\r\n&nbsp;&nbsp;"manifest_version":&nbsp;2,\r\n&nbsp;&nbsp;"description":&nbsp;"沁痕博客&nbsp;-&nbsp;没有价值", \r\n&nbsp;&nbsp;"browser_action":&nbsp;{"default_title":"沁痕博客",&nbsp;"default_icon":&nbsp;"icon.png",&nbsp;"default_popup":&nbsp;"popup.html"},\r\n&nbsp;&nbsp;"permissions":&nbsp;["<a href="http://qinhen.duapp.com/" rel="nofollow">http://qinhen.duapp.com/</a>"]\r\n}\r\n</pre><p>重要参数解释:</p><p>default_icon:是指在浏览器地址栏后要显示的图标,复制一个图片到qinhen文件夹里面就可以了,记得图片名称要跟default_icon指定的一样。</p><p>default_popup:就是单击插件后要显示的界面,其实就是一个html文件。</p><p>Permissions:就是权限控制了,允许插件可以访问哪些网站。</p><p>popup.html代码如下:</p><pre class="">&lt;!DOCTYPE&nbsp;html&gt;\r\n&lt;html&gt; \r\n&lt;head&gt; \r\n&lt;meta&nbsp;charset="utf-8"&gt; \r\n&lt;style&nbsp;type="text/css"&gt; \r\n&nbsp;&nbsp;a{ \r\n&nbsp;&nbsp;&nbsp;&nbsp;text-decoration:&nbsp;none; \r\n&nbsp;&nbsp;&nbsp;&nbsp;color:&nbsp;#15a230; \r\n&nbsp;&nbsp;} \r\n&nbsp;&nbsp;a:hover{ \r\n&nbsp;&nbsp;&nbsp;&nbsp;color:&nbsp;red; \r\n&nbsp;&nbsp;} \r\n&nbsp;&nbsp;h2{ \r\n&nbsp;&nbsp;&nbsp;&nbsp;width:&nbsp;210px; \r\n&nbsp;&nbsp;} \r\n&lt;/style&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt; \r\n&nbsp;&nbsp;&lt;h2&gt;&lt;a&nbsp;href="<a href="http://qinhen.duapp.com/" rel="nofollow">http://qinhen.duapp.com/</a>"&nbsp;target="_blank"&gt;&lt;i&gt;点击进入&lt;/i&gt;沁痕博客&lt;/a&gt;&lt;/h2&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n</pre><p>4、在chrome浏览器中点击工具-&gt;扩展程序-&gt;加载正在开发的扩展程序,如下图:</p><p><img alt="Image" src="http://ww2.sinaimg.cn/mw690/c5e04220gw1ei6o0mtl77j211y0k3qa4.jpg" width="690" height="365" data-image-size="690,365"><br></p><p>5、测试扩展程序,如下图:</p><p><img alt="Image" src="http://ww2.sinaimg.cn/mw690/c5e04220gw1ei6o2tkunlj20ce06sdg5.jpg" width="446" height="244" data-image-size="446,244"><br></p><p>6、打包扩展程序,点击打包扩展程序button,选择扩展程序根目录,也就是刚才的qinhen文件夹,其他可以不管。这是就将刚才制作的扩展程序打包成.crx文件了。同时还会生成一个.pem文件,这是将来用来制作升级扩展程序时用的。</p><p>7、安装,如果直接拖进chrome安装,出现这样的提示“无法添加来自此网站的应用、扩展程序和用户脚本”,说明chrome现在只信任webstore里的扩展。这是我们只要在地址栏输入chrome://extensions/ 将插件拖进去就可以安装了(chrome://extensions/ 其实就是你刚才制作插件、打包插件的那个地方)。</p>', 0, '今天学习了下chrome插件开发,现在来做一个非常简单的插件。制作目标:  在chrome地址栏后面显示一个插件图标,点击插件时弹出一个界面,可以点击进入博客。开始制作插件:  1、创建一个qinhen文件夹;  2、在qinhen文件夹里面创建一个manifest.json的文件;  3、在json文件中进行配置{\r\n&nbsp;&nbsp;"name":&nbsp;"沁痕博客",\r\n&nbsp;&nbsp;"version":&nbsp;"1.0",\r\n&nbsp;&nbsp;"manifest_version":&nbsp;2,\r\n&nbsp;&nbsp;"description":&nbsp;"沁痕博客&nbsp;-&nbsp;没有价值", \r\n&nbsp;&nbsp;"browser_action":&nbsp;{"default_title":"沁痕博客",&nbsp;"default_icon":&nbsp;"icon.png"', 1, 30, '唐际忠'), (7, 'YiiWork开源了', 1479390797, '', '<p>yiiwork在github开源啦!!!YiiWork博客简称YW,采用PHP语言的MVC框架Yii Framework开发而成,使用了MySQL数据库。</p><p>github地址:<a href="https://github.com/tjz101/yiiwork" rel="nofollow">https://github.com/tjz101/yiiwork</a></p>', 0, 'yiiwork在github开源啦!!!YiiWork博客简称YW,采用PHP语言的MVC框架Yii Framework开发而成,使用了MySQL数据库。github地址:https://github.com/tjz101/yiiwork', 2, 27, '唐际忠'), (8, '收藏了国内几家较好的开源项目镜像站', 1479311652, '', '<p>阿里云&nbsp;<a href="http://mirrors.aliyun.com/">http://mirrors.aliyun.com/</a></p><p>网易&nbsp;<a href="http://mirrors.163.com/">http://mirrors.163.com/</a></p><p>搜狐&nbsp;<a href="http://mirrors.sohu.com/">http://mirrors.sohu.com/</a></p><p>中科大&nbsp;<a href="http://mirrors.ustc.edu.cn/">http://mirrors.ustc.edu.cn/</a></p><p>天津大学&nbsp;<a href="http://mirror.tju.edu.cn/">http://mirror.tju.edu.cn/</a></p><p>开源中国&nbsp;<a href="http://mirrors.oschina.net/">http://mirrors.oschina.net/</a></p><p>清华大学&nbsp;<a href="http://mirrors.tuna.tsinghua.edu.cn/">http://mirrors.tuna.tsinghua.edu.cn/</a></p><p>华中科技大学&nbsp;<a href="http://mirror.hust.edu.cn/">http://mirror.hust.edu.cn/</a></p><p>浙江大学&nbsp;<a href="http://mirrors.zju.edu.cn/">http://mirrors.zju.edu.cn/</a></p><p><br></p><p>在国内还有很多开源镜像站,在此不一一列举,感谢他们为国内开源软件用户提供的帮助。以上镜像站都提供了相应源的help文件,包括介绍及安装使用指南。</p>', 0, '阿里云&nbsp;http://mirrors.aliyun.com/网易&nbsp;http://mirrors.163.com/搜狐&nbsp;http://mirrors.sohu.com/中科大&nbsp;http://mirrors.ustc.edu.cn/天津大学&nbsp;http://mirror.tju.edu.cn/开源中国&nbsp;http://mirrors.oschina.net/', 3, 47, '唐际忠'), (9, 'Firefox不装插件屏蔽网页图片、js广告的终极方法,上网不再受干扰', 1479311646, '', '<p>记得以前的Firefox可以直接在设置中屏蔽图片和禁止javascript加载,但随着版本一次次的更新,这个功能已经没有了。但有时上网只想浏览纯文字页面的怎么办。</p><p>其实只要在地址栏输入about:config,然后找到permissions.default.image将它的值设置为2,就可禁止页面加载图片了,再找到javascript.enabled选项,将值改为false,则可以禁止网页加载javascript了。这样网页上的图片和js广告是不是就全没了。</p>', 0, '记得以前的Firefox可以直接在设置中屏蔽图片和禁止javascript加载,但随着版本一次次的更新,这个功能已经没有了。但有时上网只想浏览纯文字页面的怎么办。其实只要在地址栏输入about:config,然后找到permissions.default.image将它的值设置为2,就可禁止页面加载图片了,再找到javascript.enabled选项,将值改为false,则可以禁止网页加载javascript了。这样网页上的图片和js广告是不是就全没了。', 2, 30, '唐际忠'), (10, 'Commons Email更简单的使用java发送邮件', 1479311640, '', '<p>Commons Email是对java mail的封装,便于让人更简单的使用java发送邮件。</p><p>Commons Email提供的邮件类型如下:</p><p>Simple Email:支持简单的纯文本邮件发送;</p><p>MultiPartEmail:支持附件和内嵌形式的邮件发送;</p><p>HtmlEmail:支持发送html格式邮件,与MultiPart类似,如果出现不兼容HTML和内联图片会被转换为普通的文本;</p><p>ImageHtmlEmail:支持发送图文并茂的html邮箱,能将所有的外部图片转换成内联图片;</p><p>EmailAttachment:这是一个简单的容器,可以让你轻松的处理附件,它是基于MutiPartEmail和HtmlEmail的。</p><p>目前Commons Email的版本已更新到1.3.3。</p><p>下载地址:<a href="http://commons.apache.org/proper/commons-email/download_email.cgi">http://commons.apache.org/proper/commons-email/download_email.cgi</a></p>', 0, 'Commons Email是对java mail的封装,便于让人更简单的使用java发送邮件。Commons Email提供的邮件类型如下:Simple Email:支持简单的纯文本邮件发送;MultiPartEmail:支持附件和内嵌形式的邮件发送;HtmlEmail:支持发送html格式邮件,与MultiPart类似,如果出现不兼容HTML和内联图片会被转换为普通的文本;ImageHtmlEmail:支持发送图文并茂的html邮箱,能将所有的外部图片转换成内联图片;EmailAttachment:这是一个简单的容器,可以让你轻松的处理附件,它是基于MutiPartEmail和HtmlEmail的。目前Commons Email的版本已更新到1.3.3。下载地址:http://commons.apa', 1, 23, '唐际忠'), (11, '使用phpMyAdmin管理MySQL', 1479311635, 'http://ww3.sinaimg.cn/mw690/c5e04220gw1eidmqc2035j20jf0budhj.jpg', '<p>phpMyAdmin是目前最流行的MySQL 在线Web管理客户端。在进行远程管理MySQL时,比较其它C/S客户端要方便很多。功能非常丰富,强大。只要安装了WAMP或LAMP环境,然后下载phpMyAdmin,将其解压到htdocs目录中,即可使用了。如果要新建服务器连接访问“127.0.0.1/phpMyAdmin/setup”即可进行配置。</p><p><img alt="Image" src="http://ww3.sinaimg.cn/mw690/c5e04220gw1eidmqc2035j20jf0budhj.jpg" width="690" height="420" data-image-size="690,420"><br></p><p><br></p><p>phpMyAdmin下载地址:<a href="http://sourceforge.net/projects/phpmyadmin/">http://sourceforge.net/projects/phpmyadmin/</a><br></p><p>这里提供一个历史版本下载的链接,因为如果你用的是较低版本的MySQL是无法使用最新版本的phpMyAdmin的:<a href="http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/">http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/</a></p>', 0, 'phpMyAdmin是目前最流行的MySQL 在线Web管理客户端。在进行远程管理MySQL时,比较其它C/S客户端要方便很多。功能非常丰富,强大。只要安装了WAMP或LAMP环境,然后下载phpMyAdmin,将其解压到htdocs目录中,即可使用了。如果要新建服务器连接访问“127.0.0.1/phpMyAdmin/setup”即可进行配置。phpMyAdmin下载地址:http://sourceforge.net/projects/phpmyadmin/这里提供一个历史版本下载的链接,因为', 1, 30, '唐际忠'), (12, '轻便的MySQL Web管理工具Adminer', 1479311630, 'http://ww2.sinaimg.cn/mw690/c5e04220gw1eidmxxtc5jj20mb0ba78m.jpg', '<p>Adminer是一个类似于phpMyAdmin的MySQL Web客户端。但不同的是Adminer非常小巧,整个程序就只有一个php文件。界面也非常简洁,功能简单,比不上phpMyAdmin,但是提供了SQL执行,这足以弥补功能上的不足了。对于比较熟悉SQL语句的人来说Adminer还是非常好的。</p><p><img alt="Image" src="http://ww2.sinaimg.cn/mw690/c5e04220gw1eidmxxtc5jj20mb0ba78m.jpg" width="690" height="348" data-image-size="690,348"><br></p><p><img alt="Image" src="http://ww1.sinaimg.cn/mw690/c5e04220gw1eidn3kv2zsj20pw09zgn9.jpg" width="690" height="265" data-image-size="690,265"><br></p><p><br></p><p>Adminer下载地址:<a href="http://www.adminer.org/">http://www.adminer.org/</a></p>', 0, 'Adminer是一个类似于phpMyAdmin的MySQL Web客户端。但不同的是Adminer非常小巧,整个程序就只有一个php文件。界面也非常简洁,功能简单,比不上phpMyAdmin,但是提供了SQL执行,这足以弥补功能上的不足了。对于比较熟悉SQL语句的人来说Adminer还是非常好的。Adminer下载地址:', 1, 29, '唐际忠'), (13, '使用apache的ab.exe对网站进行压力测试', 1479311624, 'http://ww1.sinaimg.cn/mw690/c5e04220gw1eifwotczvtj20dh07i758.jpg', '<p>ab.exe是apache自带的一个压力测试工具。在bin目录下面。<br></p><p><br></p><p><img alt="Image" src="http://ww1.sinaimg.cn/mw690/c5e04220gw1eifwotczvtj20dh07i758.jpg" width="485" height="270" data-image-size="485,270"></p><p>【镇楼图(本来想用萌妹子的,后来想想,还是算了,这年头妹子惹不起啊,何况是我等苦逼程序员,就更加应该避而远之了)】</p><p><br></p><p>ab的使用方法,请看我对百度进行压力测试:</p><p>ab -n100 -c100 <a href="http://www.baidu.com/">http://www.baidu.com/</a><br></p><p>这里表示模拟-c100个用户对百度发起-n100个请求。当然这点并发量不可能对百度带来任何压力,这仅作演示。</p><p>压力测试信息如下:</p><p><img alt="Image" src="http://ww3.sinaimg.cn/mw690/c5e04220gw1eifwit5ewkj20il0k2wio.jpg" width="469.7825484764543" height="507" data-image-size="669,722"><br></p><p><br></p><p>上面全是英文信息,不多解释了。不懂,查有道词典吧。</p><p>ps:ab也可以算的上是ddos攻击工具,学会了请勿做坏事,站在一个站长的角度来说,其实我们都是无辜的。请理解我们站长的心情。</p>', 0, 'ab.exe是apache自带的一个压力测试工具。在bin目录下面。【镇楼图(本来想用萌妹子的,后来想想,还是算了,这年头妹子惹不起啊,何况是我等苦逼程序员,就更加应该避而远之了)】ab的使用方法,请看我对百度进行压力测试:ab -n100 -c100 http://www.baidu.com/这里表示模拟-c100个用户对百度发起-n100个请求。当然这点并发量不可能对百度带来任何压力,这仅作演示。压力测试信息如下:', 1, 58, '唐际忠'), (14, '使用css3制作QQ6.1登录按钮', 1479311618, 'http://ww2.sinaimg.cn/mw690/c5e04220gw1eitgi8xiqwj20by096jsb.jpg', '<p><img alt="Image" src="http://ww2.sinaimg.cn/mw690/c5e04220gw1eitgi8xiqwj20by096jsb.jpg" width="430" height="330" data-image-size="430,330"><br></p><p>用过最新版QQ6.1的,是不是感觉登录界面很炫?据说QQ界面,也是使用css3&nbsp;html5制作出来的,然后通过封装Chromium框架而进行展现。那么今天我自己也尝试了一把。用css3来制作QQ登录按钮。如果你是一名web程序员,那么你很容易就可以做出跟QQ一样炫丽的界面。<br></p><p>html代码:</p><pre class="lang-html" data-lang="html">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n &lt;head&gt;\r\n &lt;meta charset="utf-8"&gt;\r\n &lt;style type="text/css"&gt;\r\n .btn{\r\n background: #09a3dc; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*背景颜色*/\r\n border: none; /*不要边框*/\r\n width: 195px; /*设置按钮的长度*/\r\n height: 30px; /*设置按钮的宽度*/\r\n color: #FFFFFF; /*设置字体颜色*/\r\n line-height: 30px; /*设置行高*/\r\n letter-spacing: 1em; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*设置字体的间距*/\r\n border-radius: 5px; /*设置圆角边框*/\r\n font-family: 黑体; /*设置字体*/\r\n font-size: 14px; /*设置字体大小*/\r\n outline: none; /*当点击时不要出现边框*/\r\n transition: all .3s ease-in-out; /*为按钮背景切换带来平滑效果,不那么突兀*/\r\n }\r\n .btn_hover{\r\n transition: all .3s ease-in-out;\r\n background: #3cc3f5;\r\n }\r\n &lt;/style&gt;\r\n &lt;script type="text/javascript"&gt;\r\n /*等待页面加载完毕,给按钮添加各种鼠标事件及css切换*/\r\n window.onload = function(){\r\n var login_btn= document.getElementById(''login_btn'');\r\n login_btn.onmouseover = function(){\r\n login_btn.className=''btn btn_hover'';\r\n }\r\n login_btn.onmouseout = function(){\r\n login_btn.className=''btn'';\r\n }\r\n login_btn.onmousedown = function(){\r\n login_btn.className=''btn'';\r\n }\r\n login_btn.onmouseup = function(){\r\n login_btn.className=''btn btn_hover'';\r\n }\r\n }\r\n &lt;/script&gt;\r\n &lt;/head&gt;\r\n &lt;body&gt;\r\n &lt;button class="btn" id="login_btn"&gt;登录&lt;/button&gt;\r\n &lt;/body&gt;\r\n&lt;/html&gt;</pre><p>在chrome浏览器中打开:</p><p><img alt="Image" src="http://ww2.sinaimg.cn/mw690/c5e04220gw1eitgft2tbuj207o03emxd.jpg" width="276" height="122" data-image-size="276,122"><br></p><p>如果在chrome浏览器中打开,你感觉这还是B/S结构程序,那么下面就以C/S形式打开看看。</p><p>我自己编译了一个Chromium框架的示例,然后在里面打开这个html。</p><p><img alt="Image" src="http://ww2.sinaimg.cn/mw690/c5e04220gw1eitgfu3l87j206j02j74c.jpg" width="235" height="91" data-image-size="235,91"><br></p><p>是不是很有C/S的感觉了,试试用CSS3 和HTML5来制作漂亮的桌面应用程序吧。当然,要做这样的程序,并不需要我们自己都去编译Chromium框架。目前互联网上已有各种开源实现。如nodewebkit、有道的hex、腾讯的webtop(alloydesktop),直接配置使用即可。能够很好的把你的B/S项目移植到C/S上。</p>', 0, '用过最新版QQ6.1的,是不是感觉登录界面很炫?据说QQ界面,也是使用css3&nbsp;html5制作出来的,然后通过封装Chromium框架而进行展现。那么今天我自己也尝试了一把。用css3来制作QQ登录按钮。如果你是一名web程序员,那么你很容易就可以做出跟QQ一样炫丽的界面。html代码:&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n &lt;head&gt;\r\n &lt;meta charset="utf-8"&gt;\r\n &lt;style type="text/css"&gt;\r\n .btn{\r\n ba', 1, 119, '唐际忠'), (15, '风扇不转了,程序员转行修扇记', 1479311611, '', '<p>炎炎夏日,风扇不转了。</p><p>症状:</p><p>1、某一叶片被拦腰截断;</p><p>2、还有两片扇叶,但不能转动了。</p><p>依据上述两点可分为这两种情况:</p><p>1、风扇的发动机坏了;</p><p>2、叶片断了导致不平衡才出现了不能转动情况。</p><p>如果是第一种,那么风扇基本上算是报废了,幸好我的是第二种情况。于是准备了如下工具及原材料进行抢修。</p><p>维修工具:</p><p>十字形螺丝刀一把</p><p>原材料:</p><p>新的扇叶</p><p>维修步骤:用螺丝刀拧开风扇的防护罩(其实我也不知道到底叫什么),然后把断了的坏扇叶拧出,把新的放进去。然后把防护罩装好就ok了。</p><p>碰到的难题:</p><p>1、不知道怎么把坏的扇叶拧出,开始以为是用蛮力。没想到在扇叶圆中心的那个地方有个类似螺帽一样的东西,拧盖就可以了。很轻松就能取出扇叶了;</p><p>2、拧盖防护罩,把上面螺丝的螺帽弄丢了,罪过罪过,赶紧出去找楼下小店的老板化缘了一个回来(感谢好人呐)。</p><p>就这样风扇修好了。</p><p>ps:维修(还是回收)彩电、冰箱、空调、旧电脑 ^_^废报纸.................</p>', 0, '炎炎夏日,风扇不转了。症状:1、某一叶片被拦腰截断;2、还有两片扇叶,但不能转动了。依据上述两点可分为这两种情况:1、风扇的发动机坏了;2、叶片断了导致不平衡才出现了不能转动情况。如果是第一种,那么风扇基本上算是报废了,幸好我的是第二种情况。于是准备了如下工具及原材料进行抢修。维修工具:十字形螺丝刀一把原材料:新的扇叶维修步骤:用螺丝刀拧开风扇的防护罩(其实我也不知道到底叫什么),然后把断了的坏扇叶拧出,把新的放进去。然后把防护罩装好就ok了。碰到的难题:1、不知道怎么把坏的扇叶拧出,开始以为是用蛮力。没想到在扇叶圆中心的那个地方有个类似螺帽一样的东西,拧盖就可以了。很轻松就能取出扇叶了;2、拧盖防护罩,把上面螺丝的螺帽弄丢了,罪过罪过,赶紧出去找楼下小店的老板化缘了一个回来(感谢好人呐)。就这样风扇修好了。ps:维修(还是回', 2, 56, '唐际忠'), (16, 'CodeIgniter在IE8及一下浏览器无法设置session', 1479311605, '', '<p>今天在使用CodeIgniter做一个网站项目时,在本地的IE、firefox、chrome浏览器上面登录都是成功的。但发布到服务器中时,在IE8浏览器中无法登录了。而在IE9中又是好的。后来通过在网络中搜索资料发现。原来在域名中不能含有“_”符号。否则,将可能导致session出问题。<br></p><p>参考资料:</p><blockquote><p>RFC 952规定在域名中不能出现"_" , 在使用中,应尽量避免这种情况<br></p></blockquote><p>在网上还有一种说法就是,关闭session对数据库的存储。在config.php中将sess_use_database设置为FALSE。</p><pre class="lang-php" data-lang="php">$config[''sess_use_database''] = FALSE;\r\n</pre>', 0, '今天在使用CodeIgniter做一个网站项目时,在本地的IE、firefox、chrome浏览器上面登录都是成功的。但发布到服务器中时,在IE8浏览器中无法登录了。而在IE9中又是好的。后来通过在网络中搜索资料发现。原来在域名中不能含有“_”符号。否则,将可能导致session出问题。参考资料:RFC 952规定在域名中不能出现"_" , 在使用中,应尽量避免这种情况在网上还有一种说法就是,关闭session对数据库的存储。在config.php中将sess_use_database设置为FALSE。$config[''sess_use_database''] = FALSE;\r\n', 1, 11, '唐际忠'); -- -------------------------------------------------------- -- -- 表的结构 `yw_articletag` -- CREATE TABLE IF NOT EXISTS `yw_articletag` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `aid` int(10) unsigned NOT NULL, `tid` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=67 ; -- -- 转存表中的数据 `yw_articletag` -- INSERT INTO `yw_articletag` (`id`, `aid`, `tid`) VALUES (33, 16, 20), (34, 16, 21), (35, 15, 19), (36, 14, 18), (37, 13, 17), (38, 12, 16), (39, 12, 15), (40, 12, 14), (41, 11, 14), (42, 11, 15), (43, 10, 12), (44, 10, 13), (45, 9, 9), (46, 9, 10), (47, 9, 11), (48, 8, 8), (49, 2, 5), (50, 2, 6), (51, 2, 7), (52, 3, 5), (53, 3, 6), (54, 3, 7), (55, 4, 4), (56, 6, 2), (57, 6, 3), (60, 5, 19), (65, 7, 19), (66, 1, 19); -- -------------------------------------------------------- -- -- 表的结构 `yw_category` -- CREATE TABLE IF NOT EXISTS `yw_category` ( `cid` int(10) unsigned NOT NULL AUTO_INCREMENT, `cname` varchar(15) NOT NULL DEFAULT '', `cno` int(10) unsigned DEFAULT '0', PRIMARY KEY (`cid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- 转存表中的数据 `yw_category` -- INSERT INTO `yw_category` (`cid`, `cname`, `cno`) VALUES (1, '软件编程', 2), (2, '生活随笔', 6), (3, '建站资源', 1); -- -------------------------------------------------------- -- -- 表的结构 `yw_comment` -- CREATE TABLE IF NOT EXISTS `yw_comment` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `nickname` varchar(50) NOT NULL DEFAULT '', `email` varchar(150) NOT NULL DEFAULT '', `content` text, `aid` int(10) unsigned NOT NULL, `time` int(10) unsigned NOT NULL, `ip` varchar(50) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- 表的结构 `yw_link` -- CREATE TABLE IF NOT EXISTS `yw_link` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(80) NOT NULL DEFAULT '', `href` varchar(255) NOT NULL DEFAULT '', `description` varchar(200) NOT NULL DEFAULT '', `no` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- 转存表中的数据 `yw_link` -- INSERT INTO `yw_link` (`id`, `name`, `href`, `description`, `no`) VALUES (2, '月光博客', 'http://www.williamlong.info/', '', 2), (3, '卢松松博客', 'http://lusongsong.com/', '', 1), (4, '百度开放云平台', 'http://developer.baidu.com/', '', 3), (5, '沁痕网络', 'http://www.qinhen.net/', '', 0); -- -------------------------------------------------------- -- -- 表的结构 `yw_site` -- CREATE TABLE IF NOT EXISTS `yw_site` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(80) NOT NULL DEFAULT '', `title` varchar(80) NOT NULL DEFAULT '', `keywords` varchar(100) NOT NULL DEFAULT '', `description` varchar(200) NOT NULL DEFAULT '', `statistical` text NOT NULL, `slogan` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- 转存表中的数据 `yw_site` -- INSERT INTO `yw_site` (`id`, `name`, `title`, `keywords`, `description`, `statistical`, `slogan`) VALUES (1, 'YiiWork', '没有价值', '草根站长,互联网创业', '一声呼唤儿时的伙伴,云儿散开笑容又回来。', '<span style="display:none;"><script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id=''cnzz_stat_icon_5951370''%3E%3C/span%3E%3Cscript src=''" + cnzz_protocol + "s4.cnzz.com/stat.php%3Fid%3D5951370'' type=''text/javascript''%3E%3C/script%3E"));</script></span>', '<p>天下皆知美之为美,斯恶已;</p><p class="pull-right">皆知善之为善,斯不善已。</p>'); -- -------------------------------------------------------- -- -- 表的结构 `yw_tag` -- CREATE TABLE IF NOT EXISTS `yw_tag` ( `tid` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(12) NOT NULL DEFAULT '', PRIMARY KEY (`tid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ; -- -- 转存表中的数据 `yw_tag` -- INSERT INTO `yw_tag` (`tid`, `name`) VALUES (1, '古剑奇谭'), (2, 'chrome'), (3, '插件开发'), (4, 'Paas平台'), (5, 'weiphp'), (6, '微信'), (7, '公众号开发'), (8, '开源项目'), (9, 'Firefox'), (10, 'JavaScript'), (11, '插件'), (12, 'CommonsEmail'), (13, 'Java Mail'), (14, 'phpMyAdmin'), (15, 'MySQL'), (16, 'Adminer'), (17, '压力测试'), (18, 'Chromium'), (19, ''), (20, 'PHP'), (21, 'CodeIgniter'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>anrodigina/ClickHouse CREATE TEMPORARY TABLE test (d DateTime) ENGINE = Memory; SET date_time_input_format = 'best_effort'; INSERT INTO test VALUES ('2018-06-08T01:02:03.000Z'); SELECT toTimeZone(d, 'UTC') FROM test;
<reponame>mikesep/comdb2 select * from comdb2_users; select * from comdb2_tables order by tablename; -- create users put password '<PASSWORD>' for 'root'; put password '<PASSWORD>' for 'foo'; -- set OP user grant op to 'root' set user 'root' set password '<PASSWORD>' -- turn on authentication put authentication on create table t1(i int)$$ insert into t1 values(1); select * from t1; -- grant READ to 'foo' grant READ on 't1' to 'foo'; -- switch to 'foo' user set user 'foo' set password '<PASSWORD>' select * from t1; -- switch back to the 'root' user and recreate the table set user 'root' set password '<PASSWORD>' drop table t1; create table t1(i int)$$ insert into t1 values(1); select * from t1; -- switch back to 'foo' user, should no longer have access to 't1' set user 'foo' set password '<PASSWORD>' select * from t1; -- cleanup set user 'root' set password '<PASSWORD>' drop table t1; put authentication off put password off for 'root'; put password off for 'foo'; select * from comdb2_users; select * from comdb2_tables order by tablename;
<gh_stars>1000+ -- Tags: no-parallel CREATE FUNCTION 01856_test_function_0 AS (a, b, c) -> a * b * c; SELECT 01856_test_function_0(2, 3, 4); SELECT isConstant(01856_test_function_0(1, 2, 3)); DROP FUNCTION 01856_test_function_0; CREATE FUNCTION 01856_test_function_1 AS (a, b) -> a || b || c; --{serverError 47} CREATE FUNCTION 01856_test_function_1 AS (a, b) -> 01856_test_function_1(a, b) + 01856_test_function_1(a, b); --{serverError 611} CREATE FUNCTION cast AS a -> a + 1; --{serverError 609} CREATE FUNCTION sum AS (a, b) -> a + b; --{serverError 609} CREATE FUNCTION 01856_test_function_2 AS (a, b) -> a + b; CREATE FUNCTION 01856_test_function_2 AS (a) -> a || '!!!'; --{serverError 609} DROP FUNCTION 01856_test_function_2; DROP FUNCTION unknown_function; -- {serverError 46} DROP FUNCTION CAST; -- {serverError 610}
/*L Copyright SAIC Distributed under the OSI-approved BSD 3-Clause License. See http://ncip.github.com/cabio/LICENSE.txt for details. L*/ drop index PROTEINAIN_BIG_ID_LWR; drop index PROTEINAIN_BIG_ID; drop index SYS_C0021167_IDX; drop index PROTEIN_MAIN_ACCESSION__LWR; drop index PROTEIN_MAIN_DESCRIPTIO_LWR; drop index PROTEIN_MAIN_TYPE_LWR; drop index PROTEIN_MAIN_ID; drop index PROTEIN_MAIN_ACCESSION_; drop index PROTEIN_MAIN_DESCRIPTIO; drop index PROTEIN_MAIN_TYPE; --EXIT;
<gh_stars>1-10 SET NAMES utf8; CREATE DATABASE `seata_storage` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE seata_storage; DROP TABLE IF EXISTS `t_storage`; CREATE TABLE `t_storage` ( `id` bigint(11) NOT NULL AUTO_INCREMENT, `product_id` bigint(11) NULL DEFAULT NULL COMMENT '产品id', `total` int(11) NULL DEFAULT NULL COMMENT '库存', `used` int(11) NULL DEFAULT NULL COMMENT '已用库存', `residue` int(11) NULL DEFAULT NULL COMMENT '剩余库存', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 ; INSERT INTO seata_storage.t_storage (id, product_id, total, used, residue) VALUES (1, 1, 100, 0, 100); CREATE TABLE IF NOT EXISTS `undo_log` ( `branch_id` BIGINT(20) NOT NULL COMMENT 'branch transaction id', `xid` VARCHAR(100) NOT NULL COMMENT 'global transaction id', `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status', `log_created` DATETIME(6) NOT NULL COMMENT 'create datetime', `log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime', UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`) ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8 COMMENT ='AT transaction mode undo table';
<filename>src/schema_generator.sql -- make database drop database restaurant_finder; create database restaurant_finder; show databases; -- create table use restaurant_finder; create table restaurant( restaurant_id int, name varchar(256), type varchar(256), description varchar(8000), time_monday_open time, time_monday_close time, time_tuesday_open time, time_tuesday_close time, time_wednesday_open time, time_wednesday_close time, time_thursday_open time, time_thursday_close time, time_friday_open time, time_friday_close time, time_saturday_open time, time_saturday_close time, time_sunday_open time, time_sunday_close time, primary key (restaurant_id) ); show tables; desc restaurant;
<filename>php/database.sql -- agent (avatar) information CREATE TABLE IF NOT EXISTS agent ( id INTEGER NOT NULL AUTO_INCREMENT, username VARCHAR(100), displayname VARCHAR(100), keyid VARCHAR(50), role VARCHAR(50), PRIMARY KEY(id), UNIQUE INDEX(keyid), UNIQUE INDEX(username) ) ENGINE=INNODB; INSERT IGNORE INTO agent(id, username, displayname, keyid) VALUES (1, 'system', 'system', 'system'); -- transaction are used as identifier for changes (e. g. creating or deleting merits) CREATE TABLE IF NOT EXISTS transaction ( id INTEGER NOT NULL AUTO_INCREMENT, agent_id INTEGER NOT NULL, transaction_timestamp DATETIME, PRIMARY KEY(id), FOREIGN KEY(agent_id) REFERENCES agent(id) ) ENGINE=INNODB; INSERT IGNORE INTO transaction(id, agent_id, transaction_timestamp) VALUES (1, 1, '1000-01-01 00:00:01'); INSERT IGNORE INTO transaction(id, agent_id, transaction_timestamp) VALUES (2, 1, '9999-12-31 23:59:59'); -- merits and demerits CREATE TABLE IF NOT EXISTS merit ( id INTEGER NOT NULL AUTO_INCREMENT, target_agent_id INTEGER NOT NULL, created_transaction_id INTEGER NOT NULL, deleted_transaction_id INTEGER NOT NULL, merit VARCHAR(10), message VARCHAR(1000), PRIMARY KEY(id), FOREIGN KEY(target_agent_id) REFERENCES agent(id), FOREIGN KEY(created_transaction_id) REFERENCES transaction(id), FOREIGN KEY(deleted_transaction_id) REFERENCES transaction(id) ) ENGINE=INNODB; -- session keep track of multi step interactions (e. g. opening a dialog box and processing a reply with a textbox) CREATE TABLE IF NOT EXISTS session ( id INTEGER NOT NULL AUTO_INCREMENT, target_agent_id INTEGER, acting_agent_id INTEGER, identifier INTEGER, status VARCHAR(255), details VARCHAR(1000), PRIMARY KEY(id), UNIQUE INDEX(identifier), FOREIGN KEY(target_agent_id) REFERENCES agent(id), FOREIGN KEY(acting_agent_id) REFERENCES agent(id) ) ENGINE=INNODB; -- group -- permission -- permission_group -- pending(account, command, params) -- events(account, region, command, params)
<reponame>ltian123/ajax<filename>database/create.sql create table t_data( spell varchar(10), message varchar(100) ); insert into t_data values('abc','aaa bbb ccc'); insert into t_data values('a','aaaaaaaaaaaaaaa'); insert into t_data values('asd','aaa ssss ddqwe'); insert into t_data values('qw','qqqqqqqqw'); insert into t_data values('dfa','dddd fff bbb ccca'); insert into t_data values('zs','zhangsan'); insert into t_data values('ls','lisi'); insert into t_data values('ww','wangwu'); insert into t_data values('zl','zhaoliu'); insert into t_data values('qq','qianqi'); insert into t_data values('zb','zaiba');
<reponame>doanngochoanghy/XSS -- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 01, 2017 at 05:44 PM -- Server version: 5.7.20-0ubuntu0.16.04.1 -- PHP Version: 7.0.22-0ubuntu0.16.04.1 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: `web002` -- -- -------------------------------------------------------- -- -- Table structure for table `posts` -- CREATE TABLE `posts` ( `post_id` int(255) NOT NULL, `title` varchar(255) NOT NULL, `author_id` int(255) NOT NULL, `content` text NOT NULL, `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `posts` -- INSERT INTO `posts` (`post_id`, `title`, `author_id`, `content`, `date_created`) VALUES (1, 'Title 1', 1, 'asdfasdadfasdfasfsddsdfsdfs\r\nadjlsfl\r\nasdlfjaskl\r\nsadflakjafsdfasdfas', '2017-10-24 14:44:23'), (4, 'a', 3, 'afdsa', '2017-10-25 10:29:16'), (5, 'a', 3, 'c', '2017-10-25 16:23:57'), (6, 'adf', 3, 'asdf', '2017-10-26 15:31:12'), (13, '3', 3, '2sdfsggsd', '2017-10-26 16:26:49'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `username` varchar(255) NOT NULL, `user_id` int(255) NOT NULL, `password` varchar(255) NOT NULL, `is_admin` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`username`, `user_id`, `password`, `is_admin`) VALUES ('hoangdn', 1, '<PASSWORD>', 0), ('admin', 3, '<PASSWORD>', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `posts` -- ALTER TABLE `posts` ADD PRIMARY KEY (`post_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`user_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `posts` -- ALTER TABLE `posts` MODIFY `post_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `user_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; /*!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 */;
-- -- Gets a game. -- -- PARAMS: -- id - The ID of the game. -- -- RETURNS: The game, if found. -- CREATE PROCEDURE [dbo].[GetGame] @id INT AS BEGIN SET NOCOUNT ON; SELECT Id, Name, Description, Price, Owned, Completed FROM Games WHERE Id = @id END
<filename>sql/alter-table.sql<gh_stars>0 USE [Curso]; GO ALTER TABLE [Aluno] ADD [Documento] NVARCHAR(11); GO ALTER TABLE [Aluno] DROP COLUMN [Documento]; GO ALTER TABLE [Aluno] ALTER COLUMN [Documento] CHAR(11); GO
-- phpMyAdmin SQL Dump -- version 4.9.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Oct 27, 2021 at 02:34 AM -- Server version: 10.5.12-MariaDB-cll-lve -- PHP Version: 7.2.34 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: `u623987209_fea` -- -- -------------------------------------------------------- -- -- Table structure for table `activity_log` -- CREATE TABLE `activity_log` ( `id` int(11) NOT NULL, `user` int(11) NOT NULL, `description` text NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `announcements` -- CREATE TABLE `announcements` ( `id` int(11) NOT NULL, `title` varchar(100) NOT NULL, `description` text NOT NULL, `image` varchar(100) NOT NULL, `uploader` int(11) NOT NULL, `link` varchar(10) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `candidates` -- CREATE TABLE `candidates` ( `id` int(11) NOT NULL, `election_id` int(11) NOT NULL, `position_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `photo` varchar(60) DEFAULT NULL, `platform` text NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `comments` -- CREATE TABLE `comments` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL, `comment` text NOT NULL, `deleted_by` int(11) DEFAULT NULL, `comment_date` datetime NOT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `constitutions` -- CREATE TABLE `constitutions` ( `id` int(11) NOT NULL, `area` varchar(150) NOT NULL, `content` text NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `constitutions` -- -- -------------------------------------------------------- -- -- Table structure for table `contributions` -- CREATE TABLE `contributions` ( `id` int(11) NOT NULL, `name` varchar(120) NOT NULL, `cost` double NOT NULL, `created_by` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `elections` -- CREATE TABLE `elections` ( `id` int(11) NOT NULL, `title` varchar(50) NOT NULL, `vote_start` datetime NOT NULL, `vote_end` datetime NOT NULL, `type` tinyint(1) NOT NULL COMMENT '1 for with party, 2 for per type of employee', `status` enum('Application','Voting','Finished') NOT NULL DEFAULT 'Application', `officer_set` tinyint(1) NOT NULL COMMENT 'has the officer set', `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `electoral_positions` -- CREATE TABLE `electoral_positions` ( `id` int(11) NOT NULL, `position_name` varchar(150) NOT NULL, `max_candidate` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `file_sharing` -- CREATE TABLE `file_sharing` ( `id` int(11) NOT NULL, `file_name` varchar(150) NOT NULL, `size` int(25) NOT NULL, `extension` varchar(10) NOT NULL, `uploader` int(11) NOT NULL COMMENT 'user id of the uploader', `category` varchar(50) NOT NULL COMMENT 'file category', `visibility` enum('for all','admin') NOT NULL COMMENT 'visibility of the file', `downloads` int(11) NOT NULL COMMENT 'Number of downloads', `uploaded_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `logins` -- CREATE TABLE `logins` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `role_id` int(11) NOT NULL, `login_date` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `logins` -- -- -------------------------------------------------------- -- -- Table structure for table `news` -- CREATE TABLE `news` ( `id` int(11) NOT NULL, `title` varchar(100) NOT NULL, `content` longtext NOT NULL, `author` int(11) NOT NULL, `image` varchar(100) NOT NULL, `status` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `officers` -- CREATE TABLE `officers` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `position` varchar(100) NOT NULL, `election_id` int(11) NOT NULL, `status` tinyint(1) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `payments` -- CREATE TABLE `payments` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `photo` varchar(150) NOT NULL, `contri_id` int(11) NOT NULL, `amount` double NOT NULL, `added_by` int(11) NOT NULL COMMENT 'User that added the transaction', `is_approved` tinyint(1) NOT NULL COMMENT 'Is the transaction approved', `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `payment_feedbacks` -- CREATE TABLE `payment_feedbacks` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `subject` varchar(100) NOT NULL, `comment` longtext NOT NULL, `attachment` varchar(100) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `payment_methods` -- CREATE TABLE `payment_methods` ( `id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `steps` longtext NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `payment_methods` -- INSERT INTO `payment_methods` (`id`, `name`, `steps`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'GCash', '<ol><li>Go to GCash app on your cell phone</li><li>Tap on send money</li><li>Tap \"Express Send\"</li><li>Enter mobile number \'09123123123\'</li><li>Add 200php as the amount then tap next</li><li>Tap on send</li><li>Take a screenshot of the receipt</li><li>Return <a href=\"http://feams.csovernightstaguig.online/\" target=\"_blank\">to the site</a> and login your account</li><li>A popup should appear, and upload the receipt.</li><li>Wait for the email from the site administrator when your verification is success.</li></ol>', '2021-09-01 10:26:32', '2021-10-07 18:50:12', NULL), (2, 'Landbank', '<p><img src=\"https://governmentph.com/wp-content/uploads/2017/10/How-to-transfer-money-using-Landbank-Mobile-App_6.png\" style=\"width: 25%;\"><br></p>', '2021-09-01 10:28:35', '2021-09-01 10:28:35', NULL); -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` int(11) NOT NULL, `perm_mod` varchar(10) NOT NULL, `desc` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `permissions` -- INSERT INTO `permissions` (`id`, `perm_mod`, `desc`) VALUES (1, 'USR', 'View Users'), (2, 'USR', 'Delete Users'), (3, 'USR', 'Change User Status'), (4, 'USR', 'Change User Role'), (5, 'ROLE', 'Add role'), (6, 'ROLE', 'Edit role'), (7, 'ROLE', 'Delete role'), (8, 'ROLE', 'View roles'), (9, 'PERM', 'View permissions'), (10, 'PERM', 'Edit permissions'), (11, 'ANN', 'View announcements'), (12, 'ANN', 'Add announcements'), (13, 'ANN', 'Edit announcements'), (14, 'ANN', 'Delete announcements'), (15, 'SLID', 'View sliders'), (16, 'SLID', 'Add sliders'), (17, 'SLID', 'Edit sliders'), (18, 'SLID', 'Delete sliders'), (19, 'ELEC', 'View elections'), (20, 'ELEC', 'Add elections'), (21, 'ELEC', 'Edit elections'), (22, 'ELEC', 'Delete elections'), (23, 'POS', 'View positions'), (24, 'POS', 'Add position'), (25, 'POS', 'Edit position'), (26, 'POS', 'Delete position'), (27, 'CAN', 'View candidate'), (28, 'CAN', 'Add candidate'), (29, 'CAN', 'Edit candidate'), (30, 'CAN', 'Delete candidate'), (31, 'FILES', 'View files'), (32, 'FILES', 'Manage files'), (33, 'FICAT', 'View file categories'), (34, 'FICAT', 'Manage file categories'), (35, 'DISC', 'Manage discussions'), (36, 'COMM', 'Manage comments'), (37, 'REPO', 'View reports'), (38, 'USR', 'Edit Users'), (39, 'CONT', 'Manage contributions'), (40, 'PAY', 'Manage payments'), (41, 'NEWS', 'View News'), (42, 'NEWS', 'Add News'), (43, 'NEWS', 'Edit News'), (44, 'NEWS', 'Delete News'); -- -------------------------------------------------------- -- -- Table structure for table `positions` -- CREATE TABLE `positions` ( `id` int(11) NOT NULL, `election_id` int(11) NOT NULL, `elec_position_id` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` int(11) NOT NULL, `role_name` varchar(50) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `role_name`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'System Administrator', '2021-08-30 09:03:32', NULL, NULL), (2, 'Member', '2021-08-30 09:03:32', NULL, NULL), (3, 'Treasurer', '2021-09-14 15:02:44', '2021-09-14 15:02:44', NULL); -- -------------------------------------------------------- -- -- Table structure for table `role_permissions` -- CREATE TABLE `role_permissions` ( `id` int(11) NOT NULL, `role_id` int(11) NOT NULL, `perm_mod` varchar(10) NOT NULL, `perm_id` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `role_permissions` -- INSERT INTO `role_permissions` (`id`, `role_id`, `perm_mod`, `perm_id`, `created_at`, `updated_at`, `deleted_at`) VALUES (58, 1, 'USR', 1, '2021-09-17 09:27:45', '2021-09-17 09:27:45', NULL), (59, 1, 'USR', 2, '2021-09-17 09:27:47', '2021-09-17 09:27:47', NULL), (60, 1, 'USR', 3, '2021-09-17 09:27:47', '2021-09-17 09:27:47', NULL), (61, 1, 'USR', 4, '2021-09-17 09:27:47', '2021-09-17 09:27:47', NULL), (62, 1, 'ROLE', 5, '2021-09-17 09:27:48', '2021-09-17 09:27:48', NULL), (63, 1, 'ROLE', 6, '2021-09-17 09:27:48', '2021-09-17 09:27:48', NULL), (64, 1, 'ROLE', 7, '2021-09-17 09:27:48', '2021-09-17 09:27:48', NULL), (65, 1, 'ROLE', 8, '2021-09-17 09:27:49', '2021-09-17 09:27:49', NULL), (66, 1, 'PERM', 9, '2021-09-17 09:27:49', '2021-09-17 09:27:49', NULL), (67, 1, 'PERM', 10, '2021-09-17 09:27:49', '2021-09-17 09:27:49', NULL), (68, 1, 'ANN', 11, '2021-09-17 09:27:50', '2021-09-17 09:27:50', NULL), (69, 1, 'ANN', 12, '2021-09-17 09:27:50', '2021-09-17 09:27:50', NULL), (70, 1, 'ANN', 13, '2021-09-17 09:27:50', '2021-09-17 09:27:50', NULL), (71, 1, 'ANN', 14, '2021-09-17 09:27:50', '2021-09-17 09:27:50', NULL), (72, 1, 'SLID', 15, '2021-09-17 09:27:50', '2021-09-17 09:27:50', NULL), (73, 1, 'SLID', 16, '2021-09-17 09:27:51', '2021-09-17 09:27:51', NULL), (74, 1, 'SLID', 17, '2021-09-17 09:27:51', '2021-09-17 09:27:51', NULL), (75, 1, 'SLID', 18, '2021-09-17 09:27:51', '2021-09-17 09:27:51', NULL), (76, 1, 'ELEC', 19, '2021-09-17 09:27:51', '2021-09-17 09:27:51', NULL), (77, 1, 'ELEC', 20, '2021-09-17 09:27:51', '2021-09-17 09:27:51', NULL), (78, 1, 'ELEC', 21, '2021-09-17 09:27:52', '2021-09-17 09:27:52', NULL), (79, 1, 'ELEC', 22, '2021-09-17 09:27:52', '2021-09-17 09:27:52', NULL), (80, 1, 'POS', 23, '2021-09-17 09:27:52', '2021-09-17 09:27:52', NULL), (81, 1, 'POS', 24, '2021-09-17 09:27:52', '2021-09-17 09:27:52', NULL), (82, 1, 'POS', 25, '2021-09-17 09:27:53', '2021-09-17 09:27:53', NULL), (83, 1, 'POS', 26, '2021-09-17 09:27:53', '2021-09-17 09:27:53', NULL), (84, 1, 'CAN', 27, '2021-09-17 09:27:53', '2021-09-17 09:27:53', NULL), (85, 1, 'CAN', 28, '2021-09-17 09:27:53', '2021-09-17 09:27:53', NULL), (86, 1, 'CAN', 29, '2021-09-17 09:27:53', '2021-09-17 09:27:53', NULL), (87, 1, 'CAN', 30, '2021-09-17 09:27:54', '2021-09-17 09:27:54', NULL), (88, 1, 'FILES', 31, '2021-09-17 09:27:54', '2021-09-17 09:27:54', NULL), (89, 1, 'FILES', 32, '2021-09-17 09:27:54', '2021-09-17 09:27:54', NULL), (90, 1, 'FICAT', 33, '2021-09-17 09:27:54', '2021-09-17 09:27:54', NULL), (91, 1, 'FICAT', 34, '2021-09-17 09:27:54', '2021-09-17 09:27:54', NULL), (92, 1, 'DISC', 35, '2021-09-17 09:27:55', '2021-09-17 09:27:55', NULL), (93, 1, 'COMM', 36, '2021-09-17 09:27:55', '2021-09-17 09:27:55', NULL), (94, 1, 'REPO', 37, '2021-09-17 09:27:55', '2021-09-17 09:27:55', NULL), (95, 1, 'USR', 38, '2021-09-17 09:27:55', '2021-09-17 09:27:55', NULL), (96, 1, 'CONT', 39, '2021-09-17 09:27:55', '2021-09-17 09:27:55', NULL), (97, 1, 'PAY', 40, '2021-09-17 09:27:56', '2021-09-17 09:27:56', NULL), (98, 1, 'NEWS', 41, '2021-09-17 09:27:56', '2021-09-17 09:27:56', NULL), (99, 1, 'NEWS', 42, '2021-09-17 09:27:56', '2021-09-17 09:27:56', NULL), (100, 1, 'NEWS', 43, '2021-09-17 09:27:56', '2021-09-17 09:27:56', NULL), (101, 1, 'NEWS', 44, '2021-09-17 09:27:56', '2021-09-17 09:27:56', NULL), (109, 3, 'REPO', 37, '2021-10-08 17:04:58', '2021-10-08 17:04:58', NULL), (110, 3, 'CONT', 39, '2021-10-08 17:04:58', '2021-10-08 17:04:58', NULL), (111, 3, 'PAY', 40, '2021-10-08 17:04:58', '2021-10-08 17:04:58', NULL); -- -------------------------------------------------------- -- -- Table structure for table `sliders` -- CREATE TABLE `sliders` ( `id` int(11) NOT NULL, `title` varchar(50) NOT NULL, `image` varchar(100) NOT NULL, `description` text NOT NULL, `uploader` int(11) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `threads` -- CREATE TABLE `threads` ( `id` int(11) NOT NULL, `subject` varchar(100) NOT NULL, `creator` int(11) NOT NULL, `visibility` int(11) NOT NULL COMMENT '0 for all and other numbers will be the role', `link` varchar(255) NOT NULL, `status` char(1) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `first_name` varchar(50) NOT NULL, `middle_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(60) NOT NULL, `email` varchar(50) NOT NULL, `gender` varchar(6) NOT NULL, `profile_pic` varchar(100) NOT NULL, `payment_method` int(11) DEFAULT NULL, `proof` varchar(100) NOT NULL, `birthdate` date NOT NULL, `contact_number` decimal(11,0) NOT NULL, `email_code` varchar(10) NOT NULL, `role` bigint(20) NOT NULL DEFAULT 0, `type` enum('1','2','3','') NOT NULL COMMENT '1 for regular, 2 for part time, 3 for admin', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0: unpaid\r\n1: active\r\n2: inactive\r\n3: paid\r\n4: pending email verification', `created_at` datetime NOT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `first_name`, `middle_name`, `last_name`, `username`, `password`, `email`, `gender`, `profile_pic`, `payment_method`, `proof`, `birthdate`, `contact_number`, `email_code`, `role`, `type`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'admin', '', 'admin', 'admin', '$2y$10$1xnbQsX2OX.Sp10pWrte9.hZ3BMiXrrBU6ZypOk2iDygwBf4UQqBS', '<EMAIL>', 'Male', 'admin.png', NULL, '', '1999-11-03', '9195252973', '', 1, '1', 1, '2021-08-30 09:03:20', NULL, NULL), (2, 'Treasurer', '', 'Account', 'treasurer', '$2y$10$WsTfJp/05oCT.RBYBKZVL.9vi15NZqFLZyyRbFOCRJBFqgD.6Ljay', '<EMAIL>', 'Female', '1633626748_d31335bd7ebe86237f66.png', 1, '1633626772_3f6d467334a906eebb79.jpg', '1997-07-02', '9123123123', '', 0, '1', 3, '2021-10-08 01:12:28', '2021-10-08 01:12:52', NULL), -- -------------------------------------------------------- -- -- Table structure for table `votes` -- CREATE TABLE `votes` ( `id` int(11) NOT NULL, `election_id` int(11) NOT NULL, `voters_id` int(11) NOT NULL, `date_casted` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `votes2` -- CREATE TABLE `votes2` ( `id` int(11) NOT NULL, `voter_id` int(11) NOT NULL, `election_id` int(11) NOT NULL, `date_casted` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `vote_details` -- CREATE TABLE `vote_details` ( `id` int(11) NOT NULL, `votes_id` int(11) NOT NULL, `position_id` int(11) NOT NULL, `candidate_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `vote_details2` -- CREATE TABLE `vote_details2` ( `id` int(11) NOT NULL, `votes_id` int(11) NOT NULL, `user_id` int(11) DEFAULT NULL, `user_type` enum('1','2','3') DEFAULT NULL, `position_id` int(11) DEFAULT NULL, `candidate_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `activity_log` -- ALTER TABLE `activity_log` ADD PRIMARY KEY (`id`); -- -- Indexes for table `announcements` -- ALTER TABLE `announcements` ADD PRIMARY KEY (`id`); -- -- Indexes for table `candidates` -- ALTER TABLE `candidates` ADD PRIMARY KEY (`id`); -- -- Indexes for table `comments` -- ALTER TABLE `comments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `constitutions` -- ALTER TABLE `constitutions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `contributions` -- ALTER TABLE `contributions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `elections` -- ALTER TABLE `elections` ADD PRIMARY KEY (`id`); -- -- Indexes for table `electoral_positions` -- ALTER TABLE `electoral_positions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `file_sharing` -- ALTER TABLE `file_sharing` ADD PRIMARY KEY (`id`); -- -- Indexes for table `logins` -- ALTER TABLE `logins` ADD PRIMARY KEY (`id`); -- -- Indexes for table `news` -- ALTER TABLE `news` ADD PRIMARY KEY (`id`); -- -- Indexes for table `officers` -- ALTER TABLE `officers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `payments` -- ALTER TABLE `payments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `payment_feedbacks` -- ALTER TABLE `payment_feedbacks` ADD PRIMARY KEY (`id`); -- -- Indexes for table `payment_methods` -- ALTER TABLE `payment_methods` ADD PRIMARY KEY (`id`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `positions` -- ALTER TABLE `positions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `role_permissions` -- ALTER TABLE `role_permissions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `sliders` -- ALTER TABLE `sliders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `threads` -- ALTER TABLE `threads` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `votes` -- ALTER TABLE `votes` ADD PRIMARY KEY (`id`); -- -- Indexes for table `votes2` -- ALTER TABLE `votes2` ADD PRIMARY KEY (`id`); -- -- Indexes for table `vote_details` -- ALTER TABLE `vote_details` ADD PRIMARY KEY (`id`); -- -- Indexes for table `vote_details2` -- ALTER TABLE `vote_details2` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `activity_log` -- ALTER TABLE `activity_log` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `announcements` -- ALTER TABLE `announcements` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `candidates` -- ALTER TABLE `candidates` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `comments` -- ALTER TABLE `comments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `constitutions` -- ALTER TABLE `constitutions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `contributions` -- ALTER TABLE `contributions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `elections` -- ALTER TABLE `elections` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `electoral_positions` -- ALTER TABLE `electoral_positions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `file_sharing` -- ALTER TABLE `file_sharing` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `logins` -- ALTER TABLE `logins` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `news` -- ALTER TABLE `news` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `officers` -- ALTER TABLE `officers` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `payments` -- ALTER TABLE `payments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `payment_feedbacks` -- ALTER TABLE `payment_feedbacks` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `payment_methods` -- ALTER TABLE `payment_methods` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45; -- -- AUTO_INCREMENT for table `positions` -- ALTER TABLE `positions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `role_permissions` -- ALTER TABLE `role_permissions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=112; -- -- AUTO_INCREMENT for table `sliders` -- ALTER TABLE `sliders` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `threads` -- ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `votes` -- ALTER TABLE `votes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `votes2` -- ALTER TABLE `votes2` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `vote_details` -- ALTER TABLE `vote_details` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `vote_details2` -- ALTER TABLE `vote_details2` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>georgeMatrix/nuestroNegocio /* Navicat MySQL Data Transfer Source Server : localhost2018 Source Server Version : 100136 Source Host : localhost:3306 Source Database : nuestronegocio Target Server Type : MYSQL Target Server Version : 100136 File Encoding : 65001 Date: 2019-02-20 10:44:49 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for salon_fiestas -- ---------------------------- DROP TABLE IF EXISTS `salon_fiestas`; CREATE TABLE `salon_fiestas` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `telefono` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `direccion` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `imagen` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `maps` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of salon_fiestas -- ---------------------------- INSERT INTO `salon_fiestas` VALUES ('1', '<NAME>', '01 55 6416 6237', 'Av. Francisco I. Madero 269, Centro, 54880 Melchor Ocampo, Méx.', 'negocio/images/tezontle.jpg', 'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d664.045555391062!2d-99.14762594130137!3d19.695207110558854!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0xba223467f7b05246!2sSalon+Tezontle!5e0!3m2!1ses!2smx!4v1550617332219', '2019-02-14 17:46:29', '2019-02-14 17:46:29'); INSERT INTO `salon_fiestas` VALUES ('2', 'En construccion', '293-963-6159', '920 Kamille Port\nMoorestad, IN 53888-5916', '<NAME>', 'Anya Rice', '2019-02-14 17:46:29', '2019-02-14 17:46:29'); INSERT INTO `salon_fiestas` VALUES ('3', 'En construccion', '1-601-277-7998 x68589', '584 Heller Plains Suite 861\nOberbrunnerhaven, WV 32592', '<NAME>', 'Prof. <NAME>', '2019-02-14 17:46:29', '2019-02-14 17:46:29'); INSERT INTO `salon_fiestas` VALUES ('4', 'En construccion', '(242) 970-0510 x17723', '4394 Brannon Isle\nLake Angie, GA 29117-7906', 'Rh<NAME>unsch', '<NAME>', '2019-02-14 17:46:29', '2019-02-14 17:46:29'); INSERT INTO `salon_fiestas` VALUES ('5', 'En construccion', '712-449-0994', '415 Elenor Corner\nSchoenstad, ND 10294', '<NAME>', '<NAME>', '2019-02-14 17:46:29', '2019-02-14 17:46:29');
SELECT * FROM public.event_log ORDER BY id DESC LIMIT 250
SELECT * FROM pg_catalog.pg_extension WHERE extname = '#{name}';
<gh_stars>1-10 --liquibase formatted sql --changeset artemov_i:MTClassList.sql dbms:postgresql runOnChange:true splitStatements:false stripComments:false INSERT INTO s_mt.t_query (ck_id, cc_query, ck_provider, ck_user, ct_change, cr_type, cr_access, cn_action, cv_description) VALUES ('MTClassList', '/*MTClassList*/ select c.ck_id, c.cv_name from s_mt.t_class c left join s_mt.t_module_class mc on c.ck_id = mc.ck_class left join s_mt.t_module m on m.ck_id = mc.ck_module where coalesce(m.cl_available, 1) = 1 order by c.cv_name asc ', 'meta', '20783', '2019-05-27 09:42:20.922637+03', 'select', 'po_session', NULL, 'Необходимо актуализировать') on conflict (ck_id) do update set cc_query = excluded.cc_query, ck_provider = excluded.ck_provider, ck_user = excluded.ck_user, ct_change = excluded.ct_change, cr_type = excluded.cr_type, cr_access = excluded.cr_access, cn_action = excluded.cn_action, cv_description = excluded.cv_description;
-- +migrate Up CREATE TABLE dockmon_liveness_target ( service_name VARCHAR(250) PRIMARY KEY, liveness_url VARCHAR(250), liveness_interval INTEGER, should_restart BOOLEAN, fail_after INTEGER, is_healty BOOLEAN, number_of_restarts INTEGER, consecutive_failed_health_checks INTEGER, last_restarted TIMESTAMP, last_health_success TIMESTAMP, last_health_failure TIMESTAMP, created_at TIMESTAMP );
select username from users;
<filename>employeesDB.sql DROP DATABASE IF EXISTS employees_db; CREATE DATABASE employees_db; USE employees_db; CREATE TABLE employee ( id INT NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, role_id INT NOT NULL, manager_id INT NULL, PRIMARY KEY (id), ); CREATE TABLE roles ( id INT NOT NULL AUTO_INCREMENT, title VARCHAR(30) NOT NULL, salary DEC(10) NOT NULL, department_id INT NOT NULL, PRIMARY KEY (id) ); CREATE TABLE departments ( id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(30) NOT NULL, PRIMARY KEY (id) ); INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES ("Payton", "Whinnery", 7, 2), ("Rachel", "Amos", 4, 3), ("Caroline", "Miller", 3, 1), ("Jackie", "Hodges", 2, 2), ("Molly", "Gilbert", 1, NULL), ("Walter", "Perry", 5, NULL), ("Natalie", "Guidry", 6, NULL), ("Nina", "Whinnery", 7, 2); INSERT INTO roles (title, salary, department_id) VALUES ("Sales Lead", 130000, 1), ("Salesperson", 100000, 1), ("Lead Engineer", 150000, 2), ("Software Engineer", 150000, 2), ("Accountant", 120000, 3), ("Legal Team Lead", 150000, 4), ("Lawyer", 160000, 4); INSERT INTO departments (department_name) VALUES ("Sales"), ("Engineering"), ("Finance"), ("Legal");
<reponame>arshiya2125/crowdsource-dataplatform<gh_stars>10-100 /* Replace with your SQL commands */ DROP MATERIALIZED VIEW IF EXISTS gender_group_contributions; DROP MATERIALIZED VIEW IF EXISTS age_group_contributions; DROP MATERIALIZED VIEW IF EXISTS language_group_contributions; DROP MATERIALIZED VIEW IF EXISTS state_group_contributions; DROP MATERIALIZED VIEW IF EXISTS language_and_state_group_contributions;
<gh_stars>1-10 -- Add migration script here CREATE TYPE USER_ROLE AS ENUM ('user', 'admin'); -- Create User Table CREATE TABLE user_account ( id uuid NOT NULL PRIMARY KEY, email TEXT NOT NULL UNIQUE, password TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL, role USER_ROLE NOT NULL );
<reponame>rutschsr/Senior-Design-Project<filename>Sqlite/Search/Avg_Query_PC_local_to_PI_Peter_Jamieson_double_bmp.sql<gh_stars>1-10 -- For PC local to PI <NAME> double bmp -- The average of the ping current values, this will be the second value displayed SELECT avg(wattage) FROM PowerMeasurement WHERE strftime('%H %M %S %f', date) BETWEEN strftime('%H %M %S %f', '2022-03-15 17:24:45.370065') AND strftime('%H %M %S %f', '2022-03-15 17:25:30.768425') OR strftime('%H %M %S %f', date) BETWEEN strftime('%H %M %S %f', '2022-03-15 17:25:41.298329') AND strftime('%H %M %S %f', '2022-03-15 17:26:28.596775') OR strftime('%H %M %S %f', date) BETWEEN strftime('%H %M %S %f', '2022-03-15 17:26:32.913814') AND strftime('%H %M %S %f', '2022-03-15 17:27:19.351443') OR strftime('%H %M %S %f', date) BETWEEN strftime('%H %M %S %f', '2022-03-15 17:27:25.208667') AND strftime('%H %M %S %f', '2022-03-15 17:28:09.206471') OR strftime('%H %M %S %f', date) BETWEEN strftime('%H %M %S %f', '2022-03-15 17:28:12.315223') AND strftime('%H %M %S %f', '2022-03-15 17:28:57.343768') UNION -- The average of the nonping current values, this will be the first value displayed SELECT avg(wattage) FROM PowerMeasurement WHERE strftime('%H %M %S %f', date) NOT BETWEEN strftime('%H %M %S %f', '2022-03-15 17:24:45.370065') AND strftime('%H %M %S %f', '2022-03-15 17:25:30.768425') OR strftime('%H %M %S %f', date) NOT BETWEEN strftime('%H %M %S %f', '2022-03-15 17:25:41.298329') AND strftime('%H %M %S %f', '2022-03-15 17:26:28.596775') OR strftime('%H %M %S %f', date) NOT BETWEEN strftime('%H %M %S %f', '2022-03-15 17:26:32.913814') AND strftime('%H %M %S %f', '2022-03-15 17:27:19.351443') OR strftime('%H %M %S %f', date) NOT BETWEEN strftime('%H %M %S %f', '2022-03-15 17:27:25.208667') AND strftime('%H %M %S %f', '2022-03-15 17:28:09.206471') OR strftime('%H %M %S %f', date) NOT BETWEEN strftime('%H %M %S %f', '2022-03-15 17:28:12.315223') AND strftime('%H %M %S %f', '2022-03-15 17:28:57.343768');
<gh_stars>1-10 /* https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. The sum of the number of all objects in a database cannot exceed 2,147,483,647. */ CREATE DATABASE [TwoMillion]; ALTER DATABASE [TwoMillion] SET RECOVERY SIMPLE WITH NO_WAIT; GO USE [TwoMillion]; SET NOCOUNT ON; DECLARE @sql nvarchar(max) = N''; DECLARE @i int = 1; SELECT @i = 2147483647 - COUNT(*) FROM [TwoMillion].sys.objects; PRINT N'Creating ' + FORMAT(@i,'N0') + N' tables...'; WHILE @i > 0 BEGIN SET @i -= 1; SET @sql = N'CREATE TABLE [TwoMillion].dbo.t' + CONVERT(nvarchar(max),2147483648-@i) + N' (i int);'; IF (@i % 10000) = 0 RAISERROR(@sql, 0, 1) WITH NOWAIT; EXEC sp_executesql @sql; END; /* ALTER DATABASE [TwoMillion] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO USE master; GO DROP DATABASE [TwoMillion]; */
-- randexpr1.test -- -- db eval {SELECT ~case 17 when t1.c then coalesce((select max((case when not exists(select 1 from t1 where 11<>coalesce((select d from t1 where not exists(select 1 from t1 where c*b in (t1.b*t1.d,t1.c,b) or c between d and a)),19)-t1.c*e) then coalesce((select f from t1 where 11 in (select c from t1 union select b from t1)),(c)) when 17<>t1.b then d else 19 end)) from t1 where f in (a,t1.f,t1.d)),(19)) else t1.e end FROM t1 WHERE not not exists(select 1 from t1 where (select abs(min(19-19))*count(*) | min(13)*min((a))+cast(avg(t1.e) AS integer)+(cast(avg(19) AS integer)) from t1) in (17,+(select min(b) from t1),(select cast(avg(f) AS integer) from t1)) and 11 in (select ( -(min(c))) from t1 union select (min(13)) from t1)) or t1.d between c and -(f) or not t1.c in (select min(e) from t1 union select -(max(e)) from t1) and t1.e in (t1.f,a,11) and f not between a and 17 and 19<=17 and 13 not in (b,t1.b,13)} SELECT ~case 17 when t1.c then coalesce((select max((case when not exists(select 1 from t1 where 11<>coalesce((select d from t1 where not exists(select 1 from t1 where c*b in (t1.b*t1.d,t1.c,b) or c between d and a)),19)-t1.c*e) then coalesce((select f from t1 where 11 in (select c from t1 union select b from t1)),(c)) when 17<>t1.b then d else 19 end)) from t1 where f in (a,t1.f,t1.d)),(19)) else t1.e end FROM t1 WHERE not not exists(select 1 from t1 where (select abs(min(19-19))*count(*) | min(13)*min((a))+cast(avg(t1.e) AS integer)+(cast(avg(19) AS integer)) from t1) in (17,+(select min(b) from t1),(select cast(avg(f) AS integer) from t1)) and 11 in (select ( -(min(c))) from t1 union select (min(13)) from t1)) or t1.d between c and -(f) or not t1.c in (select min(e) from t1 union select -(max(e)) from t1) and t1.e in (t1.f,a,11) and f not between a and 17 and 19<=17 and 13 not in (b,t1.b,13)
<gh_stars>1-10 -- CreateTable CREATE TABLE "User" ( "id" SERIAL NOT NULL, "email" TEXT NOT NULL, "firstname" TEXT, "lastname" TEXT, "languages_by_name" TEXT[], "languages_by_id" INT[], CONSTRAINT "User_pkey" PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "Language" ( "id" SERIAL NOT NULL, "name" TEXT NOT NULL, CONSTRAINT "Language_pkey" PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "User_to_language" ( "user_id" INT NOT NULL, "language_id" INT NOT NULL, CONSTRAINT "User_to_language_pkey" PRIMARY KEY ("user_id", "language_id") ); -- AddForeignKey ALTER TABLE "User_to_language" ADD CONSTRAINT "User_to_language_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE "User_to_language" ADD CONSTRAINT "User_to_language_language_id_fkey" FOREIGN KEY ("language_id") REFERENCES "Language"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
SET @sName = 'bx_lucid'; -- MIXES SET @iMixId = (SELECT `id` FROM `sys_options_mixes` WHERE `type`=@sName AND `name`='Light-Mix' LIMIT 1); UPDATE `sys_options_mixes2options` SET `value`='1.0rem' WHERE `option`='bx_lucid_menu_account_font_size' AND `mix_id`=@iMixId; UPDATE `sys_options_mixes2options` SET `value`='1.0rem' WHERE `option`='bx_lucid_menu_main_font_size' AND `mix_id`=@iMixId; UPDATE `sys_options_mixes2options` SET `value`='div.bx-market-unit-cover div.bx-base-text-unit-no-thumb {\r\n border-width: 0px;\r\n}\r\n.bx-menu-object-UNA-Submenu {\r\nline-height: 3rem;\r\n height: 2.5rem;\r\n}\r\nbody .bx-menu-object-UNA-Submenu .sys-icon {\r\nvertical-align:bottom;\r\n}\r\n\r\n/*--- Menus ---*/\r\n.bx-popup .bx-menu-ver li,\r\n.bx-popup .bx-menu-custom-ver li,\r\n.bx-menu-floating-blocks li {\r\nborder-radius: 0.25rem;\r\nfont-size: 0.875rem;\r\nfont-weight: 600;\r\n}\r\n\r\n.bx-popup .bx-menu-ver li a,\r\n.bx-popup .bx-menu-ver li a .sys-icon,\r\n.bx-popup .bx-menu-custom-ver li a,\r\n.bx-popup .bx-menu-custom-ver li a .sys-icon,\r\n.bx-menu-floating-blocks li a,\r\n.bx-menu-floating-blocks li a .sys-icon:not(.sys-colored) {\r\ncolor: rgba(60, 80, 90, 0.8);\r\n}\r\n.bx-menu-floating-blocks li a:hover,\r\n.bx-menu-floating-blocks li a:hover .sys-icon,\r\n.bx-popup .bx-menu-ver li a:hover,\r\n.bx-popup .bx-menu-ver li a:hover .sys-icon,\r\n.bx-popup .bx-menu-custom-ver li a:hover,\r\n.bx-popup .bx-menu-custom-ver li a:hover .sys-icon,\r\n.bx-menu-custom.bx-menu-custom-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item a:hover {\r\ncolor: rgba(64, 169, 255, 1);\r\n}\r\n\r\n/*--- Auto More Menus ---*/\r\n.bx-menu-main-submenu.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item .bx-btn,\r\n.bx-menu-custom.bx-menu-custom-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item a,\r\n.bx-menu-custom.bx-menu-custom-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item .bx-btn {\r\nfont-weight: 600;\r\ncolor: rgba(60, 80, 90, 0.8);\r\n}\r\n\r\n/*--- Froala ---*/\r\n.bx-form-value .bx-form-input-wrapper-textarea.bx-form-input-wrapper-html {\r\n -webkit-box-sizing: border-box;\r\n -moz-box-sizing: border-box;\r\n -ms-box-sizing: border-box;\r\n box-sizing: border-box;\r\n border: 1px solid rgba(50, 100, 180, 0.2);\r\n-webkit-border-radius: 4px;\r\n -moz-border-radius: 4px;\r\n border-radius: 4px;\r\nbackground-clip: padding-box;\r\nbackground-color: rgba(255, 255, 255, 0.9);\r\n -webkit-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0);\r\n -moz-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0);\r\n box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0);\r\n}\r\n.bx-form-input-wrapper-textarea:not(.fr-fullscreen-wrapper) .fr-box.fr-basic .fr-toolbar,\r\n.bx-form-input-wrapper-textarea:not(.fr-fullscreen-wrapper) .fr-box.fr-basic .fr-wrapper,\r\n.bx-form-input-wrapper-textarea:not(.fr-fullscreen-wrapper) .fr-box.fr-basic .second-toolbar {\r\nborder-width: 0;\r\nbackground-color: transparent;\r\n}\r\n.bx-form-input-wrapper-textarea .fr-box.fr-basic .fr-wrapper .fr-element, \r\n.bx-form-input-wrapper-textarea .fr-box.fr-basic .fr-wrapper .fr-placeholder {\r\npadding-top: 0;\r\npadding-bottom: 0;\r\n}' WHERE `option`='bx_lucid_styles_custom' AND `mix_id`=@iMixId;
{# # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2017, The pgAdmin Development Team # This software is released under the PostgreSQL Licence #} SELECT ct.conindid AS oid FROM pg_constraint ct WHERE contype='x' AND ct.conname = {{ name|qtLiteral }};
-- ------------------------------------------------------------------ -- Title: Quick Sequential Organ Failure Assessment (qSOFA) -- This query extracts the quick sequential organ failure assessment. -- This score was a recent revision of SOFA, aiming to detect patients at risk of sepsis. -- The score is calculated on the first day of each ICU patients' stay - though needn't be. -- ------------------------------------------------------------------ -- Reference for qSOFA: -- <NAME>, et al. The Third International Consensus Definitions for Sepsis and Septic Shock (Sepsis-3) -- Seymour CW, et al. Assessment of Clinical Criteria for Sepsis: For the Third International Consensus Definitions for Sepsis and Septic Shock (Sepsis-3) -- Variables used in qSOFA: -- GCS, respiratory rate, systolic blood pressure -- The following views required to run this query: -- 1) gcsfirstday - generated by gcs-first-day.sql -- 2) vitalsfirstday - generated by vitals-first-day.sql -- Note: -- The score is calculated for *all* ICU patients, with the assumption that the user will subselect appropriate ICUSTAY_IDs. -- For example, the score is calculated for neonates, but it is likely inappropriate to actually use the score values for these patients. with scorecomp as ( select ie.icustay_id , v.sysbp_min , v.resprate_max , gcs.mingcs FROM `physionet-data.mimiciii_clinical.icustays` ie left join `physionet-data.mimiciii_clinical.vitals_first_day` v on ie.icustay_id = v.icustay_id left join `physionet-data.mimiciii_clinical.gcs_first_day` gcs on ie.icustay_id = gcs.icustay_id ) , scorecalc as ( -- Calculate the final score -- note that if the underlying data is missing, the component is null -- eventually these are treated as 0 (normal), but knowing when data is missing is useful for debugging select icustay_id , case when sysbp_min is null then null when sysbp_min <= 100 then 1 else 0 end as sysbp_score , case when mingcs is null then null when mingcs <= 13 then 1 else 0 end as gcs_score , case when resprate_max is null then null when resprate_max >= 22 then 1 else 0 end as resprate_score from scorecomp ) select ie.subject_id, ie.hadm_id, ie.icustay_id , coalesce(sysbp_score,0) + coalesce(gcs_score,0) + coalesce(resprate_score,0) as qsofa , sysbp_score , gcs_score , resprate_score FROM `physionet-data.mimiciii_clinical.icustays` ie left join scorecalc s on ie.icustay_id = s.icustay_id order by ie.icustay_id;
<gh_stars>0 USE chiyo; -- DROP VIEWS ------------------------------------------------- DROP VIEW IF EXISTS vusers; -- DROP TABLES ------------------------------------------------ DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS roles; -- CREATE TABLES ---------------------------------------------- CREATE TABLE roles ( ID int(11) NOT NULL AUTO_INCREMENT, NAME varchar(45) NOT NULL, PRIMARY KEY (ID) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; CREATE TABLE users ( ID int(11) NOT NULL AUTO_INCREMENT, NAME varchar(45) NOT NULL, HASH varchar(45) NOT NULL, ROLE_ID int(11) NOT NULL, PRIMARY KEY (ID), UNIQUE KEY name_UNIQUE (NAME) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- CREATE VIEWS ----------------------------------------------- CREATE VIEW vusers AS SELECT u.ID USER_ID, u.NAME USER_NAME, r.ID ROLE_ID, r.NAME ROLE_NAME FROM users u, roles r WHERE u.ROLE_ID = r.ID ; -- INSERT DATA ------------------------------------------------ -- roles INSERT INTO roles (ID, NAME) values (1, 'Admin'), (2, 'Default') ; -- users INSERT INTO users (ID, NAME, HASH, ROLE_ID) values (1, 'admin', sha1(concat('BPKeL*Eh@qtpA4t', 'admin')), 1), (2, 'user', sha1(concat('BPKeL*Eh@qtpA4t', 'user')), 2) ;
<reponame>umpyre-code/beancounter CREATE TABLE transactions ( id BIGSERIAL PRIMARY KEY, created_at TIMESTAMP NOT NULL DEFAULT NOW(), client_id UUID, tx_type TRANSACTION_TYPE NOT NULL, tx_reason TRANSACTION_REASON NOT NULL, amount_cents INTEGER NOT NULL)
create database digital_breakthrough; create schema dwh; create table dwh.dim_calendar ( date_id serial not null, date_value date null, day_num int4 null, month_num int4 null, year_num int4 null, month_name varchar(20) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_calendar_pkey primary key (date_id) ); create table dwh.dim_citizenship ( citizenship_id serial not null, citizenship_name varchar(200) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_citizenship_pkey primary key (citizenship_id) ); create table dwh.dim_education_level ( education_level_id serial not null, education_level_name varchar(200) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_education_level_pkey primary key (education_level_id) ); create table dwh.dim_family_cathegory ( family_cathegory_id serial not null, family_cathegory_name varchar(300) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_family_cathegory_pkey primary key (family_cathegory_id) ); create table dwh.dim_forms_of_study ( form_of_study_id serial not null, forms_of_study_name varchar(100) null, education_system varchar(100) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), form_of_study_type varchar(50) null, constraint dim_forms_of_study_pkey primary key (form_of_study_id) ); create table dwh.dim_region ( region_id serial not null, region_name varchar(100) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_region_pkey primary key (region_id) ); create table dwh.dim_sports_type ( sport_type_id serial not null, sports_type_name varchar(100) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_sports_type_pkey primary key (sport_type_id) ); create table dwh.dim_tomsk_regions ( tomsk_region_id serial not null, tomsk_region_name varchar(100) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_tomsk_regions_pkey primary key (tomsk_region_id) ); create table dwh.dim_training_direction ( training_direction_id serial not null, training_direction_name varchar(300) null, training_direction_month_qnt int4 null, profession_name varchar(300) null, ok_profession_name varchar(300) null, req_education varchar(100) null, training_direction_type varchar(50) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_training_direction_pkey primary key (training_direction_id) ); create table dwh.fct_address ( address_id serial not null, city_name varchar(300) null, street_name varchar(400) null, house_number varchar(20) null, building_name varchar(20) null, housing_name varchar(20) null, city_region varchar(200) null, constraint fct_address_pkey primary key (address_id) ); create table dwh.fct_creative_achievements_name ( creative_achievements_id serial not null, creative_achievements_name varchar(300) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint fct_creative_achievements_name_pkey primary key (creative_achievements_id) ); create table dwh.is_users ( is_user_id serial not null, user_login varchar(100) null, user_password varchar(100) null, constraint is_users_pkey primary key (is_user_id) ); create table dwh.dep_employees ( dep_employee_id serial not null, employee_first_name varchar(200) null, employee_second_name varchar(200) null, employee_surname varchar(200) null, mobile_phone varchar(30) null, registration_dttm timestamptz null, is_user_id int4 null, constraint dep_employees_pkey primary key (dep_employee_id), constraint dep_employees_is_user_id_fkey foreign key (is_user_id) references dwh.is_users(is_user_id) ); create table dwh.dim_acceptance_applications_dt ( acceptance_application_dt_id serial not null, start_acceptance_applications_dttm timestamp null, end_acceptance_applications_dttm timestamp null, form_of_study_id int4 null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_acceptance_applications_dt_pkey primary key (acceptance_application_dt_id), constraint dim_acceptance_applications_dt_form_of_study_id_fkey foreign key (form_of_study_id) references dwh.dim_forms_of_study(form_of_study_id) ); create table dwh.dim_tomsk_cities ( tomsk_city_id serial not null, tomsk_region_id int4 null, tomsk_city_name varchar(100) null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_tomsk_cities_pkey primary key (tomsk_city_id), constraint dim_tomsk_cities_tomsk_region_id_fkey foreign key (tomsk_region_id) references dwh.dim_tomsk_regions(tomsk_region_id) ); create table dwh.fct_enrollee ( enrollee_id serial not null, enrollee_first_name varchar(200) null, enrollee_second_name varchar(200) null, enrollee_surname varchar(200) null, birthday_dt date null, birth_place int4 null, citizenship_id int4 null, address_id int4 null, mobile_phone_number varchar(30) null, home_phone_number varchar(30) null, email varchar(100) null, dormitory_need bool null, family_cathegory_id int4 null, first_enrollee_spo bool null, orphan bool null, disabled bool null, signature_photo_path varchar(200) null, student bool null, constraint fct_enrollee_pkey primary key (enrollee_id), constraint fct_enrollee_address_id_fkey foreign key (address_id) references dwh.fct_address(address_id), constraint fct_enrollee_birth_place_fkey foreign key (birth_place) references dwh.fct_address(address_id), constraint fct_enrollee_citizenship_id_fkey foreign key (citizenship_id) references dwh.dim_citizenship(citizenship_id), constraint fct_enrollee_family_cathegory_id_fkey foreign key (family_cathegory_id) references dwh.dim_family_cathegory(family_cathegory_id) ); create table dwh.fct_enrollee_parents_info ( enrollee_parent_info_id serial not null, enrollee_id int4 null, parent_first_name varchar(200) null, parent_second_name varchar(200) null, parent_surname varchar(200) null, address_id int4 null, work_place_name varchar(300) null, work_position varchar(300) null, mobile_phone_number varchar(30) null, email varchar(100) null, constraint fct_enrollee_parents_info_pkey primary key (enrollee_parent_info_id), constraint fct_enrollee_parents_info_address_id_fkey foreign key (address_id) references dwh.fct_address(address_id), constraint fct_enrollee_parents_info_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id) ); create table dwh.fct_sports_achievements ( sports_achievements_id serial not null, enrollee_id int4 null, sport_type_id int4 null, supporting_doc_name varchar(400) null, constraint fct_sports_achievements_pkey primary key (sports_achievements_id), constraint fct_sports_achievements_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id), constraint fct_sports_achievements_sport_type_id_fkey foreign key (sport_type_id) references dwh.dim_sports_type(sport_type_id) ); create table dwh.dim_organizations_and_branches ( org_id serial not null, org_name varchar(300) null, org_dsc varchar(500) null, tomsk_city_id int4 null, eff_dttm timestamptz null DEFAULT now(), exp_dttm timestamptz null DEFAULT '2999-12-31 00:00:00+03'::timestamp with time zone, load_dttm timestamptz null DEFAULT now(), constraint dim_organizations_and_branches_pkey primary key (org_id), constraint dim_organizations_and_branches_tomsk_city_id_fkey foreign key (tomsk_city_id) references dwh.dim_tomsk_cities(tomsk_city_id) ); create table dwh.dim_passport ( passport_id serial not null, p_series varchar(4) null, p_number varchar(6) null, issue_dt date null, issue_place varchar(150) null, enrollee_id int4 null, constraint dim_passport_pkey primary key (passport_id), constraint dim_passport_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id) ); create table dwh.fct_creative_achievements ( creative_achievement_id serial not null, enrollee_id int4 null, creative_achievements_id int4 null, supporting_doc_name varchar(400) null, constraint fct_creative_achievements_pkey primary key (creative_achievement_id), constraint fct_creative_achievements_creative_achievements_id_fkey foreign key (creative_achievements_id) references dwh.fct_creative_achievements_name(creative_achievements_id), constraint fct_creative_achievements_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id) ); create table dwh.fct_documents_acceptance ( document_acceptance_id serial not null, document_acceptance_dttm timestamptz null, original bool null, form_of_study_id int4 null, enrollee_id int4 null, certificate_avg_mark float4 null, training_direction_id int4 null, org_id int4 null, constraint fct_documents_acceptance_pkey primary key (document_acceptance_id), constraint fct_documents_acceptance_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id), constraint fct_documents_acceptance_fk foreign key (training_direction_id) references dwh.dim_training_direction(training_direction_id), constraint fct_documents_acceptance_fk2 foreign key (org_id) references dwh.dim_organizations_and_branches(org_id), constraint fct_documents_acceptance_form_of_study_id_fkey foreign key (form_of_study_id) references dwh.dim_forms_of_study(form_of_study_id) ); create table dwh.fct_education ( education_id serial not null, enrollee_id int4 null, education_place varchar(300) null, education_level_id int4 null, education_document varchar(300) null, english_edu bool null, target_direction bool null, constraint fct_education_pkey primary key (education_id), constraint fct_education_education_level_id_fkey foreign key (education_level_id) references dwh.dim_education_level(education_level_id), constraint fct_education_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id) ); create table dwh.fct_enr_achievements ( enr_achievement_id serial not null, olympiad_name varchar(300) null, winner bool null, prize_winner bool null, olympiad_level varchar(100) null, enrollee_id int4 null, constraint fct_enr_achievements_pkey primary key (enr_achievement_id), constraint fct_enr_achievements_enrollee_id_fkey foreign key (enrollee_id) references dwh.fct_enrollee(enrollee_id) ); create table dwh.fct_enrollment ( enrollment_id serial not null, document_acceptance_id int4 null, enrollment_dttm timestamptz null, constraint fct_enrollment_pkey primary key (enrollment_id), constraint fct_enrollment_document_acceptance_id_fkey foreign key (document_acceptance_id) references dwh.fct_documents_acceptance(document_acceptance_id) ); create table dwh.org_employees ( org_employee_id serial not null, org_id int4 null, employee_first_name varchar(200) null, employee_second_name varchar(200) null, employee_surname varchar(200) null, mobile_phone varchar(30) null, is_user_id int4 null, constraint org_employees_pkey primary key (org_employee_id), constraint org_employees_is_user_id_fkey foreign key (is_user_id) references dwh.is_users(is_user_id), constraint org_employees_org_id_fkey foreign key (org_id) references dwh.dim_organizations_and_branches(org_id) ); create or replace view dwh.big_rep as select extract('year' from fe.enrollment_dttm)::varchar(4) acc_year, doab.org_name, dtd.training_direction_name, count(case when fe2.orphan = true then fe2.orphan end) orphan, count(case when fe2.disabled = true then fe2.disabled end) disabled, count(case when fsa.enrollee_id is not null then fe.enrollment_id end) sport_ach from dwh.fct_enrollment fe left join dwh.fct_documents_acceptance fda on fda.document_acceptance_id = fe.document_acceptance_id left join dwh.fct_enrollee fe2 on fe2.enrollee_id = fda.enrollee_id left join dwh.dim_training_direction dtd on dtd.training_direction_id = fda.training_direction_id left join dwh.dim_organizations_and_branches doab on doab.org_id = fda.org_id left join dwh.fct_creative_achievements fca on fca.enrollee_id = fe2.enrollee_id left join dwh.fct_sports_achievements fsa on fsa.enrollee_id = fe2.enrollee_id group by extract('year' from fe.enrollment_dttm), doab.org_name, dtd.training_direction_name order by extract('year' from fe.enrollment_dttm), doab.org_name, dtd.training_direction_name;
<reponame>zulus23/LogisticsService<gh_stars>0 SELECT p.dif_,p.datecreate_row,p.datePlan_Mnfg,p.DateActual_Ship,cust_name, COUNT(p.id) OVER(PARTITION BY p.cust_name,p.dat_,p.dif_), CAST(100.0* COUNT(p.id) OVER( PARTITION BY p.cust_name,p.dat_,p.dif_)/COUNT(p.id) OVER( PARTITION BY p.dat_,p.cust_num) AS NUMERIC(15,2)) AS procent , COUNT(p.id) OVER(PARTITION BY p.dat_,p.cust_name), p.dat_ FROM ( SELECT CASE WHEN ABS(DATEDIFF(DAY,r.datecreate_row,r.datePlan_Mnfg)) > 2 THEN 'Без отклонений' ELSE 'С отклонением' END AS dif_, DATEDIFF(DAY,r.datecreate_row,r.datePlan_Mnfg)AS t, CAST(CONVERT(CHAR(6),dateactual_ship,112)+'01'AS DATE) AS dat_,* FROM dbo.GTK_RPT_LOGIST r WHERE r.site = 'GOTEK' AND r.DatePlan_Ship BETWEEN '20160601' AND '20160815' --AND r.Cust_name = '"<NAME>" ООО' ) AS p SELECT DISTINCT dif_,DateActual_Ship,Cust_name,procent FROM( (SELECT p.dif_,p.datecreate_row,p.dat_ AS DateActual_Ship,'' AS cust_name, COUNT(p.id) OVER(PARTITION BY p.cust_name,p.dat_,p.dif_) AS p1, CAST(100.0* COUNT(p.id) OVER( PARTITION BY p.cust_name,p.dat_,p.dif_)/COUNT(p.id) OVER( PARTITION BY p.dat_,p.cust_num) AS NUMERIC(15,2)) AS procent , COUNT(p.id) OVER(PARTITION BY p.dat_,p.cust_name) AS p2, p.dat_ FROM ( SELECT CASE WHEN ABS(DATEDIFF(DAY,r.datecreate_row,r.datePlan_Mnfg)) > 2 THEN 'Без отклонений' ELSE 'С отклонением' END AS dif_, DATEDIFF(DAY,r.datecreate_row,r.datePlan_Mnfg)AS t, CAST(CONVERT(CHAR(6),dateactual_ship,112)+'01'AS DATE) AS dat_,* FROM dbo.GTK_RPT_LOGIST r WHERE r.site = 'GOTEK' AND r.DatePlan_Ship BETWEEN '20160601' AND '20160816' --AND r.Cust_name = '"<NAME>" ООО' ) AS p) ) AS allRecord SELECT p.dif_,p.datecreate_row,p.dat_ AS DateActual_Ship, cust_name, COUNT(p.id) OVER(PARTITION BY p.cust_name,p.dat_,p.dif_) AS p1, CAST(100.0* COUNT(p.id) OVER( PARTITION BY p.cust_name,p.dat_,p.dif_)/COUNT(p.id) OVER( PARTITION BY p.dat_,p.cust_num) AS NUMERIC(15,2)) AS procent , COUNT(p.id) OVER(PARTITION BY p.dat_,p.cust_name) AS p2, p.dat_ FROM ( SELECT CASE WHEN ABS(DATEDIFF(DAY,r.datecreate_row,r.datePlan_Mnfg)) > 2 THEN 'Без отклонений' ELSE 'С отклонением' END AS dif_, DATEDIFF(DAY,r.datecreate_row,r.datePlan_Mnfg)AS t, CAST(CONVERT(CHAR(6),dateactual_ship,112)+'01'AS DATE) AS dat_,* FROM dbo.GTK_RPT_LOGIST r WHERE r.site = 'GOTEK' AND r.DatePlan_Ship BETWEEN '20160601' AND '20160816' AND r.Cust_name like '%БЕЛАЯ ПТИЦА-БЕЛГОРОД ООО%' ) AS p
CREATE TABLE "CTAGENT_RELATIONSHIP" ( "AGENT_RELATIONSHIP" VARCHAR2(18 CHAR) NOT NULL ENABLE, CONSTRAINT "PKEY_CTAGENT_RELATIONSHIP" PRIMARY KEY ("AGENT_RELATIONSHIP") USING INDEX ENABLE )
BEGIN; ALTER TABLE operations ALTER COLUMN external_id TYPE VARCHAR(10000); COMMIT;
<reponame>democracy-denmark/democracy-webside CREATE TABLE `contact` ( `email` varchar(255) NOT NULL, `sex` varchar(1) DEFAULT NULL, `name_first` varchar(255) DEFAULT NULL, `name_last` varchar(255) DEFAULT NULL, `organization` varchar(255) DEFAULT NULL, `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Add up migration script here CREATE TYPE user_role AS ENUM ('admin', 'assistant', 'teacher', 'reviewer'); CREATE TABLE roles ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, user_id UUID NOT NULL REFERENCES users, organization_id UUID REFERENCES organizations, course_id UUID REFERENCES courses, role user_role NOT NULL );
<reponame>adrianmahjour/db2-samples --********************************************************************/ -- */ -- IBM InfoSphere Replication Server */ -- Version 9.7FP2 for Linux, UNIX AND Windows */ -- */ -- Sample SQL Replication migration script for UNIX AND NT */ -- Licensed Materials - Property of IBM */ -- */ -- (C) Copyright IBM Corp. 1993, 2010. All Rights Reserved */ -- */ -- US Government Users Restricted Rights - Use, duplication */ -- or disclosure restricted by GSA ADP Schedule Contract */ -- with IBM Corp. */ -- */ --********************************************************************/ -- Script to migrate Apply control tables from V97 to the latest fixpack -- -- 1) Locate and change all occurances of the string !apptablespace! -- to the name of the tablespace where the apply control tables -- are created. --*********************************************************** -- Segment to migrate SQL Apply to V97FP3 --*********************************************************** -- Start of V97FP3 --************************************************************ -- IBMSNAP_FEEDETL: CREATE TABLE ASN.IBMSNAP_FEEDETL (APPLY_QUAL CHAR(18) NOT NULL, SET_NAME CHAR(18) NOT NULL, MIN_SYNCHPOINT VARCHAR(16) FOR BIT DATA, MAX_SYNCHPOINT VARCHAR(16) FOR BIT DATA, DSX_CREATE_TIME TIMESTAMP NOT NULL, PRIMARY KEY ( APPLY_QUAL, SET_NAME)) IN !apptablespace!; --************************************************************ -- IBMSNAP_APPLYMON CREATE TABLE ASN.IBMSNAP_APPLYMON (MONITOR_TIME TIMESTAMP NOT NULL, APPLY_QUAL CHAR(18) NOT NULL, WHOS_ON_FIRST CHAR(1), STATE SMALLINT, CURRENT_SETNAME CHAR(18), CURRENT_TABOWNER VARCHAR(128), CURRENT_TABNAME VARCHAR(128) ) IN !apptablespace! ; CREATE INDEX ASN.IXIBMSNAP_APPLYMON ON ASN.IBMSNAP_APPLYMON( MONITOR_TIME, APPLY_QUAL, WHOS_ON_FIRST); --************************************************************ -- IBMSNAP_APPLYPARMS ALTER TABLE ASN.IBMSNAP_APPPARMS ADD COLUMN MONITOR_INTERVAL INT NOT NULL WITH DEFAULT 60000; ALTER TABLE ASN.IBMSNAP_APPPARMS ADD COLUMN MONITOR_ENABLED CHAR(1) NOT NULL WITH DEFAULT 'N'; -- IBMSNAP_SUBS_COLS: ALTER TABLE ASN.IBMSNAP_SUBS_COLS ALTER COLUMN TARGET_NAME SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_COLS ALTER COLUMN TARGET_OWNER SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_COLS ALTER COLUMN TARGET_NAME SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_COLS ALTER COLUMN EXPRESSION SET DATA TYPE VARCHAR(1024); -- IBMSNAP_SUBS_MEMBR: ALTER TABLE ASN.IBMSNAP_SUBS_MEMBR ALTER COLUMN LOADX_SRC_N_OWNER SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_MEMBR ALTER COLUMN SOURCE_OWNER SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_MEMBR ALTER COLUMN TARGET_OWNER SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_MEMBR ALTER COLUMN LOADX_SRC_N_OWNER SET DATA TYPE VARCHAR(128); -- IBMSNAP_SUBS_SET: ALTER TABLE ASN.IBMSNAP_SUBS_SET ALTER COLUMN CAPTURE_SCHEMA SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_SUBS_SET ALTER COLUMN TGT_CAPTURE_SCHEMA SET DATA TYPE VARCHAR(128); -- IBMSNAP_APPLYTRAIL: ALTER TABLE ASN.IBMSNAP_APPLYTRAIL ALTER COLUMN SOURCE_OWNER SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_APPLYTRAIL ALTER COLUMN TARGET_OWNER SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_APPLYTRAIL ALTER COLUMN CAPTURE_SCHEMA SET DATA TYPE VARCHAR(128); ALTER TABLE ASN.IBMSNAP_APPLYTRAIL ALTER COLUMN TGT_CAPTURE_SCHEMA SET DATA TYPE VARCHAR(128); -- End of V97FP3
------------------------------------------------------------------------------- -- -- PLEASE NOTE -- -- No warranty, no liability, no support. -- -- This script is 100% at your own risk to use. -- ------------------------------------------------------------------------------- SELECT substr(S.USERNAME,1,16) username, S.SID, L.TYPE, L.ID1, substr(o.object_name,1,22) name, DECODE(L.LMODE, 0, 'NONE', 1, 'NULL', 2, 'SS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', '?') mode1, DECODE(L.REQUEST, 0, 'NONE', 1, 'NULL', 2, 'SS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', '?') req, l.ctime, decode(l.block,0,null,'TRUE') block FROM V$LOCK L, V$SESSION S, dba_objects o WHERE L.SID=S.SID AND S.USERNAME is not null and l.id1 = o.object_id (+) order by s.sid
<filename>doc/activitidb.sql<gh_stars>100-1000 /* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50016 Source Host : localhost:3306 Source Database : activitidb0 Target Server Type : MYSQL Target Server Version : 50016 File Encoding : 65001 Date: 2014-12-22 16:06:03 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `act_evt_log` -- ---------------------------- DROP TABLE IF EXISTS `act_evt_log`; CREATE TABLE `act_evt_log` ( `LOG_NR_` bigint(20) NOT NULL auto_increment, `TYPE_` varchar(64) collate utf8_bin default NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `TIME_STAMP_` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `USER_ID_` varchar(255) collate utf8_bin default NULL, `DATA_` longblob, `LOCK_OWNER_` varchar(255) collate utf8_bin default NULL, `LOCK_TIME_` timestamp NULL default NULL, `IS_PROCESSED_` tinyint(4) default '0', PRIMARY KEY (`LOG_NR_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_evt_log -- ---------------------------- -- ---------------------------- -- Table structure for `act_ge_bytearray` -- ---------------------------- DROP TABLE IF EXISTS `act_ge_bytearray`; CREATE TABLE `act_ge_bytearray` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `DEPLOYMENT_ID_` varchar(64) collate utf8_bin default NULL, `BYTES_` longblob, `GENERATED_` tinyint(4) default NULL, PRIMARY KEY (`ID_`), KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`), CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `act_re_deployment` (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ge_bytearray -- ---------------------------- -- ---------------------------- -- Table structure for `act_ge_property` -- ---------------------------- DROP TABLE IF EXISTS `act_ge_property`; CREATE TABLE `act_ge_property` ( `NAME_` varchar(64) collate utf8_bin NOT NULL default '', `VALUE_` varchar(300) collate utf8_bin default NULL, `REV_` int(11) default NULL, PRIMARY KEY (`NAME_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ge_property -- ---------------------------- INSERT INTO `act_ge_property` VALUES ('next.dbid', '2420001', '969'); INSERT INTO `act_ge_property` VALUES ('schema.history', 'create(5.16.1)', '1'); INSERT INTO `act_ge_property` VALUES ('schema.version', '5.16.1', '1'); -- ---------------------------- -- Table structure for `act_hi_actinst` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_actinst`; CREATE TABLE `act_hi_actinst` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin NOT NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin NOT NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin NOT NULL, `ACT_ID_` varchar(255) collate utf8_bin NOT NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `CALL_PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `ACT_NAME_` varchar(255) collate utf8_bin default NULL, `ACT_TYPE_` varchar(255) collate utf8_bin NOT NULL, `ASSIGNEE_` varchar(255) collate utf8_bin default NULL, `START_TIME_` datetime NOT NULL, `END_TIME_` datetime default NULL, `DURATION_` bigint(20) default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', PRIMARY KEY (`ID_`), KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`), KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`), KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`), KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_actinst -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_attachment` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_attachment`; CREATE TABLE `act_hi_attachment` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `REV_` int(11) default NULL, `USER_ID_` varchar(255) collate utf8_bin default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `DESCRIPTION_` varchar(4000) collate utf8_bin default NULL, `TYPE_` varchar(255) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `URL_` varchar(4000) collate utf8_bin default NULL, `CONTENT_ID_` varchar(64) collate utf8_bin default NULL, PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_attachment -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_comment` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_comment`; CREATE TABLE `act_hi_comment` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `TYPE_` varchar(255) collate utf8_bin default NULL, `TIME_` datetime NOT NULL, `USER_ID_` varchar(255) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `ACTION_` varchar(255) collate utf8_bin default NULL, `MESSAGE_` varchar(4000) collate utf8_bin default NULL, `FULL_MSG_` longblob, PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_comment -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_detail` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_detail`; CREATE TABLE `act_hi_detail` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `TYPE_` varchar(255) collate utf8_bin NOT NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `ACT_INST_ID_` varchar(64) collate utf8_bin default NULL, `NAME_` varchar(255) collate utf8_bin NOT NULL, `VAR_TYPE_` varchar(255) collate utf8_bin default NULL, `REV_` int(11) default NULL, `TIME_` datetime NOT NULL, `BYTEARRAY_ID_` varchar(64) collate utf8_bin default NULL, `DOUBLE_` double default NULL, `LONG_` bigint(20) default NULL, `TEXT_` varchar(4000) collate utf8_bin default NULL, `TEXT2_` varchar(4000) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_HI_DETAIL_PROC_INST` (`PROC_INST_ID_`), KEY `ACT_IDX_HI_DETAIL_ACT_INST` (`ACT_INST_ID_`), KEY `ACT_IDX_HI_DETAIL_TIME` (`TIME_`), KEY `ACT_IDX_HI_DETAIL_NAME` (`NAME_`), KEY `ACT_IDX_HI_DETAIL_TASK_ID` (`TASK_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_detail -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_identitylink` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_identitylink`; CREATE TABLE `act_hi_identitylink` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `GROUP_ID_` varchar(255) collate utf8_bin default NULL, `TYPE_` varchar(255) collate utf8_bin default NULL, `USER_ID_` varchar(255) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_HI_IDENT_LNK_USER` (`USER_ID_`), KEY `ACT_IDX_HI_IDENT_LNK_TASK` (`TASK_ID_`), KEY `ACT_IDX_HI_IDENT_LNK_PROCINST` (`PROC_INST_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_identitylink -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_procinst` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_procinst`; CREATE TABLE `act_hi_procinst` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin NOT NULL, `BUSINESS_KEY_` varchar(255) collate utf8_bin default NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin NOT NULL, `START_TIME_` datetime NOT NULL, `END_TIME_` datetime default NULL, `DURATION_` bigint(20) default NULL, `START_USER_ID_` varchar(255) collate utf8_bin default NULL, `START_ACT_ID_` varchar(255) collate utf8_bin default NULL, `END_ACT_ID_` varchar(255) collate utf8_bin default NULL, `SUPER_PROCESS_INSTANCE_ID_` varchar(64) collate utf8_bin default NULL, `DELETE_REASON_` varchar(4000) collate utf8_bin default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', `NAME_` varchar(255) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), UNIQUE KEY `PROC_INST_ID_` (`PROC_INST_ID_`), KEY `ACT_IDX_HI_PRO_INST_END` (`END_TIME_`), KEY `ACT_IDX_HI_PRO_I_BUSKEY` (`BUSINESS_KEY_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_procinst -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_taskinst` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_taskinst`; CREATE TABLE `act_hi_taskinst` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, `TASK_DEF_KEY_` varchar(255) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `PARENT_TASK_ID_` varchar(64) collate utf8_bin default NULL, `DESCRIPTION_` varchar(4000) collate utf8_bin default NULL, `OWNER_` varchar(255) collate utf8_bin default NULL, `ASSIGNEE_` varchar(255) collate utf8_bin default NULL, `START_TIME_` datetime NOT NULL, `CLAIM_TIME_` datetime default NULL, `END_TIME_` datetime default NULL, `DURATION_` bigint(20) default NULL, `DELETE_REASON_` varchar(4000) collate utf8_bin default NULL, `PRIORITY_` int(11) default NULL, `DUE_DATE_` datetime default NULL, `FORM_KEY_` varchar(255) collate utf8_bin default NULL, `CATEGORY_` varchar(255) collate utf8_bin default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_taskinst -- ---------------------------- -- ---------------------------- -- Table structure for `act_hi_varinst` -- ---------------------------- DROP TABLE IF EXISTS `act_hi_varinst`; CREATE TABLE `act_hi_varinst` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `NAME_` varchar(200) collate utf8_bin NOT NULL, `VAR_TYPE_` varchar(100) collate utf8_bin default NULL, `REV_` int(11) default NULL, `BYTEARRAY_ID_` varchar(64) collate utf8_bin default NULL, `DOUBLE_` double default NULL, `LONG_` bigint(20) default NULL, `TEXT_` varchar(4000) collate utf8_bin default NULL, `TEXT2_` varchar(4000) collate utf8_bin default NULL, `CREATE_TIME_` datetime default NULL, `LAST_UPDATED_TIME_` datetime default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_HI_PROCVAR_PROC_INST` (`PROC_INST_ID_`), KEY `ACT_IDX_HI_PROCVAR_TASK_ID` (`TASK_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_hi_varinst -- ---------------------------- -- ---------------------------- -- Table structure for `act_id_group` -- ---------------------------- DROP TABLE IF EXISTS `act_id_group`; CREATE TABLE `act_id_group` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `TYPE_` varchar(255) collate utf8_bin default NULL, PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_id_group -- ---------------------------- -- ---------------------------- -- Table structure for `act_id_info` -- ---------------------------- DROP TABLE IF EXISTS `act_id_info`; CREATE TABLE `act_id_info` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `USER_ID_` varchar(64) collate utf8_bin default NULL, `TYPE_` varchar(64) collate utf8_bin default NULL, `KEY_` varchar(255) collate utf8_bin default NULL, `VALUE_` varchar(255) collate utf8_bin default NULL, `PASSWORD_` longblob, `PARENT_ID_` varchar(255) collate utf8_bin default NULL, PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_id_info -- ---------------------------- -- ---------------------------- -- Table structure for `act_id_membership` -- ---------------------------- DROP TABLE IF EXISTS `act_id_membership`; CREATE TABLE `act_id_membership` ( `USER_ID_` varchar(64) collate utf8_bin NOT NULL default '', `GROUP_ID_` varchar(64) collate utf8_bin NOT NULL default '', PRIMARY KEY (`USER_ID_`,`GROUP_ID_`), KEY `ACT_FK_MEMB_GROUP` (`GROUP_ID_`), CONSTRAINT `ACT_FK_MEMB_USER` FOREIGN KEY (`USER_ID_`) REFERENCES `act_id_user` (`ID_`), CONSTRAINT `ACT_FK_MEMB_GROUP` FOREIGN KEY (`GROUP_ID_`) REFERENCES `act_id_group` (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_id_membership -- ---------------------------- -- ---------------------------- -- Table structure for `act_id_user` -- ---------------------------- DROP TABLE IF EXISTS `act_id_user`; CREATE TABLE `act_id_user` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `FIRST_` varchar(255) collate utf8_bin default NULL, `LAST_` varchar(255) collate utf8_bin default NULL, `EMAIL_` varchar(255) collate utf8_bin default NULL, `PWD_` varchar(255) collate utf8_bin default NULL, `PICTURE_ID_` varchar(64) collate utf8_bin default NULL, PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_id_user -- ---------------------------- -- ---------------------------- -- Table structure for `act_re_deployment` -- ---------------------------- DROP TABLE IF EXISTS `act_re_deployment`; CREATE TABLE `act_re_deployment` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `NAME_` varchar(255) collate utf8_bin default NULL, `CATEGORY_` varchar(255) collate utf8_bin default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', `DEPLOY_TIME_` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_re_deployment -- ---------------------------- -- ---------------------------- -- Table structure for `act_re_model` -- ---------------------------- DROP TABLE IF EXISTS `act_re_model`; CREATE TABLE `act_re_model` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `REV_` int(11) default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `KEY_` varchar(255) collate utf8_bin default NULL, `CATEGORY_` varchar(255) collate utf8_bin default NULL, `CREATE_TIME_` timestamp NULL default NULL, `LAST_UPDATE_TIME_` timestamp NULL default NULL, `VERSION_` int(11) default NULL, `META_INFO_` varchar(4000) collate utf8_bin default NULL, `DEPLOYMENT_ID_` varchar(64) collate utf8_bin default NULL, `EDITOR_SOURCE_VALUE_ID_` varchar(64) collate utf8_bin default NULL, `EDITOR_SOURCE_EXTRA_VALUE_ID_` varchar(64) collate utf8_bin default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', PRIMARY KEY (`ID_`), KEY `ACT_FK_MODEL_SOURCE` (`EDITOR_SOURCE_VALUE_ID_`), KEY `ACT_FK_MODEL_SOURCE_EXTRA` (`EDITOR_SOURCE_EXTRA_VALUE_ID_`), KEY `ACT_FK_MODEL_DEPLOYMENT` (`DEPLOYMENT_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_re_model -- ---------------------------- -- ---------------------------- -- Table structure for `act_re_procdef` -- ---------------------------- DROP TABLE IF EXISTS `act_re_procdef`; CREATE TABLE `act_re_procdef` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `REV_` int(11) default NULL, `CATEGORY_` varchar(255) collate utf8_bin default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `KEY_` varchar(255) collate utf8_bin NOT NULL, `VERSION_` int(11) NOT NULL, `DEPLOYMENT_ID_` varchar(64) collate utf8_bin default NULL, `RESOURCE_NAME_` varchar(4000) collate utf8_bin default NULL, `DGRM_RESOURCE_NAME_` varchar(4000) collate utf8_bin default NULL, `DESCRIPTION_` varchar(4000) collate utf8_bin default NULL, `HAS_START_FORM_KEY_` tinyint(4) default NULL, `SUSPENSION_STATE_` int(11) default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', PRIMARY KEY (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_re_procdef -- ---------------------------- -- ---------------------------- -- Table structure for `act_ru_event_subscr` -- ---------------------------- DROP TABLE IF EXISTS `act_ru_event_subscr`; CREATE TABLE `act_ru_event_subscr` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `REV_` int(11) default NULL, `EVENT_TYPE_` varchar(255) collate utf8_bin NOT NULL, `EVENT_NAME_` varchar(255) collate utf8_bin default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `ACTIVITY_ID_` varchar(64) collate utf8_bin default NULL, `CONFIGURATION_` varchar(255) collate utf8_bin default NULL, `CREATED_` timestamp NOT NULL default CURRENT_TIMESTAMP, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', PRIMARY KEY (`ID_`), KEY `ACT_IDX_EVENT_SUBSCR_CONFIG_` (`CONFIGURATION_`), KEY `ACT_FK_EVENT_EXEC` (`EXECUTION_ID_`), CONSTRAINT `ACT_FK_EVENT_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ru_event_subscr -- ---------------------------- -- ---------------------------- -- Table structure for `act_ru_execution` -- ---------------------------- DROP TABLE IF EXISTS `act_ru_execution`; CREATE TABLE `act_ru_execution` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `BUSINESS_KEY_` varchar(255) collate utf8_bin default NULL, `PARENT_ID_` varchar(64) collate utf8_bin default NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, `SUPER_EXEC_` varchar(64) collate utf8_bin default NULL, `ACT_ID_` varchar(255) collate utf8_bin default NULL, `IS_ACTIVE_` tinyint(4) default NULL, `IS_CONCURRENT_` tinyint(4) default NULL, `IS_SCOPE_` tinyint(4) default NULL, `IS_EVENT_SCOPE_` tinyint(4) default NULL, `SUSPENSION_STATE_` int(11) default NULL, `CACHED_ENT_STATE_` int(11) default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', `NAME_` varchar(255) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_EXEC_BUSKEY` (`BUSINESS_KEY_`), KEY `ACT_FK_EXE_PROCINST` (`PROC_INST_ID_`), KEY `ACT_FK_EXE_PARENT` (`PARENT_ID_`), KEY `ACT_FK_EXE_SUPER` (`SUPER_EXEC_`), KEY `ACT_FK_EXE_PROCDEF` (`PROC_DEF_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ru_execution -- ---------------------------- -- ---------------------------- -- Table structure for `act_ru_identitylink` -- ---------------------------- DROP TABLE IF EXISTS `act_ru_identitylink`; CREATE TABLE `act_ru_identitylink` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `GROUP_ID_` varchar(255) collate utf8_bin default NULL, `TYPE_` varchar(255) collate utf8_bin default NULL, `USER_ID_` varchar(255) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_IDENT_LNK_USER` (`USER_ID_`), KEY `ACT_IDX_IDENT_LNK_GROUP` (`GROUP_ID_`), KEY `ACT_IDX_ATHRZ_PROCEDEF` (`PROC_DEF_ID_`), KEY `ACT_FK_TSKASS_TASK` (`TASK_ID_`), KEY `ACT_FK_IDL_PROCINST` (`PROC_INST_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ru_identitylink -- ---------------------------- -- ---------------------------- -- Table structure for `act_ru_job` -- ---------------------------- DROP TABLE IF EXISTS `act_ru_job`; CREATE TABLE `act_ru_job` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `REV_` int(11) default NULL, `TYPE_` varchar(255) collate utf8_bin NOT NULL, `LOCK_EXP_TIME_` timestamp NULL default NULL, `LOCK_OWNER_` varchar(255) collate utf8_bin default NULL, `EXCLUSIVE_` tinyint(1) default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `PROCESS_INSTANCE_ID_` varchar(64) collate utf8_bin default NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, `RETRIES_` int(11) default NULL, `EXCEPTION_STACK_ID_` varchar(64) collate utf8_bin default NULL, `EXCEPTION_MSG_` varchar(4000) collate utf8_bin default NULL, `DUEDATE_` timestamp NULL default NULL, `REPEAT_` varchar(255) collate utf8_bin default NULL, `HANDLER_TYPE_` varchar(255) collate utf8_bin default NULL, `HANDLER_CFG_` varchar(4000) collate utf8_bin default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', PRIMARY KEY (`ID_`), KEY `ACT_FK_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`), CONSTRAINT `ACT_FK_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `act_ge_bytearray` (`ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ru_job -- ---------------------------- -- ---------------------------- -- Table structure for `act_ru_task` -- ---------------------------- DROP TABLE IF EXISTS `act_ru_task`; CREATE TABLE `act_ru_task` ( `ID_` varchar(64) collate utf8_bin NOT NULL default '', `REV_` int(11) default NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `PROC_DEF_ID_` varchar(64) collate utf8_bin default NULL, `NAME_` varchar(255) collate utf8_bin default NULL, `PARENT_TASK_ID_` varchar(64) collate utf8_bin default NULL, `DESCRIPTION_` varchar(4000) collate utf8_bin default NULL, `TASK_DEF_KEY_` varchar(255) collate utf8_bin default NULL, `OWNER_` varchar(255) collate utf8_bin default NULL, `ASSIGNEE_` varchar(255) collate utf8_bin default NULL, `DELEGATION_` varchar(64) collate utf8_bin default NULL, `PRIORITY_` int(11) default NULL, `CREATE_TIME_` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `DUE_DATE_` datetime default NULL, `CATEGORY_` varchar(255) collate utf8_bin default NULL, `SUSPENSION_STATE_` int(11) default NULL, `TENANT_ID_` varchar(255) collate utf8_bin default '', `FORM_KEY_` varchar(255) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_TASK_CREATE` (`CREATE_TIME_`), KEY `ACT_FK_TASK_EXE` (`EXECUTION_ID_`), KEY `ACT_FK_TASK_PROCINST` (`PROC_INST_ID_`), KEY `ACT_FK_TASK_PROCDEF` (`PROC_DEF_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ru_task -- ---------------------------- -- ---------------------------- -- Table structure for `act_ru_variable` -- ---------------------------- DROP TABLE IF EXISTS `act_ru_variable`; CREATE TABLE `act_ru_variable` ( `ID_` varchar(64) collate utf8_bin NOT NULL, `REV_` int(11) default NULL, `TYPE_` varchar(255) collate utf8_bin NOT NULL, `NAME_` varchar(255) collate utf8_bin NOT NULL, `EXECUTION_ID_` varchar(64) collate utf8_bin default NULL, `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL, `TASK_ID_` varchar(64) collate utf8_bin default NULL, `BYTEARRAY_ID_` varchar(64) collate utf8_bin default NULL, `DOUBLE_` double default NULL, `LONG_` bigint(20) default NULL, `TEXT_` varchar(4000) collate utf8_bin default NULL, `TEXT2_` varchar(4000) collate utf8_bin default NULL, PRIMARY KEY (`ID_`), KEY `ACT_IDX_VARIABLE_TASK_ID` (`TASK_ID_`), KEY `ACT_FK_VAR_EXE` (`EXECUTION_ID_`), KEY `ACT_FK_VAR_PROCINST` (`PROC_INST_ID_`), KEY `ACT_FK_VAR_BYTEARRAY` (`BYTEARRAY_ID_`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- ---------------------------- -- Records of act_ru_variable -- ----------------------------
<filename>vendor/jamband/yii2-schemadump/tests/schemas/postgre.sql -- for some primary keys and unique keys DROP TABLE IF EXISTS "0010_pk_ai"; CREATE TABLE "0010_pk_ai" ( id serial not null primary key ); DROP TABLE IF EXISTS "0020_pk_not_ai"; CREATE TABLE "0020_pk_not_ai" ( id integer not null primary key ); DROP TABLE IF EXISTS "0030_pk_bigint_ai"; CREATE TABLE "0030_pk_bigint_ai" ( id bigserial not null primary key ); DROP TABLE IF EXISTS "0040_composite_pks"; CREATE TABLE "0040_composite_pks" ( foo_id integer not null, bar_id integer not null, PRIMARY KEY (foo_id, bar_id) ); DROP TABLE IF EXISTS "0050_uks"; CREATE TABLE "0050_uks" ( id serial not null primary key, username varchar(20) not null unique, email varchar(255) not null unique, password varchar(255) not null ); -- for some types DROP TABLE IF EXISTS "0100_types"; CREATE TABLE "0100_types" ( "bool" bool not null default false, "boolean" boolean not null default false, "character" character(20) not null, "char" char(20) not null, "character_varying" character varying(20) not null, "varchar" varchar(20) not null, "text" text not null, "binary" bytea not null, "real" real not null, "decimal" decimal(20,10) not null, "numeric" numeric(20,10) not null, "money_decimal" decimal(19,4) not null, "money" money not null, "smallint" smallint not null, "integer" integer not null, "bigint" bigint not null, "date" date not null, "time" time not null, "timestamp" timestamp not null ); -- for some default values DROP TABLE IF EXISTS "0200_default_values"; CREATE TABLE "0200_default_values" ( "integer" smallint not null default 1, "string" varchar not null default 'UNKNOWN' ); -- for some comments DROP TABLE IF EXISTS "0300_comment"; CREATE TABLE "0300_comment" ( username varchar(20) not null ); comment on column "0300_comment".username is 'ユーザ名'; -- for foreign keys DROP TABLE IF EXISTS "0400_fk_parent"; CREATE TABLE "0400_fk_parent" ( id serial not null primary key ); DROP TABLE IF EXISTS "0410_fk_child"; CREATE TABLE "0410_fk_child" ( id serial not null primary key, parent_id integer not null references "0400_fk_parent" (id) );
-- -- errors -- SET pg_similarity.cosine_threshold to 1.1; SET pg_similarity.qgram_tokenizer to 'alnum'; -- -- valid values -- SET pg_similarity.block_is_normalized to true; SET pg_similarity.cosine_threshold = 0.72; SET pg_similarity.dice_tokenizer to 'alnum'; SET pg_similarity.euclidean_is_normalized to false; SET pg_similarity.jaro_winkler_is_normalized to false; SET pg_similarity.qgram_tokenizer to 'gram';
<reponame>awesome-archive/ZhihuSpider /* Navicat MySQL Data Transfer Source Server : mysqlcas Source Server Version : 50167 Source Host : localhost:3306 Source Database : seven Target Server Type : MYSQL Target Server Version : 50167 File Encoding : 65001 Date: 2016-12-29 09:43:25 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for follower -- ---------------------------- DROP TABLE IF EXISTS `follower`; CREATE TABLE `follower` ( `user_token` varchar(255) DEFAULT NULL, `user_token_follower` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(255) NOT NULL AUTO_INCREMENT COMMENT '默认id', `token` varchar(255) NOT NULL, `index_url` varchar(255) NOT NULL, `isinit` int(1) NOT NULL DEFAULT '0', `from_id` int(255) NOT NULL, `from_token` varchar(255) NOT NULL, `isparser` int(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `users_token_index` (`token`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1216003 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for users_info -- ---------------------------- DROP TABLE IF EXISTS `users_info`; CREATE TABLE `users_info` ( `name` varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL COMMENT '地址', `education` varchar(255) DEFAULT NULL COMMENT '教育', `company` varchar(255) DEFAULT NULL COMMENT '公司', `job` varchar(255) DEFAULT NULL COMMENT '工作', `headline` varchar(255) DEFAULT NULL COMMENT '签名', `user_id` varchar(255) DEFAULT NULL COMMENT 'pk主表引用', `answer` varchar(255) DEFAULT NULL, `question` varchar(255) DEFAULT NULL, `article` varchar(255) DEFAULT NULL COMMENT '文章总数', `favorite` varchar(255) DEFAULT NULL COMMENT '收藏总数', `agree` varchar(255) DEFAULT NULL, `thanked` varchar(255) DEFAULT NULL, `following` varchar(255) DEFAULT NULL, `followers` varchar(255) DEFAULT NULL, `topic` varchar(255) DEFAULT NULL, `columns` varchar(255) DEFAULT NULL, `sex` varchar(255) DEFAULT NULL, `updatetime` timestamp NULL DEFAULT NULL, `weibo` varchar(255) DEFAULT NULL, `token` varchar(255) DEFAULT NULL, `index_url` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DECLARE AVG_OF_INTERVAL_REQUESTS NUMBER; AVG_OF_INTERVAL_REQUESTS_INTEGER NUMBER; BEGIN SELECT AVG(DIFFERENCE), FLOOR(AVG(DIFFERENCE)) INTO AVG_OF_INTERVAL_REQUESTS, AVG_OF_INTERVAL_REQUESTS_INTEGER FROM ( SELECT A.* ,LAG(REQUEST_DATE) OVER (ORDER BY REQUEST_DATE) AS PREVIOUS_ROW ,REQUEST_DATE - LAG(REQUEST_DATE) OVER (ORDER BY REQUEST_DATE) AS DIFFERENCE FROM ( SELECT DISTINCT REQUEST_DATE FROM USE_CASE_2 ) A ) B WHERE 1=1 AND PREVIOUS_ROW IS NOT NULL ; DBMS_OUTPUT.PUT_LINE('AVG_OF_INTERVAL_REQUESTS >> ' || AVG_OF_INTERVAL_REQUESTS); DBMS_OUTPUT.PUT_LINE('AVG_OF_INTERVAL_REQUESTS_INTEGER >> ' || AVG_OF_INTERVAL_REQUESTS_INTEGER); END ; /
INSERT INTO `AddressPostCode` VALUES ('1','93095-5039', now()), ('2','75530-9268', now()), ('3','11849', now()), ('4','27282-2089', now()), ('5','89992', now()), ('6','04342', now()), ('7','81268-8906', now()), ('8','29566', now()), ('9','64139-6608', now()), ('10','89297', now()), ('11','53720-8902', now()), ('12','56881', now()), ('13','74490', now()), ('14','62866-8186', now()), ('15','20001', now()), ('16','81169', now()), ('17','97522-7372', now()), ('18','65468', now()), ('19','20487-2329', now()), ('20','23273-7057', now()), ('21','87644', now()), ('22','42592', now()), ('23','91278-2795', now()), ('24','14059-1662', now()), ('25','14167', now()), ('26','26669', now()), ('27','63549-4208', now()), ('28','40470', now()), ('29','80121', now()), ('30','70761', now()), ('31','36443-6270', now()), ('32','63397', now()), ('33','64922', now()), ('34','53138', now()), ('35','18885-2694', now()), ('36','10668-7009', now()), ('37','35359-9301', now()), ('38','13787', now()), ('39','80569', now()), ('40','68602-6452', now()), ('41','98591', now()), ('42','68372', now()), ('43','26697-7124', now()), ('44','05454-1995', now()), ('45','30953', now()), ('46','04603', now()), ('47','08470', now()), ('48','63645', now()), ('49','03320-0870', now()), ('50','69417', now()), ('51','60611-3843', now()), ('52','43624-5548', now()), ('53','37578-0904', now()), ('54','76432', now()), ('55','12943', now()), ('56','82334', now()), ('57','20690', now()), ('58','00018-8890', now()), ('59','23305', now()), ('60','01981', now()), ('61','22030-3510', now()), ('62','22248-2983', now()), ('63','00094', now()), ('64','87002-4203', now()), ('65','22754-1050', now()), ('66','91740', now()), ('67','06850', now()), ('68','83587', now()), ('69','14627-1454', now()), ('70','16403', now()), ('71','45101-9097', now()), ('72','30935', now()), ('73','92999', now()), ('74','28976-7549', now()), ('75','41497', now()), ('76','08531', now()), ('77','12032-0342', now()), ('78','43974-3159', now()), ('79','87640', now()), ('80','18996-7932', now()), ('81','15963', now()), ('82','44375', now()), ('83','45248', now()), ('84','41714-2382', now()), ('85','58759-9892', now()), ('86','57550-0976', now()), ('87','96295-2508', now()), ('88','03128', now()), ('89','52688-0750', now()), ('90','08448-4061', now()), ('91','14643', now()), ('92','53630-4008', now()), ('93','88617', now()), ('94','65105', now()), ('95','20862', now()), ('96','89941', now()), ('97','07048-8722', now()), ('98','61394', now()), ('99','00420-6869', now()), ('100','69113-9971', now()), ('101','21887', now()), ('102','16495', now()), ('103','91392', now()), ('104','17976-6046', now()), ('105','49193-3534', now()), ('106','61794', now()), ('107','12686', now()), ('108','60688-2021', now()), ('109','90857', now()), ('110','14369-5742', now()), ('111','85388-5919', now()), ('112','29332', now()), ('113','88770', now()), ('114','05868', now()), ('115','31595-3480', now()), ('116','05167-8249', now()), ('117','02654', now()), ('118','24219', now()), ('119','16873-9027', now()), ('120','98616-7825', now()), ('121','40357-2637', now()), ('122','28889', now()), ('123','67185', now()), ('124','52393', now()), ('125','56613', now()), ('126','58862-8021', now()), ('127','15092-6647', now()), ('128','56320-2759', now()), ('129','52587', now()), ('130','82631', now()), ('131','05553-9835', now()), ('132','52997', now()), ('133','84348-8447', now()), ('134','65657', now()), ('135','75958', now()), ('136','14179-4652', now()), ('137','39982', now()), ('138','68303', now()), ('139','82308-6098', now()), ('140','61133-7599', now()), ('141','30130-3607', now()), ('142','50622-3598', now()), ('143','17864', now()), ('144','74474-1914', now()), ('145','25716-6499', now()), ('146','20223', now()), ('147','59862-6228', now()), ('148','27878-0492', now()), ('149','26396-9124', now()), ('150','97005-7216', now()), ('151','56719-6742', now()), ('152','08955-5929', now()), ('153','66620', now()), ('154','95120', now()), ('155','10970', now()), ('156','55961', now()), ('157','34450-1191', now()), ('158','89890-1722', now()), ('159','73538-0617', now()), ('160','02671-9218', now()), ('161','18959', now()), ('162','72041', now()), ('163','65145', now()), ('164','69441', now()), ('165','00347-4223', now()), ('166','61772-1227', now()), ('167','18413-3652', now()), ('168','53551', now()), ('169','27554-0778', now()), ('170','12020', now()), ('171','74945-8333', now()), ('172','51284', now()), ('173','74627', now()), ('174','75564-2389', now()), ('175','86539', now()), ('176','07799-0832', now()), ('177','81476-3722', now()), ('178','52258', now()), ('179','78010', now()), ('180','70487-2088', now()), ('181','33192-3020', now()), ('182','52879', now()), ('183','83919-9949', now()), ('184','56941', now()), ('185','86136-3416', now()), ('186','99031', now()), ('187','18072-4222', now()), ('188','64314-3150', now()), ('189','04770-7535', now()), ('190','50145', now()), ('191','05163', now()), ('192','23087', now()), ('193','26935-8854', now()), ('194','94365', now()), ('195','50196-6041', now()), ('196','36671', now()), ('197','60184', now()), ('198','52686', now()), ('199','36071-1810', now()), ('200','98295-2696', now()), ('201','37911', now()), ('202','73334-1554', now()), ('203','76398-2993', now()), ('204','97863-3711', now()), ('205','08390-0256', now()), ('206','86073-2861', now()), ('207','01920-4631', now()), ('208','96400-5069', now()), ('209','05349-8466', now()), ('210','78716', now()), ('211','44880-9940', now()), ('212','04980-8798', now()), ('213','28494', now()), ('214','20875-4428', now()), ('215','43238', now()), ('216','00634-7634', now()), ('217','85572-5521', now()), ('218','96864', now()), ('219','48021-5863', now()), ('220','03254', now()), ('221','97821-7486', now()), ('222','82438-8313', now()), ('223','28539-2587', now()), ('224','57903-2690', now()), ('225','34220-1090', now()), ('226','79284-4702', now()), ('227','03065', now()), ('228','29418', now()), ('229','99371-2971', now()), ('230','78373-8815', now()), ('231','26664-1736', now()), ('232','51934', now()), ('233','65881-0379', now()), ('234','37266-5749', now()), ('235','25732-5811', now()), ('236','79727', now()), ('237','36018', now()), ('238','67443-2314', now()), ('239','49561', now()), ('240','38888', now()), ('241','76848-2557', now()), ('242','73806-1627', now()), ('243','50983-6462', now()), ('244','92924', now()), ('245','75079-7558', now()), ('246','56467-8423', now()), ('247','34144-5935', now()), ('248','79668-7404', now()), ('249','47016-4990', now()), ('250','53863', now()), ('251','05974-0539', now()), ('252','48845', now()), ('253','93552-7309', now()), ('254','54899', now()), ('255','14734-3140', now()), ('256','54959-2913', now()), ('257','86825-1185', now()), ('258','63063-5077', now()), ('259','74969', now()), ('260','17923', now()), ('261','06169-7493', now()), ('262','34825', now()), ('263','76713-1602', now()), ('264','44272-7510', now()), ('265','37810', now()), ('266','77618', now()), ('267','71415', now()), ('268','36442', now()), ('269','85343-0065', now()), ('270','75794', now()), ('271','04732', now()), ('272','77193-7729', now()), ('273','29595', now()), ('274','72683-3795', now()), ('275','90112', now()), ('276','04668-4102', now()), ('277','39281', now()), ('278','66619', now()), ('279','80986', now()), ('280','79130-4323', now()), ('281','49396', now()), ('282','51666', now()), ('283','13254', now()), ('284','11191', now()), ('285','87212', now()), ('286','16557', now()), ('287','44595', now()), ('288','97224', now()), ('289','94834-8253', now()), ('290','24019', now()), ('291','88892-9251', now()), ('292','77028-2762', now()), ('293','13599', now()), ('294','72766-8123', now()), ('295','15735-6980', now()), ('296','20381', now()), ('297','20766-9333', now()), ('298','59810', now()), ('299','87885-1247', now()), ('300','53273-3908', now()), ('301','06211-7284', now()), ('302','05285-3862', now()), ('303','03790-3043', now()), ('304','12576-6594', now()), ('305','45425', now()), ('306','73797-9456', now()), ('307','51508', now()), ('308','67108', now()), ('309','85537', now()), ('310','38443', now()), ('311','54335', now()), ('312','00126', now()), ('313','09333', now()), ('314','06375-4438', now()), ('315','11051', now()), ('316','53659', now()), ('317','71456', now()), ('318','53680', now()), ('319','41669-6906', now()), ('320','40056', now()), ('321','16837', now()), ('322','22390-1937', now()), ('323','20082', now()), ('324','43243-6963', now()), ('325','71519-2583', now()), ('326','82683-8924', now()), ('327','92102', now()), ('328','95158', now()), ('329','08851-0679', now()), ('330','18573', now()), ('331','16038-9990', now()), ('332','99886-1336', now()), ('333','99634-6827', now()), ('334','37808-0335', now()), ('335','04688-6563', now()), ('336','24854', now()), ('337','40648', now()), ('338','49633', now()), ('339','64096-2495', now()), ('340','70137-5868', now()), ('341','10013-2110', now()), ('342','64021-2909', now()), ('343','17283', now()), ('344','48293', now()), ('345','30627', now()), ('346','22447', now()), ('347','59518-5981', now()), ('348','26001', now()), ('349','34819', now()), ('350','98397-8187', now()), ('351','32566-7200', now()), ('352','43272-5898', now()), ('353','33065-7469', now()), ('354','98085-5065', now()), ('355','37202-3227', now()), ('356','11471-0181', now()), ('357','83773', now()), ('358','72904', now()), ('359','56529-6863', now()), ('360','51639', now()), ('361','03896-6752', now()), ('362','15094', now()), ('363','86436', now()), ('364','46967', now()), ('365','30358', now()), ('366','39374-3612', now()), ('367','60590', now()), ('368','38621-7273', now()), ('369','85221', now()), ('370','26839', now()), ('371','21840-1581', now()), ('372','97811', now()), ('373','43984', now()), ('374','13869', now()), ('375','84111-1588', now()), ('376','84770-9347', now()), ('377','70231-3505', now()), ('378','78853', now()), ('379','30666', now()), ('380','32496-9810', now()), ('381','42841-0443', now()), ('382','86046', now()), ('383','59554-6273', now()), ('384','93454', now()), ('385','18780', now()), ('386','42555-0762', now()), ('387','17614-0789', now()), ('388','04729-1242', now()), ('389','16616', now()), ('390','16117-2351', now()), ('391','92748-7573', now()), ('392','28896', now()), ('393','85697', now()), ('394','23773', now()), ('395','78145-1777', now()), ('396','14216', now()), ('397','49398', now()), ('398','23066', now()), ('399','54533-6032', now()), ('400','54908', now()), ('401','50059', now()), ('402','31459-2806', now()), ('403','58576', now()), ('404','00752-0777', now()), ('405','31939', now()), ('406','26602-2324', now()), ('407','14531-1730', now()), ('408','69194-4170', now()), ('409','84807', now()), ('410','25315-2975', now()), ('411','30803-0607', now()), ('412','90599-3985', now()), ('413','22635-8265', now()), ('414','75269', now()), ('415','97064', now()), ('416','05116-0653', now()), ('417','33988', now()), ('418','43016', now()), ('419','69293-4424', now()), ('420','03325-3682', now()), ('421','09596', now()), ('422','90419', now()), ('423','03939-0345', now()), ('424','40612', now()), ('425','62375-9104', now()), ('426','80861', now()), ('427','67182-2208', now()), ('428','12948', now()), ('429','83576-5012', now()), ('430','10372', now()), ('431','71005-2438', now()), ('432','91606', now()), ('433','63440', now()), ('434','09017-0849', now()), ('435','92273', now()), ('436','45670', now()), ('437','35622-7733', now()), ('438','16058-6268', now()), ('439','94967', now()), ('440','56270-5355', now()), ('441','82253', now()), ('442','92617-1804', now()), ('443','27598', now()), ('444','77380-3490', now()), ('445','53162', now()), ('446','16318', now()), ('447','01448-1819', now()), ('448','07139', now()), ('449','02050', now()), ('450','89281-0417', now()), ('451','70342-7268', now()), ('452','41063-1119', now()), ('453','39832', now()), ('454','33215-4057', now()), ('455','16739', now()), ('456','86091', now()), ('457','46156-7166', now()), ('458','82194', now()), ('459','93595-5956', now()), ('460','96930', now()), ('461','39802', now()), ('462','18710-9594', now()), ('463','91957', now()), ('464','35258', now()), ('465','74664', now()), ('466','32982-4709', now()), ('467','82882', now()), ('468','06017', now()), ('469','86879', now()), ('470','09145-2917', now()), ('471','09431-1034', now()), ('472','96642-9722', now()), ('473','43386-4997', now()), ('474','80244-5379', now()), ('475','61987', now()), ('476','04757-2208', now()), ('477','46734-7239', now()), ('478','05103-9456', now()), ('479','13731', now()), ('480','99425', now()), ('481','20763', now()), ('482','58816', now()), ('483','22123', now()), ('484','91869-3327', now()), ('485','31511', now()), ('486','41709-5033', now()), ('487','67268', now()), ('488','23928-8914', now()), ('489','61789-5724', now()), ('490','98746-2503', now()), ('491','90174', now()), ('492','54865-2627', now()), ('493','51926-3702', now()), ('494','57334-6792', now()), ('495','77594', now()), ('496','00560-8992', now()), ('497','41384', now()), ('498','57505-7604', now()), ('499','08397', now()), ('500','14064', now()), ('501','21991-7518', now()), ('502','22972', now()), ('503','37808', now()), ('504','97216-7911', now()), ('505','60805', now()), ('506','94498', now()), ('507','97388-6671', now()), ('508','88288-3511', now()), ('509','64374', now()), ('510','94407', now()), ('511','61154-1700', now()), ('512','90493', now()), ('513','17586-4971', now()), ('514','34369', now()), ('515','38190-4255', now()), ('516','15313-5546', now()), ('517','90919-8618', now()), ('518','56719-0285', now()), ('519','40833-0397', now()), ('520','90676', now()), ('521','47635-6786', now()), ('522','12336-2031', now()), ('523','20154', now()), ('524','51596', now()), ('525','71950', now()), ('526','74960-3780', now()), ('527','27460-7461', now()), ('528','79657', now()), ('529','55731', now()), ('530','91592-5160', now()), ('531','92508-3717', now()), ('532','04735', now()), ('533','57055', now()), ('534','26165-8854', now()), ('535','91638-6813', now()), ('536','11488', now()), ('537','90889-5316', now()), ('538','86336-6325', now()), ('539','66191', now()), ('540','26583', now()), ('541','66392-1615', now()), ('542','30031-8999', now()), ('543','78247', now()), ('544','21617', now()), ('545','96619-9165', now()), ('546','40648-8546', now()), ('547','95684-0494', now()), ('548','47075-8775', now()), ('549','82807-1594', now()), ('550','68960-1495', now()), ('551','15249', now()), ('552','49232', now()), ('553','85591-8281', now()), ('554','07633-1805', now()), ('555','65186', now()), ('556','02593-3156', now()), ('557','90710-5267', now()), ('558','83280-4499', now()), ('559','53188', now()), ('560','89610', now()), ('561','46371-9807', now()), ('562','29946', now()), ('563','29002', now()), ('564','71355-3510', now()), ('565','69394', now()), ('566','90825-4906', now()), ('567','06679-2364', now()), ('568','17021', now()), ('569','05836-9350', now()), ('570','93268', now()), ('571','37830', now()), ('572','52836-5982', now()), ('573','67414-6530', now()), ('574','53358', now()), ('575','32692-7616', now()), ('576','30084-3432', now()), ('577','05038-0569', now()), ('578','60537', now()), ('579','43431', now()), ('580','96999-2148', now()), ('581','29719', now()), ('582','66410', now()), ('583','57389-3667', now()), ('584','18887', now()), ('585','12265-4025', now()), ('586','84015-8771', now()), ('587','72120', now()), ('588','82849-4947', now()), ('589','88680-8072', now()), ('590','84902-4268', now()), ('591','69718', now()), ('592','78090', now()), ('593','31018', now()), ('594','69132', now()), ('595','97800', now()), ('596','48111', now()), ('597','92813-2730', now()), ('598','21401-0256', now()), ('599','11846-6928', now()), ('600','97683', now()), ('601','31672', now()), ('602','96248-0331', now()), ('603','30908-8375', now()), ('604','14291-7177', now()), ('605','68511', now()), ('606','38026', now()), ('607','81424-7038', now()), ('608','27427', now()), ('609','27816-1690', now()), ('610','35805-7956', now()), ('611','66787', now()), ('612','67023', now()), ('613','39789-4497', now()), ('614','46900-7309', now()), ('615','58677', now()), ('616','21178-9364', now()), ('617','38338', now()), ('618','84233-5372', now()), ('619','85427-8469', now()), ('620','88928-0948', now()), ('621','89497-2475', now()), ('622','24197-4457', now()), ('623','41939', now()), ('624','55012-8737', now()), ('625','01152', now()), ('626','48369', now()), ('627','00325', now()), ('628','03382-4861', now()), ('629','12920', now()), ('630','94486-0134', now()), ('631','77215-0983', now()), ('632','90627', now()), ('633','89217-6118', now()), ('634','23203', now()), ('635','30284-4278', now()), ('636','42775', now()), ('637','10879', now()), ('638','51148', now()), ('639','02213', now()), ('640','62269-3985', now()), ('641','54677', now()), ('642','07034', now()), ('643','03539', now()), ('644','88051', now()), ('645','21714-5217', now()), ('646','88197-4435', now()), ('647','08797', now()), ('648','86521', now()), ('649','88941-9634', now()), ('650','03026-0188', now()), ('651','48893-4495', now()), ('652','48043-3716', now()), ('653','52342', now()), ('654','87344-0249', now()), ('655','08440', now()), ('656','98510-5943', now()), ('657','74579', now()), ('658','82628', now()), ('659','66459-9145', now()), ('660','10435-8244', now()), ('661','42664-2305', now()), ('662','22033', now()), ('663','15962-4683', now()), ('664','53130-1838', now()), ('665','30766-1027', now()), ('666','07198', now()), ('667','05176-9474', now()), ('668','14081', now()), ('669','38544', now()), ('670','93158', now()), ('671','34683', now()), ('672','12098-8252', now()), ('673','32803', now()), ('674','81899-6754', now()), ('675','57029', now()), ('676','09455-7287', now()), ('677','42920-9555', now()), ('678','06131-8447', now()), ('679','26415-0029', now()), ('680','06045-3693', now()), ('681','53083', now()), ('682','37131', now()), ('683','53733-9087', now()), ('684','95485', now()), ('685','85795', now()), ('686','34347', now()), ('687','09908', now()), ('688','02810', now()), ('689','92494', now()), ('690','85110-9629', now()), ('691','98658-2648', now()), ('692','71815', now()), ('693','88936', now()), ('694','47955-3013', now()), ('695','77160-2322', now()), ('696','94461-5350', now()), ('697','10085-0145', now()), ('698','18198', now()), ('699','32145-9140', now()), ('700','36157-2580', now()), ('701','66213', now()), ('702','05663-3512', now()), ('703','18813', now()), ('704','61602-5029', now()), ('705','00924', now()), ('706','54867', now()), ('707','60568', now()), ('708','07832-0089', now()), ('709','66764-0941', now()), ('710','05447', now()), ('711','71139', now()), ('712','29690', now()), ('713','70994-2865', now()), ('714','67641-2875', now()), ('715','18682', now()), ('716','93828-6559', now()), ('717','18872-6303', now()), ('718','58918-0705', now()), ('719','61329-8012', now()), ('720','61209-9171', now()), ('721','20891-0488', now()), ('722','73085-7780', now()), ('723','60303', now()), ('724','42927-2708', now()), ('725','60623', now()), ('726','19834-6085', now()), ('727','38930', now()), ('728','97124', now()), ('729','19428-1888', now()), ('730','13504', now()), ('731','18118-6417', now()), ('732','08728', now()), ('733','11789-9801', now()), ('734','50040-8501', now()), ('735','25127-5259', now()), ('736','01971', now()), ('737','25945', now()), ('738','60980', now()), ('739','06947', now()), ('740','88636-8715', now()), ('741','81308', now()), ('742','08740-5660', now()), ('743','24916', now()), ('744','87559-2051', now()), ('745','36222-7483', now()), ('746','31096', now()), ('747','62683-8172', now()), ('748','33944-9751', now()), ('749','80819', now()), ('750','61584-6588', now()), ('751','30560', now()), ('752','85024-0390', now()), ('753','06450-0423', now()), ('754','54867-8136', now()), ('755','90561-4907', now()), ('756','25159', now()), ('757','12695', now()), ('758','46749', now()), ('759','45330-8902', now()), ('760','99164-0828', now()), ('761','44716-1197', now()), ('762','79121-7397', now()), ('763','82485-9565', now()), ('764','48075', now()), ('765','61698-1550', now()), ('766','10044', now()), ('767','61934-1327', now()), ('768','04269-8326', now()), ('769','77359-7475', now()), ('770','75409-6905', now()), ('771','26429', now()), ('772','21742-7117', now()), ('773','81867', now()), ('774','74537', now()), ('775','40827', now()), ('776','45772', now()), ('777','72615-0204', now()), ('778','53030-5565', now()), ('779','48115-5867', now()), ('780','66562', now()), ('781','33710', now()), ('782','74101-3012', now()), ('783','28381', now()), ('784','81588-1646', now()), ('785','11385', now()), ('786','00147-4675', now()), ('787','67338-2798', now()), ('788','22026-2679', now()), ('789','52961-1823', now()), ('790','72224', now()), ('791','35654', now()), ('792','65912', now()), ('793','54033-7673', now()), ('794','28302', now()), ('795','14775', now()), ('796','75202', now()), ('797','25206', now()), ('798','03636-5371', now()), ('799','74534', now()), ('800','02945', now()), ('801','42032', now()), ('802','38265', now()), ('803','08998', now()), ('804','98555', now()), ('805','62833', now()), ('806','53655', now()), ('807','58294-4034', now()), ('808','56826', now()), ('809','09161-2595', now()), ('810','03619', now()), ('811','30764-0026', now()), ('812','13268-6190', now()), ('813','51529', now()), ('814','01335', now()), ('815','15672-1816', now()), ('816','03307-1702', now()), ('817','95026-4743', now()), ('818','64963-4003', now()), ('819','12352', now()), ('820','57757', now()), ('821','29129', now()), ('822','72480', now()), ('823','17905', now()), ('824','62228', now()), ('825','19258', now()), ('826','98209', now()), ('827','67589-5128', now()), ('828','01777-5439', now()), ('829','66316-5951', now()), ('830','73412-7462', now()), ('831','06320-6140', now()), ('832','16031', now()), ('833','48241', now()), ('834','23178-6775', now()), ('835','78094', now()), ('836','00251-2582', now()), ('837','59952-6260', now()), ('838','14505-1967', now()), ('839','22268-0365', now()), ('840','84947', now()), ('841','72725-2110', now()), ('842','58724', now()), ('843','14261', now()), ('844','17792-0452', now()), ('845','56588-5996', now()), ('846','83920', now()), ('847','41727-2741', now()), ('848','16792-0737', now()), ('849','53008', now()), ('850','53582', now()), ('851','63505-0662', now()), ('852','30735', now()), ('853','81631-5428', now()), ('854','61300-2400', now()), ('855','07292-4106', now()), ('856','63366-6784', now()), ('857','14486', now()), ('858','06048-4625', now()), ('859','40693-1030', now()), ('860','49265', now()), ('861','84842-2188', now()), ('862','31100', now()), ('863','20633-4661', now()), ('864','95256-8452', now()), ('865','16862-0154', now()), ('866','81886-8302', now()), ('867','95017-1682', now()), ('868','95700-9824', now()), ('869','99150', now()), ('870','10358-3086', now()), ('871','35254-6042', now()), ('872','01009', now()), ('873','54332-4161', now()), ('874','47754-7966', now()), ('875','01164-9121', now()), ('876','67301', now()), ('877','71799', now()), ('878','31318', now()), ('879','39139-6753', now()), ('880','69223', now()), ('881','91133', now()), ('882','96675', now()), ('883','09022-7974', now()), ('884','70106-0022', now()), ('885','75706', now()), ('886','66461', now()), ('887','61171', now()), ('888','61066-7251', now()), ('889','79895-8351', now()), ('890','91196-9518', now()), ('891','36580-9825', now()), ('892','06474-0494', now()), ('893','70454', now()), ('894','66130', now()), ('895','13135', now()), ('896','27925', now()), ('897','84640', now()), ('898','26373-4302', now()), ('899','11755', now()), ('900','28059-1159', now()), ('901','37418-2094', now()), ('902','45546-7096', now()), ('903','67844', now()), ('904','85288-6891', now()), ('905','35077-9395', now()), ('906','22255', now()), ('907','56207-3219', now()), ('908','96867-2046', now()), ('909','07539', now()), ('910','46769-7721', now()), ('911','36462', now()), ('912','83671-5702', now()), ('913','38042-7013', now()), ('914','80111-4663', now()), ('915','25842-2095', now()), ('916','89836-1566', now()), ('917','72945-1094', now()), ('918','23509', now()), ('919','68335-1502', now()), ('920','69256', now()), ('921','00236', now()), ('922','00501', now()), ('923','29356-8528', now()), ('924','02759-9156', now()), ('925','59523', now()), ('926','82116-7579', now()), ('927','40284-0006', now()), ('928','05042', now()), ('929','60419-8164', now()), ('930','52482', now()), ('931','57623', now()), ('932','06204-7984', now()), ('933','50789', now()), ('934','96113-7061', now()), ('935','24738', now()), ('936','84458-1603', now()), ('937','18710-1780', now()), ('938','37260', now()), ('939','19659-3009', now()), ('940','00987-7593', now()), ('941','19315', now()), ('942','47884-4976', now()), ('943','63476', now()), ('944','55222', now()), ('945','35136', now()), ('946','25435', now()), ('947','30699', now()), ('948','36429', now()), ('949','40905', now()), ('950','98444', now()), ('951','42362-2283', now()), ('952','52977', now()), ('953','97689-9980', now()), ('954','61104', now()), ('955','10122', now()), ('956','32193-0554', now()), ('957','98105-5080', now()), ('958','46176-5091', now()), ('959','44700-2009', now()), ('960','73377-9649', now()), ('961','40337', now()), ('962','15542-4341', now()), ('963','01960-0301', now()), ('964','66287-7478', now()), ('965','99714', now()), ('966','78132', now()), ('967','59536', now()), ('968','37059', now()), ('969','16983', now()), ('970','60023-1020', now()), ('971','82360', now()), ('972','18517-6435', now()), ('973','42101-0334', now()), ('974','38040', now()), ('975','99957-2484', now()), ('976','66599-1293', now()), ('977','36791-6800', now()), ('978','49526-7141', now()), ('979','68726', now()), ('980','23211-3970', now()), ('981','62607-7558', now()), ('982','16609', now()), ('983','13969-2689', now()), ('984','80998', now()), ('985','51083', now()), ('986','81051', now()), ('987','83298', now()), ('988','01686-7207', now()), ('989','79111', now()), ('990','57686-7687', now()), ('991','06317', now()), ('992','83638-2940', now()), ('993','10656', now()), ('994','74002-8950', now()), ('995','27544', now()), ('996','49895', now()), ('997','70855', now()), ('998','36545-2345', now()), ('999','99344', now()), ('1000','54511-7260',now());
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 2017-06-18 05:08:49 -- 服务器版本: 10.1.21-MariaDB -- PHP Version: 7.1.1 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: `bisutime` -- -- -------------------------------------------------------- -- -- 表的结构 `gallery` -- CREATE TABLE `gallery` ( `filename` varchar(128) COLLATE utf8_general_mysql500_ci NOT NULL, `photographer` varchar(1024) COLLATE utf8_general_mysql500_ci NOT NULL, `status` int(11) NOT NULL DEFAULT '0', `update_time` datetime NOT NULL, `create_time` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_mysql500_ci; -- -- 转存表中的数据 `gallery` -- INSERT INTO `gallery` (`filename`, `photographer`, `status`, `update_time`, `create_time`) VALUES ('590b43abacee0.jpg', '达叔', 1, '2017-05-04 23:07:23', '2017-05-04 23:07:23'), ('590b442ec67ec.jpg', '东东', 1, '2017-05-04 23:09:34', '2017-05-04 23:09:34'), ('590b443ea0ea8.jpg', '东东', 1, '2017-05-04 23:09:50', '2017-05-04 23:09:50'), ('590b445061924.jpg', '吴岩', 1, '2017-05-04 23:10:08', '2017-05-04 23:10:08'), ('590b44593d9a0.jpg', '吴岩', 1, '2017-05-04 23:10:17', '2017-05-04 23:10:17'); -- -- Indexes for dumped tables -- -- -- Indexes for table `gallery` -- ALTER TABLE `gallery` ADD UNIQUE KEY `filename_2` (`filename`), ADD KEY `filename` (`filename`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
CREATE TABLE FAGSAK_RINASAK_KOBLING ( rina_saksnummer VARCHAR(20) PRIMARY KEY, gsak_saksnummer INTEGER NOT NULL, buc_type VARCHAR(10) NOT NULL ); CREATE INDEX gsak_saksnummer_idx ON FAGSAK_RINASAK_KOBLING(gsak_saksnummer);
<filename>SQL/Exams practice/Databases MSSQL Server Exam - 16 Apr 2019/Destinations Info.sql SELECT f.Destination, COUNT(t.Id) AS FilesCount FROM Flights f LEFT JOIN Tickets t ON t.FlightId = f.Id GROUP BY f.Destination ORDER BY FilesCount DESC, f.Destination
<reponame>giovanibrioni/give-help<filename>scripts/db/createDB.sql CREATE TABLE IF NOT EXISTS USERS ( UserID CHAR(128) PRIMARY KEY NOT NULL, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, Name VARCHAR(512) NOT NULL, Description TEXT DEFAULT NULL, DeviceID VARCHAR(64) DEFAULT NULL, AllowShareData BOOLEAN DEFAULT FALSE, Tags TEXT [] DEFAULT NULL, Images TEXT [] DEFAULT NULL, --Reputation Giver REAL DEFAULT 0, Taker REAL DEFAULT 0, --Contatct URL VARCHAR(512) NOT NULL, Email VARCHAR(512) DEFAULT NULL, Facebook VARCHAR(512) DEFAULT NULL, Instagram VARCHAR(512) DEFAULT NULL, Twitter VARCHAR(512) DEFAULT NULL, AdditionalData TEXT DEFAULT NULL, --Contact Address Address TEXT DEFAULT NULL, City VARCHAR(64) DEFAULT NULL, State VARCHAR(64) DEFAULT NULL, Country VARCHAR(64) DEFAULT NULL, ZipCode INTEGER DEFAULT NULL, Lat NUMERIC(12, 4) DEFAULT NULL, Long NUMERIC(12, 4) DEFAULT NULL, RegisterFrom TEXT DEFAULT '-' ); CREATE INDEX IDX_USERS_USERID ON USERS (UserID); CREATE INDEX IDX_USERS_EMAIL ON USERS (Email); CREATE TABLE IF NOT EXISTS PHONES ( PhoneID SERIAL PRIMARY KEY, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UserID CHAR(128) REFERENCES USERS(UserID), CountryCode VARCHAR(4) DEFAULT '+55', IsDefault BOOLEAN DEFAULT NULL, PhoneNumber VARCHAR(13) NOT NULL, Region CHAR(2) DEFAULT NULL, WhatsApp BOOLEAN DEFAULT NULL ); CREATE INDEX IDX_PHONES_USERID ON PHONES (UserID); CREATE UNIQUE INDEX IDX_PHONES_PHONEID_USERID ON PHONES (PhoneID, UserID); CREATE TABLE IF NOT EXISTS TAGS ( CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, Name TEXT PRIMARY KEY NOT NULL ); CREATE INDEX IDX_TAGS_NAME ON TAGS (Name); CREATE TABLE IF NOT EXISTS PROPOSALS ( ProposalID CHAR(26) PRIMARY KEY NOT NULL, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UserID CHAR(128) REFERENCES USERS(UserID), --Side: offer|request|local-business Side VARCHAR(64) NOT NULL, --ProposalType: job|service|product|finance ProposalType VARCHAR(64) NOT NULL, --Tags: categories Tags TEXT [] DEFAULT NULL, Title TEXT NOT NULL, Description TEXT NOT NULL, ProposalValidate TIMESTAMP DEFAULT NULL, City VARCHAR(64) DEFAULT NULL, State VARCHAR(64) DEFAULT NULL, Country VARCHAR(64) DEFAULT NULL, Lat NUMERIC(12, 4) DEFAULT NULL, Long NUMERIC(12, 4) DEFAULT NULL, Range REAL DEFAULT NULL, AreaTags TEXT [] DEFAULT NULL, IsActive BOOLEAN DEFAULT TRUE, Images TEXT [] DEFAULT NULL, ExposeUserData BOOLEAN DEFAULT FALSE, DataToShare TEXT [] DEFAULT NULL, EstimatedValue NUMERIC(12, 4) DEFAULT NULL, Ranking NUMERIC(12, 8) DEFAULT 0 ); CREATE INDEX IDX_PROPOSALS_PROPOSALID ON PROPOSALS (ProposalID); CREATE INDEX IDX_PROPOSALS_USERID ON PROPOSALS (UserID); CREATE INDEX IDX_PROPOSALS_SIDE ON PROPOSALS (Side); CREATE INDEX IDX_PROPOSALS_TYPE ON PROPOSALS (ProposalType); CREATE TABLE IF NOT EXISTS BANKS ( BankID INTEGER PRIMARY KEY, BankName CHAR(256) NOT NULL, BankFullname TEXT NOT NULL, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE INDEX IDX_BANKS_BANKID ON BANKS (BankID); CREATE TABLE IF NOT EXISTS BANK_ACCOUNTS ( AccountId SERIAL PRIMARY KEY, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, ProposalID CHAR(128) REFERENCES PROPOSALS(ProposalID), BankId INTEGER REFERENCES BANKS(BankId), AccountNumber VARCHAR(16) NOT NULL, AccountDigit VARCHAR(3) DEFAULT NULL, AccountOwner VARCHAR(1024) NOT NULL, AcountDocument VARCHAR(256) NOT NULL, BranchNumber VARCHAR(16) NOT NULL, BranchDigit VARCHAR(3) DEFAULT NULL ); CREATE INDEX IDX_BANK_ACCOUNTS_PROPOSALID ON BANK_ACCOUNTS (ProposalID); CREATE TABLE IF NOT EXISTS TRANSACTIONS ( TransactionID CHAR(26) PRIMARY KEY NOT NULL, ProposalID CHAR(26) REFERENCES PROPOSALS(ProposalID), GiverID CHAR(128) REFERENCES USERS(UserID), TakerID CHAR(128) REFERENCES USERS(UserID), CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, GiverRating REAL DEFAULT 0, GiverReviewComment TEXT DEFAULT NULL, TakerRating REAL DEFAULT 0, TakerReviewComment TEXT DEFAULT NULL, Status VARCHAR(32) NOT NULL ); CREATE INDEX IDX_TRANSACTIONS_TRANSACTIONID ON TRANSACTIONS (TransactionID); CREATE INDEX IDX_TRANSACTIONS_PROPOSALID ON TRANSACTIONS (ProposalID); CREATE INDEX IDX_TRANSACTIONS_GIVERID ON TRANSACTIONS (GiverID); CREATE INDEX IDX_TRANSACTIONS_TAKERID ON TRANSACTIONS (TakerID); --Terms CREATE TABLE IF NOT EXISTS TERMS ( TermID CHAR(26) PRIMARY KEY NOT NULL, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, Title TEXT NOT NULL, Description TEXT NOT NULL, IsActive BOOLEAN DEFAULT TRUE ); CREATE TABLE IF NOT EXISTS TERMS_ACCEPTED ( UserID CHAR(128) REFERENCES USERS(UserID), TermID CHAR(26) REFERENCES TERMS(TermID), CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, Accepted BOOLEAN DEFAULT TRUE ); CREATE UNIQUE INDEX IDX_TERMS_ACCEPTED_USERID_TERM_ID ON TERMS_ACCEPTED (UserID, TermID); CREATE TABLE IF NOT EXISTS COMPLAINTS ( ComplaintID SERIAL PRIMARY KEY, Complainer CHAR(128), ProposalID CHAR(128) REFERENCES PROPOSALS(ProposalID), CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, Comment TEXT NOT NULL, Accepted BOOLEAN DEFAULT TRUE ); CREATE TABLE IF NOT EXISTS ETC ( KEY TEXT PRIMARY KEY NOT NULL, VALUE TEXT NOT NULL, CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, IsActive BOOLEAN DEFAULT TRUE ); CREATE INDEX IDX_ETC_KEY ON ETC (Key); GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA PUBLIC TO AJUDAR; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA PUBLIC TO AJUDAR;
--beginvalidatingquery if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_DatabaseVersion]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) begin declare @ver int exec @ver=sp_DatabaseVersion if (@ver >= 7027) select 0, 'Already correct database version' else if (@ver = 7026) select 1, 'Upgrading database' else select -1, 'Invalid database version detected' end else select -1, 'Not an EPiServer database' --endvalidatingquery GO PRINT N'Creating [dbo].[tblNotificationSubscription]...'; GO CREATE TABLE [dbo].[tblNotificationSubscription]( [pkID] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](50) NOT NULL, [SubscriptionKey] [nvarchar](255) NOT NULL, [Active] BIT NOT NULL DEFAULT 1 CONSTRAINT [PK_tblNotificationSubscription] PRIMARY KEY CLUSTERED([pkID]), ) GO PRINT N'Creating [dbo].[tblNotificationSubscription].[IDX_tblNotificationSubscription_UserName]...'; GO CREATE NONCLUSTERED INDEX [IDX_tblNotificationSubscription_UserName] ON [dbo].[tblNotificationSubscription]([UserName] ASC); GO PRINT N'Creating [dbo].[tblNotificationSubscription].[IDX_tblNotificationSubscription_SubscriptionKey]...'; GO CREATE NONCLUSTERED INDEX [IDX_tblNotificationSubscription_SubscriptionKey] ON [dbo].[tblNotificationSubscription]([SubscriptionKey] ASC); GO PRINT N'Creating [dbo].[netNotificationSubscriptionSubscribe]...'; GO CREATE PROCEDURE [dbo].[netNotificationSubscriptionSubscribe] @UserName [nvarchar](50), @SubscriptionKey [nvarchar](255) AS BEGIN DECLARE @SubscriptionCount INT SELECT @SubscriptionCount = COUNT(*) FROM [dbo].[tblNotificationSubscription] WHERE UserName = @UserName AND SubscriptionKey = @SubscriptionKey AND Active = 1 IF (@SubscriptionCount > 0) BEGIN SELECT 0 RETURN END SELECT @SubscriptionCount = COUNT(*) FROM [dbo].[tblNotificationSubscription] WHERE UserName = @UserName AND SubscriptionKey = @SubscriptionKey AND Active = 0 IF (@SubscriptionCount > 0) UPDATE [dbo].[tblNotificationSubscription] SET Active = 1 WHERE UserName = @UserName AND SubscriptionKey = @SubscriptionKey ELSE INSERT INTO [dbo].[tblNotificationSubscription](UserName, SubscriptionKey) VALUES (@UserName, @SubscriptionKey) SELECT 1 END GO PRINT N'Creating [dbo].[netNotificationSubscriptionUnsubscribe]...'; GO CREATE PROCEDURE [dbo].[netNotificationSubscriptionUnsubscribe] @UserName [nvarchar](50), @SubscriptionKey [nvarchar](255) AS BEGIN DECLARE @SubscriptionCount INT = (SELECT COUNT(*) FROM [dbo].[tblNotificationSubscription] WHERE UserName = @UserName AND SubscriptionKey = @SubscriptionKey AND Active = 1) DECLARE @Result INT = CASE @SubscriptionCount WHEN 0 THEN 0 ELSE 1 END IF (@SubscriptionCount > 0) UPDATE [dbo].[tblNotificationSubscription] SET Active = 0 WHERE UserName = @UserName AND SubscriptionKey = @SubscriptionKey SELECT @Result END GO PRINT N'Creating [dbo].[netNotificationSubscriptionFindSubscribers]...'; GO CREATE PROCEDURE [dbo].[netNotificationSubscriptionFindSubscribers] @SubscriptionKey [nvarchar](255), @Recursive BIT = 1 AS BEGIN DECLARE @key [nvarchar](256) = @SubscriptionKey + CASE @Recursive WHEN 1 THEN '%' ELSE '' END SELECT [pkID], [UserName], [SubscriptionKey] FROM [dbo].[tblNotificationSubscription] WHERE Active = 1 AND SubscriptionKey LIKE @key END GO PRINT N'Creating [dbo].[netNotificationSubscriptionListSubscriptions]...'; GO CREATE PROCEDURE [dbo].[netNotificationSubscriptionListSubscriptions] @UserName [nvarchar](50) AS BEGIN SELECT [pkID], [UserName], [SubscriptionKey] FROM [dbo].[tblNotificationSubscription] WHERE Active = 1 AND UserName = @UserName END GO PRINT N'Creating [dbo].[netNotificationSubscriptionClearUser]...'; GO CREATE PROCEDURE [dbo].[netNotificationSubscriptionClearUser] @UserName [nvarchar](50) AS BEGIN DELETE FROM [dbo].[tblNotificationSubscription] WHERE UserName = @UserName END GO PRINT N'Creating [dbo].[netNotificationSubscriptionClearSubscription]...'; GO CREATE PROCEDURE [dbo].[netNotificationSubscriptionClearSubscription] @SubscriptionKey [nvarchar](255) AS BEGIN DELETE FROM [dbo].[tblNotificationSubscription] WHERE SubscriptionKey LIKE @SubscriptionKey + '%' END GO PRINT N'Altering [dbo].[tblNotificationMessage].[Sender]...'; GO ALTER TABLE [dbo].[tblNotificationMessage] ALTER COLUMN [Sender] NVARCHAR(255) NULL GO PRINT N'Altering [dbo].[tblNotificationMessage].[Recipient]...'; GO ALTER TABLE [dbo].[tblNotificationMessage] ALTER COLUMN [Recipient] NVARCHAR(255) NULL GO PRINT N'Altering [dbo].[tblNotificationSubscription].[UserName]...'; GO ALTER TABLE [dbo].[tblNotificationSubscription] ALTER COLUMN [UserName] [nvarchar](255) NOT NULL GO PRINT N'Update complete.'; GO PRINT N'Altering [dbo].[sp_DatabaseVersion]...'; GO ALTER PROCEDURE [dbo].[sp_DatabaseVersion] AS RETURN 7027 GO PRINT N'Update complete.'; GO
-- SQL tasks from sqlzoo.net /* *************************************************************** ** ** ***** ***** TUTORIAL - 0 ***** ***** ** ** ** *************************************************************** */ -- 1-Task solution: SELECT population FROM world WHERE name = 'Germany' -- 2-Task solution: SELECT name, population FROM world WHERE name IN ('Sweden', 'Norway', 'Denmark'); -- 3-Task solution: SELECT name, area FROM world WHERE area BETWEEN 200000 AND 250000
-- https://www.hackerrank.com/challenges/asian-population/problem?isFullScreen=true SELECT SUM(POPULATION) FROM CITY WHERE COUNTRYCODE IN ( SELECT CODE FROM COUNTRY WHERE CONTINENT = 'Asia' )
<reponame>Mithras11/SoftUni-Software-Engineering<filename>C_Sharp/CSharp DataBases/MS_SQL/IndecesAggregateFunctions/IndecesAggregateFunctions.sql SELECT COUNT(*) AS Count FROM WizzardDeposits ----- SELECT DepositGroup, MAX(MagicWandSize) AS LongestMagicWand FROM WizzardDeposits GROUP BY DepositGroup ----- SELECT TOP(2) DepositGroup FROM WizzardDeposits GROUP BY DepositGroup ORDER BY (AVG(MagicWandSize)) ASC ----- SELECT DepositGroup, SUM(DepositAmount) AS TotalSum FROM WizzardDeposits GROUP BY DepositGroup ---- SELECT DepositGroup, SUM(DepositAmount) AS TotalSum FROM WizzardDeposits WHERE MagicWandCreator='<NAME>' GROUP BY DepositGroup ----- SELECT DepositGroup, SUM(DepositAmount) AS TotalSum FROM WizzardDeposits WHERE MagicWandCreator = 'Ol<NAME>' GROUP BY DepositGroup HAVING SUM(DepositAmount) < 150000 ORDER BY TotalSum DESC ------ SELECT DepositGroup,MagicWandCreator, MIN(DepositCharge) AS MinDepositCharge FROM WizzardDeposits GROUP BY DepositGroup,MagicWandCreator ORDER BY MagicWandCreator, DepositGroup ------ SELECT AgeGroup, COUNT(*) AS WizzardCount FROM (SELECT Age, CASE WHEN Age BETWEEN 0 AND 10 THEN '[0-10]' WHEN Age BETWEEN 11 AND 20 THEN '[11-20]' WHEN Age BETWEEN 21 AND 30 THEN '[21-30]' WHEN Age BETWEEN 31 AND 40 THEN '[31-40]' WHEN Age BETWEEN 41 AND 50 THEN '[41-50]' WHEN Age BETWEEN 51 AND 60 THEN '[51-60]' ELSE '[61+]' END AS AgeGroup FROM WizzardDeposits) AS tmp GROUP BY AgeGroup ------- SELECT LEFT(FirstName,1) FROM WizzardDeposits WHERE DepositGroup='Troll chest' GROUP BY LEFT(FirstName,1) ------ SELECT DepositGroup, IsDepositExpired, AVG(DepositInterest) FROM WizzardDeposits WHERE DepositStartDate > '01/01/1985' GROUP BY DepositGroup, IsDepositExpired ORDER BY DepositGroup DESC, IsDepositExpired ASC ------ SELECT SUM([Difference]) FROM (SELECT FirstName AS Host, DepositAmount AS HostDeposit, LEAD(FirstName) OVER (ORDER BY Id) AS Guest, LEAD(DepositAmount) OVER (ORDER BY Id) AS GuestDeposit, (DepositAmount-LEAD(DepositAmount) OVER (ORDER BY Id)) AS Difference FROM WizzardDeposits) AS TMP ------ USE SoftUni SELECT DepartmentID, SUM(Salary) AS TotalSalary FROM Employees GROUP BY DepartmentID ------ SELECT DepartmentID, MIN(SALARY) AS MinimumSalary FROM Employees WHERE DepartmentID IN (2, 5, 7) AND HireDate > '01-01-2000' GROUP BY DepartmentID ------- SELECT DepartmentID, Salary, ManagerID INTO NewTable FROM Employees WHERE SALARY > 30000 DELETE FROM NewTable WHERE ManagerID = 42 UPDATE NewTable SET SALARY += 5000 WHERE DepartmentID = 1 SELECT DepartmentID, AVG(Salary) FROM NewTable GROUP BY DepartmentID ------- SELECT DepartmentID, MAX(Salary) AS MaxSalary FROM Employees GROUP BY DepartmentID HAVING MAX(Salary) NOT BETWEEN 30000 AND 70000 ----- SELECT COUNT(*) AS [Count] FROM Employees WHERE ManagerID IS NULL ------- SELECT DISTINCT DepartmentID, Salary AS ThirdHighestSalary FROM (SELECT DepartmentID, Salary, DENSE_RANK() OVER (PARTITION BY DepartmentID ORDER BY Salary DESC) AS SalaryRank FROM Employees) AS TMP WHERE SalaryRank=3 ------- SELECT TOP(10) e.FirstName, e.LastName, --e.Salary, e.DepartmentID --t.AvgSalary FROM Employees AS e JOIN (SELECT DepartmentID, AVG(Salary) AS AvgSalary FROM Employees GROUP BY DepartmentID) AS t ON e.DepartmentID = t.DepartmentID WHERE Salary > AvgSalary ORDER BY e.DepartmentID
<filename>src/cli/bundled/sql/Profile.sql<gh_stars>1-10 CREATE TABLE profile ( id String, can_post Nullable(UInt8), link Nullable(String), name Nullable(String), pic Nullable(String), pic_large Nullable(String), pic_small Nullable(String), pic_square Nullable(String), profile_type Nullable(String), username Nullable(String) ) ENGINE = Log
<reponame>bhikkhu-kosalla-china/mint -- Your SQL goes here CREATE TABLE groups_users ( id SERIAL PRIMARY KEY, group_id INTEGER NOT NULL, user_id INTEGER NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE UNIQUE INDEX group_user_id ON groups_users (group_id,user_id);
-- phpMyAdmin SQL Dump -- version 4.9.5 -- https://www.phpmyadmin.net/ -- -- Хост: localhost:3306 -- Время создания: Июн 17 2021 г., 19:32 -- Версия сервера: 10.3.29-MariaDB-cll-lve -- Версия PHP: 7.3.28 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 */; -- -- База данных: `vprokit_test` -- -- -------------------------------------------------------- -- -- Структура таблицы `logins` -- CREATE TABLE `logins` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `token` text CHARACTER SET utf8mb4 NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Структура таблицы `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `login` text CHARACTER SET utf8mb4 NOT NULL, `password` text CHARACTER SET utf8mb4 NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Дамп данных таблицы `users` -- INSERT INTO `users` (`id`, `login`, `password`, `created_at`, `updated_at`) VALUES (1, 'user1', <PASSWORD>', '2021-06-17 15:38:58', '2021-06-17 15:38:58'), (2, 'user2', <PASSWORD>', '2021-06-17 15:39:05', '2021-06-17 15:39:05'); -- -------------------------------------------------------- -- -- Структура таблицы `works` -- CREATE TABLE `works` ( `id` int(11) NOT NULL, `work` text CHARACTER SET utf8mb4 NOT NULL, `done` int(11) NOT NULL DEFAULT 0 COMMENT '0 - не выполнено. если задача выполнена указывается id пользователя', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Индексы сохранённых таблиц -- -- -- Индексы таблицы `logins` -- ALTER TABLE `logins` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `works` -- ALTER TABLE `works` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT для сохранённых таблиц -- -- -- AUTO_INCREMENT для таблицы `logins` -- ALTER TABLE `logins` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT для таблицы `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT для таблицы `works` -- ALTER TABLE `works` MODIFY `id` int(11) 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 */;
<reponame>perevist/PZ_space_station_backend DROP ALL OBJECTS; -- create tables -- CREATE TABLE rooms ( id BIGINT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(45), floor INT NOT NULL, number_of_worksites BIGINT NOT NULL, dimension_x BIGINT NOT NULL, dimension_y BIGINT NOT NULL ); CREATE TABLE worksites ( id BIGINT AUTO_INCREMENT PRIMARY KEY, room_id BIGINT NOT NULL, worksite_in_room_id BIGINT NOT NULL, coordinate_x BIGINT NOT NULL, coordinate_y BIGINT NOT NULL, FOREIGN KEY (room_id) REFERENCES rooms(id) ON DELETE CASCADE ); CREATE TABLE reservations ( id BIGINT AUTO_INCREMENT PRIMARY KEY, start_date DATE NOT NULL, end_date DATE NOT NULL, worksite_id BIGINT NOT NULL, reservation_maker_id VARCHAR(255) NOT NULL, owner_id VARCHAR(255) NOT NULL, FOREIGN KEY (worksite_id) REFERENCES worksites(id) ON DELETE CASCADE ); -- insert data -- INSERT INTO rooms (name, floor, number_of_worksites, dimension_x, dimension_y) VALUES ('Pokój 1', 1, 2, 2, 1), ('Pokój 2', 1, 4, 2, 2), ('Pokój 3', 1, 3, 1, 4), ('Pokój 4', 1, 6, 3, 2), ('Pokój 5', 2, 6, 2, 3), ('Pokój 6', 2, 3, 1, 3), ('Pokój 7', 2, 2, 3, 1); INSERT INTO worksites (room_id, worksite_in_room_id, coordinate_x, coordinate_y) VALUES (1, 1, 1, 1), (1, 2, 2, 1), (2, 1, 1, 1), (2, 2, 1, 2), (2, 3, 2, 1), (2, 4, 2, 2), (3, 1, 1, 1), (3, 2, 1, 2), (3, 3, 1, 3), (4, 1, 1, 1), (4, 2, 1, 2), (4, 3, 2, 1), (4, 4, 2, 2), (4, 5, 3, 1), (4, 6, 3, 2), (5, 1, 1, 1), (5, 2, 1, 2), (5, 3, 2, 1), (5, 4, 2, 2), (5, 5, 3, 1), (5, 6, 3, 2), (6, 1, 1, 1), (6, 2, 1, 2), (6, 3, 1, 3), (7, 1, 1, 1), (7, 2, 2, 1); INSERT INTO reservations (start_date, end_date, worksite_id, reservation_maker_id, owner_id) VALUES ('2021-02-20', '2021-02-22', 1, 'e09f65d2-3186-4fee-9d4a-3d0dca09e072', 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7'), ('2021-02-20', '2021-02-22', 2, 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7', 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7'), ('2021-02-20', '2021-02-22', 3, 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7', 'e09f65d2-3186-4fee-9d4a-3d0dca09e072'), ('2021-03-21', '2021-03-24', 2, 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7', 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7'), ('2021-03-20', '2021-03-21', 1, 'e09f65d2-3186-4fee-9d4a-3d0dca09e072', 'e09f65d2-3186-4fee-9d4a-3d0dca09e072'), ('2021-03-26', '2021-03-30', 1, 'e09f65d2-3186-4fee-9d4a-3d0dca09e072', 'e09f65d2-3186-4fee-9d4a-3d0dca09e072'), ('2021-03-27', '2021-03-29', 2, 'e09f65d2-3186-4fee-9d4a-3d0dca09e072', 'e65b0ee2-11a1-4f1d-9bdd-7989a5305bb7');
INSERT INTO `binary` VALUES ( 0, x'ee72ae0aef354c5d94ffe82f696af30d'), ( 1, x'2dad56480dbd4a00a1aed85a3fbc6c3d'), ( 2, x'a35b4b77c45349d79faa41041efad77b'), ( 3, x'950a780f93b840109a97a8c60304ef69'), ( 4, x'73da4e0f11714304b781c2339e5c3973'), ( 5, x'0a3c47cc54ea4ce3bb917006985bf31a'), ( 6, x'd03a918aa5454cfd8400cc37490505a9'), ( 7, x'1d0f15874a93418e9b70197594e5bc8b'), ( 8, x'd5019bd872194b868b5f8d0ed4b0aed5'), ( 9, x'b292179cdf0c459291dcfb8b95afc3e8'), (10, x'3f0f41aa5468468ab90c42eb02e909d2'), (11, x'a6175ce6b6a74e63a784b1b4ab4a4c70'), (12, x'a7dae6d2275e4ffd86dcba5c00e48fe5'), (13, x'b07b158d46174c8a90791667c5545cc4'), (14, x'7f8e4fae730a4faf86a1a4e5b1447fab'), (15, x'13364cf3a5174f7eb78ebd6177af0e93'), (16, x'35a044893d1c40f9a2414c23e5a5f5bd'), (17, x'97197ef428044b84a36190a3384402aa'), (18, x'598555572132484989805b8fac90304b'), (19, x'f2e49556fd864f68a10789eafb4009ca'), (20, x'ca63c5d01b6945068fdae901ed855698'), (21, x'2e17ff04fa374fd6a6f92d09f4ef4a5f'), (22, x'9d65d2fc85d74c3a88f8cba092903980'), (23, x'4b0d0e94201a45ac89c410b4fefb8d95'), (24, x'a290faa6ee5241179702a69961b46c3b'), (25, x'61270388bd744edf9089638806efe0a9'), (26, x'6e54e72c08784a88991e285c49945525'), (27, x'308d6c267c3d4b25a68c7a1435b1a4f6'), (28, x'2944629d7fef4dc0b4472ef100718837'), (29, x'fde1328c409c43a8b1b08c35c8000f92'), (30, x'ba4274c329e8413cbe87611e4570f999'), (31, x'6bd41abb12ea44899c47cfc4b43e1ed3'), (32, x'123d777433c14deaaeadec5b5bae772c'), (33, x'42e7ffe70e084e6fa079e9596d7f0b83'), (34, x'115bc64364f0456e8523bd8286c39446'), (35, x'd9d0233306bb4e648820ef426e089d8a'), (36, x'f48888bc0d614963907db98f3a7766b6'), (37, x'a913d4bacc4c4c479fb9271bede8015e'), (38, x'c567fa2b4f8e4f39896d52e59ea92e87'), (39, x'4015636d2bf543978c6b32d145e7592c'), (40, x'41832db1800046bea4f27f22b61bb5e7'), (41, x'55dc0343db6a420898729096305b8c07'), (42, x'22e65824c67a4ae1b89d997bc6ee29d4'), (43, x'090abbb2f22e4f97a4fea52eb1a80a0b'), (44, x'90553b8ae4c442e08fc3f20320b1110b'), (45, x'43626db940334c75bc11ea41099565cf'), (46, x'747b4c36678948a8921763afbee2dd15'), (47, x'a5e015d13d76447eaf8fb834007481e9'), (48, x'b75264a7e7074df187a2b9052ad4e36d'), (49, x'45cd65089a064ab781406a84a109faef');
<reponame>olegshulyakov/sedc CREATE TABLE SNAPSHOT_FXRATE ( SX_ID NUMERIC(18) NOT NULL DEFAULT nextval('S_SNAPSHOT_FXRATE_PK'), SCEI_ID NUMERIC(18) NOT NULL, SYM_ID NUMERIC(18) NOT NULL, BUSINESS_DATE DATE NOT NULL, ID VARCHAR(20) NOT NULL, NAME VARCHAR(20) NOT NULL, DATE DATE NOT NULL, TIME TIME NOT NULL, ASK NUMERIC(18) NOT NULL, BID NUMERIC(18) NOT NULL, CONSTRAINT IPK_SNAPSHOT_FXRATE PRIMARY KEY (SX_ID) ); ALTER TABLE SNAPSHOT_FXRATE ADD CONSTRAINT IFK_SYMBOL FOREIGN KEY (SYM_ID) REFERENCES SYMBOL (SYM_ID); ALTER TABLE SNAPSHOT_FXRATE ADD CONSTRAINT IFK_SOURCE_CENTER_ENGINE_INSTANCE FOREIGN KEY (SCEI_ID) REFERENCES SOURCE_CENTER_ENGINE_INSTANCE (SCEI_ID);
<reponame>enroute-mobi/edwig -- +migrate Up -- SQL in section 'Up' is executed when this migration is applied ALTER TABLE referentials ADD COLUMN tokens text; -- +migrate Down -- SQL section 'Down' is executed when this migration is rolled back ALTER TABLE referentials DROP COLUMN IF EXISTS tokens;
select '{{ var("required") }}'::varchar as field
<reponame>pdv-ru/ClickHouse<gh_stars>1000+ drop table if exists X; drop table if exists Y; create table X (id Int32, x_name String) engine Memory; create table Y (id Int32, y_name String) engine Memory; insert into X (id, x_name) values (1, 'A'), (2, 'B'), (2, 'C'), (3, 'D'), (4, 'E'), (4, 'F'), (5, 'G'), (8, 'H'), (9, 'I'); insert into Y (id, y_name) values (1, 'a'), (1, 'b'), (2, 'c'), (3, 'd'), (3, 'e'), (4, 'f'), (6, 'g'), (7, 'h'), (9, 'i'); select 'inner'; select X.*, Y.* from X inner join Y using id; select 'inner subs'; select s.*, j.* from (select * from X) as s inner join (select * from Y) as j using id; select 'left'; select X.*, Y.* from X left join Y using id; select 'left subs'; select s.*, j.* from (select * from X) as s left join (select * from Y) as j using id; select 'right'; select X.*, Y.* from X right join Y using id order by id; select 'right subs'; select s.*, j.* from (select * from X) as s right join (select * from Y) as j using id order by id; select 'full'; select X.*, Y.* from X full join Y using id order by id; select 'full subs'; select s.*, j.* from (select * from X) as s full join (select * from Y) as j using id order by id; drop table X; drop table Y;
<filename>src/test/tinc/tincrepo/query/cte/sql/cte_functest_43.sql -- @author prabhd -- @created 2013-02-01 12:00:00 -- @modified 2013-02-01 12:00:00 -- @tags cte -- @product_version gpdb: [4.3-],hawq: [1.1-] -- @db_name world_db -- @description test23: CTE with Percentile function WITH v AS (SELECT a, b FROM foo WHERE b < 5) select median(a) from v;
<gh_stars>0 CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE TABLE public."user" ( id UUID NOT NULL CONSTRAINT user_pkey PRIMARY KEY DEFAULT uuid_generate_v4(), time_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, time_updated TIMESTAMP, deleted BOOLEAN NOT NULL DEFAULT FALSE, username VARCHAR(30) NOT NULL UNIQUE, email VARCHAR(254) NOT NULL UNIQUE, password VARCHAR(64) NOT NULL, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, phone_number VARCHAR(100) NOT NULL UNIQUE, accepted BOOLEAN NOT NULL DEFAULT FALSE, role VARCHAR(32) NOT NULL );