sql
stringlengths
6
1.05M
--[er] test with keyword all and distinct create class t1 (c1 int, c2 char(1)); insert into t1 values (1, 'x'); insert into t1 values (null, null); insert into t1 values (2, 'x'); insert into t1 values (1, 'x'); insert into t1 values (null, 'y'); insert into t1 values (1, 'x'); insert into t1 values (null, null); insert into t1 values (2, 'x'); insert into t1 values (1, 'x'); insert into t1 values (null, 'y'); select all c1, distinct c2 from t1; select all c2, distinct c1 from t1; drop class t1;
<gh_stars>0 DROP TABLE IF EXISTS locations; CREATE TABLE locations ( id SERIAL PRIMARY KEY, search_query VARCHAR(255), formatted_query VARCHAR(255), latitude NUMERIC(10, 7), longitude NUMERIC(10, 7) ); INSERT INTO locations (search_query, formatted_query, latitude, longitude) VALUES ('Seattle', 'Seattle, King County, Washington, USA', '47.6173', '122.3195'); SELECT * FROM locations;
create table if not exists USER ( USE_ID int not null primary key, USE_NAME varchar(100), USE_SEX varchar(1), USE_AGE int);
<filename>seeds.sql INSERT INTO products ( product_name, department_name, price, stock_quantity) VALUES ("corgis", "pets", 3000.00, 10), ("pugs", "pets", 2700.00, 10), ("llama", "pets", 8000.00, 1), ("penguins", "pets", 10.00, 5);
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 01, 2021 at 07:05 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `projectmanagementpoche` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `email` varchar(200) NOT NULL, `mobile` varchar(200) NOT NULL, `designation` varchar(200) NOT NULL, `user_type` int(11) NOT NULL, `password` varchar(200) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `notification` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `name`, `email`, `mobile`, `designation`, `user_type`, `password`, `created_at`, `created_by`, `deleted_at`, `deleted_by`, `notification`, `status`) VALUES (1, '<NAME>', '<EMAIL>', '01917039169', 'Manager IT', 2, '$2y$10$iKNGOdVjEHdt.nv9ZmnuUuvziTOESd3gqkZv2yfsCUWRx2NRnsaXa', '2021-07-29 01:34:25', 1, '2021-07-29 01:44:07', 1, 0, 1), (2, '<NAME>', '<EMAIL>', '01010101010', 'Intern IT', 2, '$2y$10$kmE0LEIaHb7r/PRCmBWUv.vFpS5lwedC24gZnKkxtA0yzDCpF0h7W', '2021-07-29 02:39:58', 1, NULL, 0, 0, 1); -- -------------------------------------------------------- -- -- Table structure for table `adminusertype` -- CREATE TABLE `adminusertype` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `created_by` int(11) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `deleted_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `adminusertype` -- INSERT INTO `adminusertype` (`id`, `name`, `created_by`, `created_at`, `deleted_by`, `deleted_at`, `status`) VALUES (1, 'Super Admin', 0, '2021-07-29 06:27:35', 0, NULL, 1), (2, 'Admin', 0, '2021-07-29 06:27:35', 0, NULL, 1), (3, 'Manager', 0, '2021-07-29 06:27:35', 0, NULL, 1), (4, 'Accounts', 0, '2021-07-29 06:27:35', 0, NULL, 1), (5, 'User', 0, '2021-07-29 06:27:35', 0, NULL, 1); -- -------------------------------------------------------- -- -- Table structure for table `company` -- CREATE TABLE `company` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `address` varchar(200) NOT NULL, `total_projects` int(11) NOT NULL DEFAULT 0, `total_projects_value` float NOT NULL DEFAULT 0, `total_paid_amount` float NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `notification` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `extra` -- CREATE TABLE `extra` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `value` varchar(200) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `paymentmethods` -- CREATE TABLE `paymentmethods` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `details` text NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `payments` -- CREATE TABLE `payments` ( `id` int(11) NOT NULL, `payment_methods_id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, `phase_id` int(11) NOT NULL DEFAULT 0, `received_by` int(11) NOT NULL, `payment_date` timestamp NULL DEFAULT NULL, `paid_amount` float NOT NULL, `due_before_payment` float NOT NULL, `due_after_payment` float NOT NULL, `cheque_number` varchar(200) DEFAULT NULL, `cheque_bank` varchar(200) DEFAULT NULL, `card_number` varchar(200) DEFAULT NULL, `transaction_number` varchar(200) DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `phase` -- CREATE TABLE `phase` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `expected_complete_date` timestamp NULL DEFAULT NULL, `milestone_value` float NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `phasedetails` -- CREATE TABLE `phasedetails` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, `phase_id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `expected_complete_date` timestamp NULL DEFAULT NULL, `milestone_value` float NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `phasedetailsfiles` -- CREATE TABLE `phasedetailsfiles` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, `phase_id` int(11) NOT NULL, `phase_details_id` int(11) NOT NULL, `file_name` varchar(200) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `phasefiles` -- CREATE TABLE `phasefiles` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, `phase_id` int(11) NOT NULL, `file_name` varchar(200) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `project` -- CREATE TABLE `project` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `project_value` float NOT NULL, `standard_days` float NOT NULL, `contract_sign_date` timestamp NULL DEFAULT NULL, `starting_date` timestamp NULL DEFAULT NULL, `project_duration` float NOT NULL, `finishing_date` timestamp NULL DEFAULT NULL, `total_hours_of_work` float NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `designation` varchar(200) NOT NULL, `mobile` varchar(200) NOT NULL, `email` varchar(200) NOT NULL, `user_type` int(11) NOT NULL, `password` varchar(200) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `usertype` -- CREATE TABLE `usertype` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_by` int(11) NOT NULL DEFAULT 0, `deleted_at` timestamp NULL DEFAULT NULL, `deleted_by` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `adminusertype` -- ALTER TABLE `adminusertype` ADD PRIMARY KEY (`id`); -- -- Indexes for table `company` -- ALTER TABLE `company` ADD PRIMARY KEY (`id`); -- -- Indexes for table `extra` -- ALTER TABLE `extra` ADD PRIMARY KEY (`id`); -- -- Indexes for table `paymentmethods` -- ALTER TABLE `paymentmethods` ADD PRIMARY KEY (`id`); -- -- Indexes for table `payments` -- ALTER TABLE `payments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `phase` -- ALTER TABLE `phase` ADD PRIMARY KEY (`id`); -- -- Indexes for table `phasedetails` -- ALTER TABLE `phasedetails` ADD PRIMARY KEY (`id`); -- -- Indexes for table `phasedetailsfiles` -- ALTER TABLE `phasedetailsfiles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `phasefiles` -- ALTER TABLE `phasefiles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `project` -- ALTER TABLE `project` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- Indexes for table `usertype` -- ALTER TABLE `usertype` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `adminusertype` -- ALTER TABLE `adminusertype` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `company` -- ALTER TABLE `company` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `extra` -- ALTER TABLE `extra` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `paymentmethods` -- ALTER TABLE `paymentmethods` 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 `phase` -- ALTER TABLE `phase` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `phasedetails` -- ALTER TABLE `phasedetails` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `phasedetailsfiles` -- ALTER TABLE `phasedetailsfiles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `phasefiles` -- ALTER TABLE `phasefiles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `project` -- ALTER TABLE `project` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `usertype` -- ALTER TABLE `usertype` 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 */;
/* * DML - Data Modification Language * DML is used for adding (inserting), deleting, and modifying (updating) data in a database */ INSERT INTO client(first_name, last_name, email_address, account_type, extra) VALUES ('Jon', 'Snow', '<EMAIL>', 'margin', 'I am <NAME>.'), ('Harry', 'Potter', '<EMAIL>', 'cash', 'Im a wizard.'), ('Cathie', 'Wood', '<EMAIL>', 'cash', 'Buy the dip.'), ('test', 'guy', '<EMAIL>', 'cash', 'please dont break'); INSERT INTO stock (client_id, ticker, shares, purchased_value, purchased_date) VALUES (1, 'AMZN', 100, 100, '05/10/2005'), (1, 'GOOGL', 50, 200, '06/29/2009'), (2, 'MGIC', 1337, 15, '03/24/2021'), (2, 'T', 7331, 20, '06/14/2003'), (3, 'ONV', 674454, 10, '03/10/2021'), (3, 'CERS', 29572265, 6, '03/10/2021'), (3, 'PSTG', 41161248, 19, '03/10/2021'), (4, 'test', 1337, 1337, '10/10/1010'), (4, 'boo', 9999, 1, '10/10/6010'), (4, 'blah', 2, 10, '2/10/2010'), (4, 'reee', 65, 56, '10/10/8010');
-- CreateTable CREATE TABLE "usuario" ( "nombre" VARCHAR(30)[], "apellido" VARCHAR(30) NOT NULL, "user" VARCHAR(20) NOT NULL, "password" VARCHAR(20) NOT NULL, PRIMARY KEY ("user") ); -- CreateTable CREATE TABLE "producto" ( "id" BIGINT NOT NULL, "nombre" VARCHAR(40), "descripcion" VARCHAR(255), PRIMARY KEY ("id") );
CREATE TABLE [Rulebase].[VALDP_ValidationError] ( [UKPRN] INT NOT NULL, [ErrorString] VARCHAR (2000) NULL, [FieldValues] VARCHAR (2000) NULL, [LearnRefNumber] VARCHAR (100) NOT NULL, [RuleId] VARCHAR (50) NULL, CONSTRAINT [PK_VALDP_ValidationError] PRIMARY KEY ([UKPRN], [LearnRefNumber]) );
create or replace procedure p_create_stats_type(_title varchar, _icon_path varchar, _postfix varchar) language plpgsql as $$ declare item_id UUID; icon_id UUID; begin insert into stats_types (title, postfix, icon) values (_title, _postfix, null) returning id into item_id; call p_create_resource(_icon_path, 'image', item_id, icon_id); update stats_types set icon = icon_id where id = item_id; end $$
-- Your SQL goes here CREATE TABLE IF NOT EXISTS clients ( id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL );
CREATE PROCEDURE [dbo].[uspMessageUpdateReadStatus] @messageId int, @readByFirst NVARCHAR(250) AS BEGIN SET NOCOUNT ON BEGIN TRY BEGIN DECLARE @currentReadBy NVARCHAR(250) SELECT @currentReadBy = ReadByFirst FROM [Message] WHERE MessageId = @messageId IF @currentReadBy IS NULL BEGIN UPDATE [Message] Set IsRead = 1, ReadByFirst = @readByFirst, ReadDate = GETDATE() Where MessageId = @messageId END -- ELSE Do nothing, everything is already set END END TRY BEGIN CATCH EXEC RethrowError; END CATCH SET NOCOUNT OFF END
-- after "FROM purchases" add code to get all rows for which the "name" column starts with "pudding" SELECT * FROM purchases WHERE name LIKE "pudding%";
<reponame>Shuttl-Tech/antlr_psql -- file:triggers.sql ln:18 expect:true insert into pkeys values (60, '6')
<gh_stars>10-100 SET NAMES 'utf8'; DROP TABLE IF EXISTS `countries`; CREATE TABLE `countries` ( `short` char(2) NOT NULL, `name` varchar(80) NOT NULL, `trans_id` int(10) NOT NULL, `de` varchar(128) NOT NULL COMMENT 'obsolete', `en` varchar(128) NOT NULL, `list_default_de` int(1) NOT NULL DEFAULT '0' COMMENT 'obsolete', `sort_de` varchar(128) NOT NULL COMMENT 'obsolete', `list_default_en` int(1) NOT NULL DEFAULT '0' COMMENT 'obsolete', `sort_en` varchar(128) NOT NULL COMMENT 'obsolete', PRIMARY KEY (`short`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='static content' ;
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES (NULL); INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID, OBJ_ID, VER_NBR, PERM_ID, KIM_TYP_ID, KIM_ATTR_DEFN_ID, ATTR_VAL) VALUES ((SELECT MAX(ID) FROM KRIM_ATTR_DATA_ID_BS_S), UUID(), 1, (SELECT PERM_ID FROM KRIM_PERM_T WHERE NM = 'Modify Proposal Rates'), (SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'Document Section'), (SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NM = 'sectionName'), 'budget'); INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES (NULL); INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID, OBJ_ID, VER_NBR, PERM_ID, KIM_TYP_ID, KIM_ATTR_DEFN_ID, ATTR_VAL) VALUES ((SELECT MAX(ID) FROM KRIM_ATTR_DATA_ID_BS_S), UUID(), 1, (SELECT PERM_ID FROM KRIM_PERM_T WHERE NM = 'Modify Proposal Rates'), (SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'Document Section'), (SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NM = 'documentTypeName'), 'ProposalDevelopmentDocument');
<reponame>smith750/kc DELIMITER / INSERT INTO KRCR_CMPNT_T (NMSPC_CD, CMPNT_CD, NM, ACTV_IND, OBJ_ID, VER_NBR) values ('KC-S2S', 'All', 'All', 'Y', UUID(), 1) / DELIMITER ;
ALTER TABLE db_version CHANGE COLUMN required_12000_01_mangos_spell_template required_12012_01_mangos_spell_template bit; DELETE FROM spell_template WHERE id IN (23363, 25192); INSERT INTO spell_template VALUES (23363, 0x00000000, 101, 21, 76, 18, 0, 0, 179804, 0, 'Summon Drakonid Corpse Trigger'), (25192, 0x00000000, 101, 21, 76, 18, 0, 0, 180619, 0, 'Summon Ossirian Crystal');
<filename>sql/V10.10.18__licences.sql insert into product_type (name, discount_type, external_id, alias) values('Лицензии', 1, 0, 'Licences')
<filename>azkaban-sql/src/sql/update.user_manager.sql ALTER TABLE `azkaban_group_manager` ADD `yarn_flag_name` varchar(50) COMMENT 'yarn falg';
CREATE TABLE [conform].[fct_Teacher_Course_Schedule] ( [Academic_Year_Name] CHAR (9) NULL, [District_Id] VARCHAR (16) NULL, [Calendar_Track_Cd] VARCHAR (30) NULL, [Calendar_Track_School_Id] VARCHAR (16) NULL, [Term_Cd] VARCHAR (30) NULL, [Course_Cd] VARCHAR (30) NULL, [Course_School_Id] VARCHAR (16) NULL, [Course_Section_Identifier] VARCHAR (50) NULL, [Local_Staff_Id] VARCHAR (32) NULL, [School_Id] VARCHAR (16) NULL, [Cycle_Day_Cd] VARCHAR (30) NULL, [Start-Period_Cd] VARCHAR (30) NULL, [Start-Period_School_Id] VARCHAR (16) NULL, [End-Period_Cd] VARCHAR (30) NULL, [End-Period_School_Id] VARCHAR (16) NULL, [Entered-Date_Of_Day] DATE NULL, [Exited-Date_Of_Day] DATE NULL, [Entered_Calendar_Date] DATE NULL, [Exited_Calendar_Date] DATE NULL, [Course_Enroll_Count] DECIMAL (9, 2) NULL, [Primary_Secondary_CD] CHAR (2) NULL, [Batch_Period] VARCHAR (50) NULL, [SAID] VARCHAR (30) NULL, [Date_Stamp] DATETIME2 (7) NULL, [SourceIdentifier] VARCHAR (50) NULL );
CREATE TABLE `ORDER` ( ID BIGINT PRIMARY KEY AUTO_INCREMENT, USER_ID BIGINT, TOTAL_PRICE DECIMAL, ADDRESS VARCHAR(1024), EXPRESS_COMPANY VARCHAR(16), EXPRESS_ID VARCHAR(128), STATUS VARCHAR(16), -- PENDING 待付款 PAID 已付款 DELIVERED 物流中 RECEIVED 已收货 CREATED_AT TIMESTAMP NOT NULL DEFAULT NOW(), UPDATED_AT TIMESTAMP NOT NULL DEFAULT NOW() ); CREATE TABLE `ORDER_GOODS` ( ID BIGINT PRIMARY KEY AUTO_INCREMENT, GOODS_ID BIGINT, NUMBER DECIMAL )
CREATE TABLE ROOM( ROOM_ID BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(16) NOT NULL, ROOM_NUMBER CHAR(2) NOT NULL UNIQUE, BED_INFO CHAR(2) NOT NULL ); CREATE TABLE GUEST( GUEST_ID BIGINT AUTO_INCREMENT PRIMARY KEY, FIRST_NAME VARCHAR(64), LAST_NAME VARCHAR(64), EMAIL_ADDRESS VARCHAR(64), ADDRESS VARCHAR(64), COUNTRY VARCHAR(32), STATE VARCHAR(12), PHONE_NUMBER VARCHAR(24) ); CREATE TABLE RESERVATION( RESERVATION_ID BIGINT AUTO_INCREMENT PRIMARY KEY, ROOM_ID BIGINT NOT NULL, GUEST_ID BIGINT NOT NULL, RES_DATE DATE ); ALTER TABLE RESERVATION ADD FOREIGN KEY (ROOM_ID) REFERENCES ROOM(ROOM_ID); ALTER TABLE RESERVATION ADD FOREIGN KEY (GUEST_ID) REFERENCES GUEST(GUEST_ID); CREATE INDEX IDX_RES_DATE_ ON RESERVATION(RES_DATE);
-- Do we have a correlation between a book's title's length and its review ratings? SELECT width_bucket(length(product_title), 1, 50, 5) title_length_bucket ,round(avg(review_rating), 2) AS review_average ,count(*) FROM customer_reviews WHERE product_group = 'Book' GROUP BY title_length_bucket ORDER BY title_length_bucket ;
create database if not exists raw; use raw; CREATE TABLE if not exists `employee`( `empno` int, `name` string, `deptno` int, `salary` string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\u0001' COLLECTION ITEMS TERMINATED BY '\u0002' MAP KEYS TERMINATED BY '\u0003' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'; CREATE TABLE if not exists `department`( `deptno` int, `deptname` string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\u0001' COLLECTION ITEMS TERMINATED BY '\u0002' MAP KEYS TERMINATED BY '\u0003' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'; CREATE TABLE if not exists `current_employee`( `empname` string, `deptname` string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\u0001' COLLECTION ITEMS TERMINATED BY '\u0002' MAP KEYS TERMINATED BY '\u0003' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'; CREATE TABLE if not exists `current_employee_2`( `salary` string, `deptname` string, `empname` string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\u0001' COLLECTION ITEMS TERMINATED BY '\u0002' MAP KEYS TERMINATED BY '\u0003' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'; add jar /home/cloudera/hive-plugin-1.1-SNAPSHOT-jar-with-dependencies.jar; set hive.exec.post.hooks=com.wipro.ats.bdre.hiveplugin.hook.LineageHook; insert overwrite table current_employee_2 select e.salary, d.deptname, e.name from employee e, department d where e.deptno = d.deptno;
<filename>juxta-ws/scripts/update_1_7_8.sql<gh_stars>10-100 truncate table juxta_schema_version; insert into juxta_schema_version (major, minor, micro) values ( '1','7,','8'); truncate table juxta_collation_cache; alter table juxta_collation_cache modify column `data_type` enum('HEATMAP','SIDEBYSIDE','CONDENSED_HEATMAP','EDITION','EXPORT') NOT NULL;
--# Copyright IBM Corp. All Rights Reserved. --# SPDX-License-Identifier: Apache-2.0 /* * Mimic Statistics for tables, columns, indexes etc * * From (and optionally offline copy of) the following catalog views * * SYSCAT.TABLES * SYSCAT.COLUMN * SYSCAT.COLDIST * etc * * Update the statistics of a copy your given tables * * I.e. do what db2look does in -m mimic mode, but via SQL.. * * Currently only coded for TABLE stats. INDEX, COLUMN, COLDIST, GOLCOUP, VIEW stats are a TO-DO * * guidelines that you should follow when updating statistics in the SYSSTAT.TABLES catalog view. * https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.admin.perf.doc/doc/c0005124.html * */ -- Table stats BEGIN FOR C AS cur CURSOR WITH HOLD FOR SELECT TABNAME vTABNAME, TABSCHEMA vTABSCHEMA , CARD vCARD, NPAGES vNPAGES--, MPAGES vMPAGES -- Not sure if MPAGES (col meta pages) needs to be updated. It gives SQL1227N sometimes , FPAGES vFPAGES, OVERFLOW vOVERFLOW, ACTIVE_BLOCKS vACTIVE_BLOCKS FROM TABLES WHERE TYPE = 'T' AND TABSCHEMA = 'your schema' AND TABNAME IN ('your tables') MINUS SELECT TABNAME vTABNAME, TABSCHEMA vTABSCHEMA , CARD vCARD, NPAGES vNPAGES--, MPAGES vMPAGES , FPAGES vFPAGES, OVERFLOW vOVERFLOW, ACTIVE_BLOCKS vACTIVE_BLOCKS FROM SYSCAT.TABLES ORDER BY vTABSCHEMA, vTABNAME DO UPDATE SYSSTAT.TABLES SET ( CARD, NPAGES, /*MPAGES,*/ FPAGES, OVERFLOW, ACTIVE_BLOCKS ) = (vCARD,vNPAGES,/*vMPAGES,*/vFPAGES,vOVERFLOW,vACTIVE_BLOCKS ) WHERE ( TABNAME, TABSCHEMA ) = (vTABNAME, vTABSCHEMA) ; COMMIT; END FOR; END /* The aim is to generate and run the following kind of statements RUNSTATS ON TABLE "DB2V11 "."T" WITH DISTRIBUTION ON COLUMNS ( "K" NUM_FREQVALUES 3 NUM_QUANTILES 3, "I" NUM_FREQVALUES 3 NUM_QUANTILES 3, "J" NUM_FREQVALUES 3 NUM_QUANTILES 3); UPDATE SYSSTAT.INDEXES SET ( NLEAF,NLEVELS,FIRSTKEYCARD,FIRST2KEYCARD,FIRST3KEYCARD,FIRST4KEYCARD,FULLKEYCARD,CLUSTERFACTOR,CLUSTERRATIO,SEQUENTIAL_PAGES,PAGE_FETCH_PAIRS ,DENSITY,AVERAGE_SEQUENCE_GAP,AVERAGE_SEQUENCE_FETCH_GAP,AVERAGE_SEQUENCE_PAGES,AVERAGE_SEQUENCE_FETCH_PAGES ,AVERAGE_RANDOM_PAGES,AVERAGE_RANDOM_FETCH_PAGES,NUMRIDS,NUMRIDS_DELETED,NUM_EMPTY_LEAFS,INDCARD ) = (-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,'',-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1) WHERE TABNAME = 'T' AND TABSCHEMA = 'DB2V11 ' --UPDATE SYSSTAT.COLUMNS --SET (COLCARD, NUMNULLS) = (-1,-1) --WHERE TABNAME = 'T' AND TABSCHEMA = 'DB2V11 '; UPDATE SYSSTAT.TABLES SET CARD, NPAGES, MPAGES, FPAGES, OVERFLOW, ACTIVE_BLOCKS) = (3,1,0,1,0,0) WHERE TABNAME = 'T' AND TABSCHEMA = 'DB2V11 '; UPDATE SYSSTAT.COLUMNS SET ( COLCARD,NUMNULLS,SUB_COUNT,SUB_DELIM_LENGTH,PCTENCODED,AVGCOLLENCHAR,PAGEVARIANCERATIO,AVGENCODEDCOLLEN,AVGCOLLEN ) = ( 1,0,-1,-1,-1,-1,-1.000000,-1.000000,5 ) WHERE COLNAME = 'I' AND TABNAME = 'T' AND TABSCHEMA = 'DB2V11 ' UPDATE SYSSTAT.COLDIST SET ( COLVALUE, VALCOUNT) = ('AA','-3') WHERE COLNAME = 'I' AND TABNAME = 'T' AND TABSCHEMA = 'DB2V11 ' AND TYPE = 'F' AND SEQNO = 1 */
<filename>testresources/samples/euc_cn.sql drop table 计算机术语; create table 计算机术语(术语 text, 分类号 varchar, 备注1A char(16)); create index 计算机术语index1 on 计算机术语 using btree(术语); create index 计算机术语index2 on 计算机术语 using btree(分类号); insert into 计算机术语 values('电脑显示屏','机A01上'); insert into 计算机术语 values('电脑图形','分B01中'); insert into 计算机术语 values('电脑程序员','人Z01下'); vacuum 计算机术语; select * from 计算机术语; select * from 计算机术语 where 分类号 = '人Z01下'; select * from 计算机术语 where 分类号 ~* '人z01下'; select * from 计算机术语 where 分类号 like '_Z01_'; select * from 计算机术语 where 分类号 like '_Z%'; select * from 计算机术语 where 术语 ~ '电脑[显图]'; select * from 计算机术语 where 术语 ~* '电脑[显图]'; select *,character_length(术语) from 计算机术语; select *,octet_length(术语) from 计算机术语; select *,position('显' in 术语) from 计算机术语; select *,substring(术语 from 3 for 4) from 计算机术语;
-- Automatically generated, do not edit. -- edit 60868023 SET client_min_messages TO 'warning'; -- Temporarily drop triggers. DROP TRIGGER deny_deprecated ON link; INSERT INTO musicbrainz.editor (id, name, privs, email, website, bio, member_since, email_confirm_date, last_login_date, last_updated, birth_date, gender, area, password, <PASSWORD>, deleted) VALUES (2063647, 'editor#1', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', '7a13c7252f0d4c38e3c5e020024df011', '0'); INSERT INTO musicbrainz.edit (id, editor, type, status, autoedit, open_time, close_time, expire_time, language, quality) VALUES (60868023, 2063647, 311, 1, 0, '2019-04-24 05:10:31.971388+00', NULL, '2019-05-01 05:10:31.971388+00', NULL, 1); INSERT INTO musicbrainz.edit_data (edit, data) VALUES (60868023, '{"new_entity": {"id": 1072194, "name": "Milestone", "events": [{"date": {"day": null, "year": 1973, "month": null}, "country_id": 99}], "labels": [], "mediums": [{"format_name": null, "track_count": 10}], "artist_credit": {"names": [{"name": "<NAME>", "artist": {"id": 40043, "name": "<NAME>"}, "join_phrase": ""}]}}, "old_entities": [{"id": 1608636, "name": "A Milestone", "events": [{"date": {"day": null, "year": 1980, "month": null}, "country_id": 99}], "labels": [{"label": {"id": 62793, "name": "EMI"}, "catalog_number": "ECSD 2847"}], "mediums": [{"format_name": "12\" Vinyl", "track_count": 10}], "artist_credit": {"names": [{"name": "<NAME>", "artist": {"id": 40043, "name": "<NAME>"}, "join_phrase": ""}]}}], "_edit_version": 3, "merge_strategy": "2", "recording_merges": []}'); INSERT INTO musicbrainz.editor (id, name, privs, email, website, bio, member_since, email_confirm_date, last_login_date, last_updated, birth_date, gender, area, password, <PASSWORD>, deleted) VALUES (326637, 'editor#2', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', 'b3e9a247dfd7347a0027dbff7961170d', '0'), (407536, 'editor#3', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', '5f5f2a1ae5397fe1264b85d322d2ca3e', '0'), (487197, 'editor#4', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', '09b0f46eaae3693c78682f0a7c35c639', '0'), (561161, 'editor#5', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', 'bf006e22ee1e4d21643ca12a04f2e609', '0'), (798287, 'editor#6', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', 'dcd0dd856c90a7ebd8d5f25b97563ee9', '0'), (1989327, 'editor#7', 0, '', NULL, NULL, '2010-01-01 00:00:00.000000+00', '2010-01-01 00:01:00.000000+00', '2010-01-01 00:02:00.000000+00', '2010-01-01 00:02:00.000000+00', NULL, NULL, NULL, '{CLEARTEXT}mb', '0b606426409cfb40dc0eb292f74fe169', '0'); INSERT INTO musicbrainz.vote (id, editor, edit, vote, vote_time, superseded) VALUES (15984460, 798287, 60868023, 1, '2019-06-09 23:14:00.862315+00', '0'), (15970508, 487197, 60868023, -1, '2019-06-07 16:34:08.946007+00', '0'), (15943393, 561161, 60868023, -1, '2019-06-03 08:29:45.971506+00', '0'), (15928315, 326637, 60868023, -1, '2019-05-31 21:17:55.77614+00', '0'), (15928290, 326637, 60868023, 1, '2019-05-31 21:16:28.462633+00', '1'), (15818097, 407536, 60868023, 1, '2019-05-10 07:19:53.206997+00', '0'), (15814202, 1989327, 60868023, 1, '2019-05-10 05:13:42.071024+00', '0'); INSERT INTO musicbrainz.area (id, gid, name, type, edits_pending, last_updated, begin_date_year, begin_date_month, begin_date_day, end_date_year, end_date_month, end_date_day, ended, comment) VALUES (99, 'd31a9a15-537f-3669-ad53-25753ddd2772', 'India', 1, 0, '2013-05-27 13:20:45.066389+00', NULL, NULL, NULL, NULL, NULL, NULL, '0', ''), (5092, 'e24de96f-81de-4021-8af3-1b656b6b1e42', 'Mumbai', 3, 0, '2013-11-26 20:46:56.332736+00', NULL, NULL, NULL, NULL, NULL, NULL, '0', ''); INSERT INTO musicbrainz.iso_3166_1 (area, code) VALUES (99, 'IN'); INSERT INTO musicbrainz.artist (id, gid, name, sort_name, begin_date_year, begin_date_month, begin_date_day, end_date_year, end_date_month, end_date_day, type, area, gender, comment, edits_pending, last_updated, ended, begin_area, end_area) VALUES (40043, 'ff7d390f-03be-40e4-9210-3e0f660966df', '<NAME>', '<NAME>', 1941, 2, 8, 2011, 10, 10, 1, 99, 1, '', 0, '2019-02-13 18:00:20.829042+00', '1', NULL, 5092), (276197, '9a3dc805-9d47-4d67-b59d-47e1bfb82537', '<NAME>', '<NAME>', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 2, '', 0, '2011-12-28 11:24:13.362251+00', '0', NULL, NULL); INSERT INTO musicbrainz.artist_isni (artist, isni, edits_pending, created) VALUES (40043, '0000000109340667', 0, '2019-02-06 17:22:03.709705+00'); INSERT INTO musicbrainz.artist_credit (id, name, artist_count, ref_count, created, edits_pending) VALUES (40043, '<NAME>', 1, 2162, '2011-05-16 16:32:11.963929+00', 0), (276197, '<NAME>', 1, 193, '2011-05-16 16:32:11.963929+00', 0), (869200, '<NAME> & <NAME>', 2, 605, '2011-10-12 15:49:48.884022+00', 0); INSERT INTO musicbrainz.artist_credit_name (artist_credit, position, artist, name, join_phrase) VALUES (40043, 0, 40043, '<NAME>', ''), (276197, 0, 276197, '<NAME>', ''), (869200, 0, 40043, '<NAME>', ' & '), (869200, 1, 276197, '<NAME>', ''); INSERT INTO musicbrainz.recording (id, gid, name, artist_credit, length, comment, edits_pending, last_updated, video) VALUES (12721551, '8883356e-3c5e-4eb0-ad1c-89c05cc4a835', '<NAME>', 869200, 310000, '', 0, '2019-04-30 06:00:23.701891+00', '0'), (12721552, '34a2acc9-0193-46a4-899b-df26cdad8223', '<NAME>', 40043, 242000, '', 0, '2019-05-01 06:00:19.053588+00', '0'), (12721553, '95facc82-b3e6-43c2-9836-5c0a92c62b4e', '<NAME>', 276197, 221000, '', 0, '2019-04-30 06:00:23.996143+00', '0'), (12721554, '41cfa295-75d2-4949-8866-3321ed8ca64f', '<NAME>', 40043, 246000, '', 0, '2019-04-30 06:00:24.048389+00', '0'), (12721555, 'e5cdc069-661c-451f-8ca4-cd514766e2a5', '<NAME>', 276197, 292000, '', 0, '2019-05-01 07:00:19.888301+00', '0'), (12721556, '9392e422-eb2b-45e6-9b26-b9409bf7493e', 'Angdai Par Angdai Leti', 276197, 218000, '', 0, '2019-05-01 07:00:20.063159+00', '0'), (12721557, '8da53062-f0d7-4544-8774-d01c3446cded', 'S<NAME> Bhi', 276197, 219000, '', 0, '2019-05-01 07:00:20.112233+00', '0'), (12721558, '80a91369-65c4-47cb-b7d6-f43463dd2060', 'T<NAME>', 276197, 248000, '', 0, '2019-04-30 06:00:24.148617+00', '0'), (12721559, '0d7d32fd-6650-4ef4-9dea-9e5104c9e69b', 'Pahle To Apne Dil Ki Raza', 869200, 278000, '', 0, '2019-05-01 07:00:20.160063+00', '0'), (12721560, 'b59c4f3e-901f-4acc-9446-558b91ae4b50', '<NAME>', 276197, 238000, '', 0, '2019-05-01 07:00:20.305848+00', '0'); INSERT INTO musicbrainz.edit_recording (edit, recording) VALUES (60868023, 12721551), (60868023, 12721552), (60868023, 12721553), (60868023, 12721554), (60868023, 12721555), (60868023, 12721556), (60868023, 12721557), (60868023, 12721558), (60868023, 12721559), (60868023, 12721560); INSERT INTO musicbrainz.release_group (id, gid, name, artist_credit, type, comment, edits_pending, last_updated) VALUES (1092944, 'f4dad13b-d85f-4c2b-8268-392773f6bfec', 'Milestone', 40043, 1, '', 0, '2011-09-05 18:33:49.193143+00'); INSERT INTO musicbrainz.release (id, gid, name, artist_credit, release_group, status, packaging, language, script, barcode, comment, edits_pending, quality, last_updated) VALUES (1072194, '5eaf5cfb-8822-48d6-9186-cd429b65f057', 'A Milestone', 869200, 1092944, 1, NULL, 171, 28, NULL, '', 1, -1, '2019-05-01 07:00:20.356137+00'), (1608636, '8268eaa7-895d-4787-aaad-56551e00aea5', 'A Milestone', 40043, 1092944, 1, NULL, 171, NULL, NULL, '', 1, -1, '2019-04-30 06:00:24.200204+00'); INSERT INTO musicbrainz.country_area (area) VALUES (99); INSERT INTO musicbrainz.release_country (release, country, date_year, date_month, date_day) VALUES (1072194, 99, 1973, NULL, NULL), (1608636, 99, 1980, NULL, NULL); INSERT INTO musicbrainz.area (id, gid, name, type, edits_pending, last_updated, begin_date_year, begin_date_month, begin_date_day, end_date_year, end_date_month, end_date_day, ended, comment) VALUES (221, '8a754a16-0027-3a29-b6d7-2b40ea0481ed', 'United Kingdom', 1, 0, '2013-05-16 11:06:19.67235+00', NULL, NULL, NULL, NULL, NULL, NULL, '0', ''); INSERT INTO musicbrainz.iso_3166_1 (area, code) VALUES (221, 'GB'); INSERT INTO musicbrainz.label (id, gid, name, begin_date_year, begin_date_month, begin_date_day, end_date_year, end_date_month, end_date_day, label_code, type, area, comment, edits_pending, last_updated, ended) VALUES (62793, 'c029628b-6633-439e-bcee-ed02e8a338f7', 'EMI', 1972, NULL, NULL, NULL, NULL, NULL, 542, 4, 221, 'EMI Records, since 1972', 0, '2015-07-05 15:01:16.460867+00', '0'); INSERT INTO musicbrainz.release_label (id, release, label, catalog_number, last_updated) VALUES (1139774, 1608636, 62793, 'ECSD 2847', '2015-05-20 15:37:09.874727+00'); INSERT INTO musicbrainz.medium (id, release, position, format, name, edits_pending, last_updated, track_count) VALUES (1077041, 1072194, 1, 31, '', 0, '2011-09-05 18:33:49.686445+00', 10), (1691721, 1608636, 1, 31, '', 0, '2015-05-20 15:37:10.87034+00', 10); INSERT INTO musicbrainz.medium_index (medium, toc) VALUES (1077041, '(552000, 467000, 292000, 437000, 526000, 238000)'); INSERT INTO musicbrainz.artist_credit (id, name, artist_count, ref_count, created, edits_pending) VALUES (2414262, 'Jagjit & <NAME>', 1, 2, '2019-05-01 06:00:19.792215+00', 0); INSERT INTO musicbrainz.artist_credit_name (artist_credit, position, artist, name, join_phrase) VALUES (2414262, 0, 40043, 'Jagjit & <NAME>', ''); INSERT INTO musicbrainz.track (id, gid, recording, medium, position, number, name, artist_credit, length, edits_pending, last_updated, is_data_track) VALUES (11140043, 'db1a334d-0924-3293-9234-7a7c851091e5', 12721551, 1077041, 1, '1', '<NAME>', 40043, 310000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140044, '185354a0-60cb-3dfb-ba9f-6d88f697b2fa', 12721552, 1077041, 2, '2', '<NAME>', 2414262, 242000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140045, '506b063d-d6a0-3b4e-873f-b975e655f94f', 12721553, 1077041, 3, '3', 'Pa<NAME>', 40043, 221000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140046, 'd7f7b699-4847-3d5b-8c14-efc8ecde87b4', 12721554, 1077041, 4, '4', 'Sadma To Hai Mujhe Bhi Ke Tujhse Juda Hoon Main', 40043, 246000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140047, '7885b2f1-8aeb-33fa-8a2f-3a6006fc8635', 12721555, 1077041, 5, '5', 'Pehle To Apne Dil Ki Raza Jaan Jaiye', 2414262, 292000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140048, 'aaaf0955-1f3f-327b-b698-e5d7bc4c929f', 12721556, 1077041, 6, '6', '<NAME>', 276197, 218000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140049, 'cf2ab91b-995a-3722-bcd9-9af82036ad9b', 12721557, 1077041, 7, '7', '<NAME>-e-<NAME> Dinon', 276197, 219000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140050, '5d25c80e-6765-3f15-909a-33bd0836d520', 12721558, 1077041, 8, '8', '<NAME>', 40043, 248000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140051, '6eb12bc0-e652-3e6b-9399-4bcb3a6100ff', 12721559, 1077041, 9, '9', 'Angrai Par Angrai Leti Hai Raat Judai Ki', 276197, 278000, 0, '2019-05-01 06:00:19.792215+00', '0'), (11140052, '0d034ead-5b44-30c8-847e-46a0da5061c5', 12721560, 1077041, 10, '10', 'Tumhari Anjuman Se Uth Ke Deewane Kahan Jate', 276197, 238000, 0, '2019-05-01 06:00:19.792215+00', '0'), (18683659, '1b7978a7-ff6b-48c7-a12a-7fb72ed7f07a', 12721552, 1691721, 1, 'A1', '<NAME>', 40043, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683658, '41b67f5c-e7f5-4796-8234-a5f14759d734', 12721551, 1691721, 2, 'A2', '<NAME> <NAME>', 869200, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683667, '500c8fe3-0a33-44f9-b606-b18ebffd3d8a', 12721560, 1691721, 3, 'A3', '<NAME>', 40043, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683664, '00bfbc60-ecf9-4f1f-bb74-722dea12ee63', 12721557, 1691721, 4, 'A4', 'Sadma To Hai Mujhe Bhi', 40043, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683666, '50c5c710-6aeb-494f-8e59-3ee3aefb0ebd', 12721559, 1691721, 5, 'A5', 'Pahle To Ap<NAME> Ki Raza', 869200, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683662, '0c05a8c5-d708-4cda-af0b-7d2ca836bfff', 12721555, 1691721, 6, 'B1', '<NAME>', 276197, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683660, 'df035ade-077b-408c-8b5a-7b42e1095fef', 12721553, 1691721, 7, 'B2', '<NAME>at', 276197, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683661, '73eb8e3d-c5d3-4f68-9c65-c263023de281', 12721554, 1691721, 8, 'B3', 'Apne Haton Ki Lakeeron', 40043, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683663, 'a89bcdc3-43bc-4780-9a75-6e21cdc2b108', 12721556, 1691721, 9, 'B4', 'Angdai Par Angdai Leti', 276197, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'), (18683665, 'a9ee1774-d87b-4469-b0ed-0c36130dce5e', 12721558, 1691721, 10, 'B5', 'Tumhari Anjuman Se Uth Ke', 276197, NULL, 0, '2019-04-30 06:00:24.200204+00', '0'); INSERT INTO musicbrainz.edit_release (edit, release) VALUES (60868023, 1072194), (60868023, 1608636); INSERT INTO musicbrainz.edit_release_group (edit, release_group) VALUES (60868023, 1092944); INSERT INTO musicbrainz.edit_artist (edit, artist, status) VALUES (60868023, 40043, 1), (60868023, 276197, 1); -- Restore triggers. CREATE TRIGGER deny_deprecated BEFORE UPDATE OR INSERT ON link FOR EACH ROW EXECUTE PROCEDURE deny_deprecated_links();
<gh_stars>100-1000 -- Automatically generated, do not edit. \unset ON_ERROR_STOP SET search_path = 'cover_art_archive'; DROP TRIGGER update_release_coverart ON cover_art_archive; DROP TRIGGER resquence_cover_art ON cover_art_archive;
<reponame>akshaykhot727191/demoblogapp<filename>database/blogdb.sql -- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 09, 2020 at 05:14 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.2 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: `blogdb` -- -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE `category` ( `id` int(3) NOT NULL, `cname` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `category` -- INSERT INTO `category` (`id`, `cname`) VALUES (1, ' Movie'), (2, 'IPL'), (3, 'Lifestyle'), (4, 'world'), (5, 'Technology'); -- -------------------------------------------------------- -- -- Table structure for table `login` -- CREATE TABLE `login` ( `id` int(11) NOT NULL, `username` varchar(20) NOT NULL, `password` varchar(20) NOT NULL, `type` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `login` -- INSERT INTO `login` (`id`, `username`, `password`, `type`) VALUES (1, 'admin', 'admin', 'user'), (2, 'guest', 'guest', 'guest'); -- -------------------------------------------------------- -- -- Table structure for table `post` -- CREATE TABLE `post` ( `postid` int(3) NOT NULL, `title` varchar(100) NOT NULL, `category` varchar(20) NOT NULL, `image` varchar(250) NOT NULL, `dese` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `post` -- INSERT INTO `post` (`postid`, `title`, `category`, `image`, `dese`) VALUES (1, 'Movie Pilot', ' Movie', '1-MoviePilot-768x477.webp', 'Movie Pilot is one of the largest movie blogs in the world. It has a community of over 30 million readers and contributors. One of the unique things about Movie Pilot is that its content is written by its fans, rather than professional journalists. As a result, the content is more genuine and personable. Accepting content from fans means the editors also have a larger pool of quality articles to choose from, which makes it easier for them to curate excellent content. Many of their fans also discover interesting indie films and lesser-known actors to write about, which are easier to rent for in the search engines.\r\n\r\nMovie Pilot’s focus on crafting quality content has made them one of the most successful movie blogs on the Internet. They currently ranked for over 1.7 million keywords, according to SEMRush.'), (2, 'Screenrant', ' Movie', '3-ScreenRant-768x437.jpg', 'Screenrant takes movie reporting to the next level. They speak with industry insiders to make bold predictions about upcoming movies and unearth other interesting insights that readers won’t find anywhere else. An example of one of these predictions includes the blog post\r\n\r\nScreenrant attributes its success largely to the knowledge and connections of its writers. They prioritize hiring writers near major film centers, such as Los Angeles and New York. This gives writers the opportunity to interview directors and other industry professionals to get the inside scoop on upcoming movies.'), (3, 'Mumbai Indians vs Delhi Capitals Dream 11 Prediction: Best picks for MI vs DC IPL 2020 Final', 'IPL', '936356-930467-814292-dc-vs-mi.jpg', 'MI vs DC Dream11 Team - Check My Dream11 Team, Best players list of today\'s match, Mumbai Indians vs Delhi Capitals Final Dream11 Team Player List, MI Dream11 Team Player List, DC Dream11 Team Player List, Dream11 Guru Tips, Online Cricket Tips, Mumbai Indians vs Delhi Capitals Head to Head.\r\nThe first time in the 13 years of IPL history, Delhi Capitals (DC) are making their final appearance in the Indian Premier League (IPL). The side will face champions Mumbai Indians (MI) in the last game of the 13th edition on Tuesday (November 10) at Dubai International Stadium, Dubai.\r\n\r\nDelhi Capitals squared off against Sunrisers Hyderabad (SRH) in Qualifier 2 and defeated them by 17 runs to have a second shot against Mumbai. Delhi had lost Qualifier 1 against Mumbai Indians by 57 runs.\r\n\r\nAs for MI, it is the sixth time they are making it to the final and winning it four times. MI won the IPL titles in 2013, 2015, 2017 & 2019.'), (4, 'IPL 2020: Delhi Capitals knock Sunrisers Hyderabad out, have second shot at Mumbai in final', 'IPL', '936353-delhi-capitals-beat-sunrisers-hyderabad-to-face-mumbai-in-final.jpg', 'Delhi Capitals (DC) have a second shot against Mumbai Indians (MI) as they defeated Sunrisers Hyderabad (SRH) by 17 runs in the Qualifier 2 of the Indian Premier League (IPL) 2020 at Sheikh Zayed Stadium, Abu Dhabi.\r\nDelhi Capitals (DC) have a second shot against Mumbai Indians (MI) as they defeated Sunrisers Hyderabad (SRH) by 17 runs in the Qualifier 2 of the Indian Premier League (IPL) 2020 at Sheikh Zayed Stadium, Abu Dhabi.\r\n\r\nThis is the first time Delhi have reached the final since IPL\'s inception. They now face last year\'s champions yet again and have a chance to win the trophy.\r\nAfter winning the toss and opting to bat first, DC sent <NAME> along with <NAME> to open the innings. Dhawan led the way with a 50-ball 78 as they posted 189/3 in their 20 overs. against a sloppy SRH.'), (5, ' <NAME> looks ravishing in red, custom-made Manish Malhotra saree for her first Karva Chaut', 'Lifestyle', 'kajal.jpg', 'Kajal and Gautam tied the knot on October 30 in a fairytale-esque wedding in Mumbai. The big day was, however, preceded by several events that included haldi, mehendi and the chooda ceremony.\r\nActress <NAME>\'s latest Karva Chauth look has the internet talking. Dressed in a bright red Manish Malhotra ensemble, the newlywed looked ravishing as she celebrated the Hindu festival and observed fast for her husband, entrepreneur <NAME>. \r\n\r\nKarva Chauth was celebrated on November 4. \r\nStyled by <NAME>, Kajal looked vibrant with her bridal glow and elegant as she posed in a fluid gleaming Manish Malhotra scarlet red flowy custom-made saree that came in a light, semi-sheer fabric that accentuated her curves. '), (6, '<NAME> ups maternity style quotient in easy-breezy slip dress; see pics', 'Lifestyle', '935368-kareena.jpg', 'From sporting chic yet comfortable co-ords to looking elegant in a pink House of Masaba attire, <NAME> has managed to steal hearts with all of her recent looks.\r\nWhen mom-to-be Kareena Kapoor Khan steps out sporting an outfit, be rest assured that it is going to be an instant hit among fashion enthusiasts, her fans and most recently even expectant mothers. \r\n\r\nThough it is not a recent phenomenon, Kareena of late has been giving some major maternity fashion goals, stepping out in comfortable, laid-back attires that seem to set off motherhood fashion trends and up her own style quotient.\r\n\r\nKareena, who is expecting her second child with actor-husband <NAME>, on Tuesday, stepped out in an easy-breezy white strappy slip dress that featured an asymmetrical high-low hem. The white number also featured black polka dots and a v-neck. '), (7, 'Trump may cause problems for China before he leaves presidency, say experts', 'world', '936359-trump.jpg', 'Trump could attempt to block visas for more Communist party officials, or make trouble by trying to order US athletes to skip the Beijing 2022 Winter Olympics.\r\nWith US President <NAME> showing no signs that he will leave office gracefully after his defeat to President-elect <NAME> in the US Presidential elections, experts and former officials say they fear a growing risk that he could make disruptive moves to double down on priorities and tie his successor\'s hands in his final months in the White House.\r\n\r\nExperts added that China could be a particular target, given Trump\'s repeated efforts to blame Beijing for the Covid-19 pandemic and the economic conditions of the United States, says <NAME> in the South China Morning Post.\r\n\r\n\"Trump has promised to punish China for Covid-19, so the question is, what does that mean,\" said <NAME>, principal at China Moon Strategies and former National Security Council official.'), (8, 'Chinese President Xi-Jinping instructs officials to speed up construction of rail line in Tibet, clo', 'world', '936354-xi-jingping.jpg', 'The project would significantly contribute to the economic and social development of the western region, especially in Sichuan province and Tibet Autonomous Region, Xi said.\r\nChinese President <NAME> on Sunday gave orders to officials to speed up the construction of the new $47.8 billion railway project connecting the country\'s southwest Sichuan province to Linzhi in Tibet close to the Indian border in Arunachal Pradesh.\r\n\r\nThe Sichuan-Tibet Railway will go through the southeast of the Qinghai-Tibet Plateau, one of the world\'s most geologically active areas, according to the Chinese official media. It will travel through Ya\'an and enters Tibet via Qamdo, and therefore shorten the travel time from Chengdu to Lhasa from 48 hours to 13 hours. '), (9, 'You can now send money through WhatsApp using UPI, here\'s how', 'Technology', '935842-whatsapp.jpg', 'In India, the WhatsApp payment service will compete against other major players like Google Pay and PhonePe, among others.\r\nYou will now be able to send money through popular messaging app WhatsApp as the service received approval from the National Payments Corporation of India (NPCI) to go live on Unified Payment Interface (UPI) in the multi-bank model.\r\n\r\nThe approval comes after two years of testing. \r\n\r\n“We’ve been working on this with the National Payments Corporation of India, who oversee everything to make sure it’s secure and reliable. And we’ve built it using India’s Unified Payments Interface, which makes it easy for anyone to instantly accept payments across different apps -- and for companies to provide people with great services,” Facebook CEO <NAME> said in a statement.'), (10, 'Call of Duty (COD) Mobile: How to obtain Legendary weapons in game? check here', 'Technology', '935610-call-of-duty-new.jpg', 'Just like PUBG, COD Mobile also caters a similar in-game environment for its players with 100 players jumping off to a familiar battlefield in the aim to gun-down each other to achieve the ultimate chicken dinner.\r\nLegendary weapons in the Call of Duty mobile version are a rarity. However, with the introduction of Mythic weapon in COD Mobile, legendary weapons have dropped a level below, but are still hot property.\r\n\r\nLegendary weapons are essentially blueprints. Using the blueprints, the player can have any attachments on a weapon, and drastically change the aesthetic and design with regards to the original blueprint.\r\n\r\nIt is a revamped version of a weapon with a brand new set of designs. Players involved in multiplayer matches who do not have an upgraded weapon because of their ranking can use the blueprint, for the attachments which have already been unlocked.'); -- -- Indexes for dumped tables -- -- -- Indexes for table `category` -- ALTER TABLE `category` ADD PRIMARY KEY (`id`); -- -- Indexes for table `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`id`); -- -- Indexes for table `post` -- ALTER TABLE `post` ADD PRIMARY KEY (`postid`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `category` -- ALTER TABLE `category` MODIFY `id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `login` -- ALTER TABLE `login` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `post` -- ALTER TABLE `post` MODIFY `postid` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
create table user ( id int primary key AUTO_INCREMENT, username varchar(255) not null, email varchar(255) not null, password varchar(<PASSWORD>), phone varchar(50), enabled smallint default 1, status smallint default 1, created_ts timestamp default CURRENT_TIMESTAMP, modified_ts timestamp default CURRENT_TIMESTAMP, unique(email) );
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Dec 09, 2019 at 11:11 PM -- Server version: 10.3.16-MariaDB -- PHP Version: 7.3.6 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: `lohagoporvos` -- -- -------------------------------------------------------- -- -- Table structure for table `categoriaTrabajo` -- CREATE TABLE `categoriaTrabajo` ( `idCategoriaTrabajo` int(11) NOT NULL, `nombreCategoriaTrabajo` varchar(80) DEFAULT NULL, `descripcionCategoriaTrabajo` varchar(255) DEFAULT NULL, `imagenCategoriaTrabajo` varchar(511) DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `categoriaTrabajo` -- INSERT INTO `categoriaTrabajo` (`idCategoriaTrabajo`, `nombreCategoriaTrabajo`, `descripcionCategoriaTrabajo`, `imagenCategoriaTrabajo`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 'Mascotas', 'Mascotas', 'categoriaMascota.jpg', 0, NULL, NULL), (2, 'Auto', 'Auto', 'categoriaAuto.jpg', 0, NULL, NULL), (3, 'Pago de servicios', 'Pago de servicios', 'categoriaServicios.jpg', 0, NULL, NULL), (4, 'Turnos', 'Turnos', 'categoriaTurnos.png', 0, NULL, NULL), (5, 'Tramites', 'Tramites', 'categoriaTramite.png', 0, NULL, NULL), (6, 'Casa', 'Casa', 'categoriaCasa.jpg', 0, NULL, NULL), (7, 'Jardin', 'Jardin', 'categoriaJardin.jpg', 0, NULL, NULL), (8, 'Mantenimiento', 'Mantenimiento', 'categoriaMantenimiento.jpg', 0, NULL, NULL), (9, 'Tecnico', 'Tecnico', 'categoriaTecnico.jpg', 0, NULL, NULL), (10, 'Otro', 'Otro', 'categoriaOtro.png', 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `comentario` -- CREATE TABLE `comentario` ( `idComentario` int(11) NOT NULL, `contenido` varchar(255) NOT NULL, `idComentarioPadre` int(11) DEFAULT NULL, `idTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `conversacionchat` -- CREATE TABLE `conversacionchat` ( `idConversacionChat` int(11) NOT NULL, `idTrabajo` int(11) NOT NULL, `idPersona1` int(11) NOT NULL, `idPersona2` int(11) NOT NULL, `deshabilitado` tinyint(1) DEFAULT 0, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `conversacionchat` -- INSERT INTO `conversacionchat` (`idConversacionChat`, `idTrabajo`, `idPersona1`, `idPersona2`, `deshabilitado`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 3, 6, 1, 0, 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `estado` -- CREATE TABLE `estado` ( `idEstado` int(11) NOT NULL, `nombreEstado` varchar(80) DEFAULT NULL, `descripcionEstado` varchar(160) DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `estado` -- INSERT INTO `estado` (`idEstado`, `nombreEstado`, `descripcionEstado`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 'Esperando Postulaciones', 'El anuncio espera postulaciones', 0, NULL, NULL), (2, 'Evaluando Postulaciones', 'El anunciante esta evaluando las postulaciones', 0, NULL, NULL), (3, 'Asignado', 'El anunciante asigno un postulante', 0, NULL, NULL), (4, 'Esperando Confirmacion', 'Asignado ya realizo el trabajo. El anunciante debe confirmar el trabajo realizado', 0, NULL, NULL), (5, 'Finalizado', 'Anuncio finalizado', 0, NULL, NULL), (6, 'Cancelado', 'Anuncio cancelado', 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `estadotrabajo` -- CREATE TABLE `estadotrabajo` ( `idEstadoTrabajo` int(11) NOT NULL, `idTrabajo` int(11) NOT NULL, `idEstado` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `estadotrabajo` -- INSERT INTO `estadotrabajo` (`idEstadoTrabajo`, `idTrabajo`, `idEstado`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 1, 1, 0, NULL, NULL), (2, 2, 1, 0, NULL, NULL), (3, 3, 1, 0, NULL, NULL), (4, 4, 1, 0, NULL, NULL), (5, 5, 1, 0, NULL, NULL), (6, 6, 1, 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `habilidad` -- CREATE TABLE `habilidad` ( `idHabilidad` int(11) NOT NULL, `nombreHabilidad` varchar(80) DEFAULT NULL, `descripcionHabilidad` varchar(255) DEFAULT NULL, `imagenHabilidad` varchar(511) DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `habilidad` -- INSERT INTO `habilidad` (`idHabilidad`, `nombreHabilidad`, `descripcionHabilidad`, `imagenHabilidad`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 'Creativo', 'Descripcion habilidad 1', NULL, 0, NULL, NULL), (2, 'Veloz', 'Descripcion habilidad 2', NULL, 0, NULL, NULL), (3, 'Agil', 'Descripcion habilidad 3', NULL, 0, NULL, NULL), (4, 'Social', 'Descripcion habilidad 4', NULL, 0, NULL, NULL), (5, 'Positivo', 'Descripcion habilidad 5', NULL, 0, NULL, NULL), (6, 'Confianza', 'Descripcion habilidad 6', NULL, 0, NULL, NULL), (7, 'Pintor', 'Descripcion habilidad 7', NULL, 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `habilidadpersona` -- CREATE TABLE `habilidadpersona` ( `idHabilidadPersona` int(11) NOT NULL, `idHabilidad` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `habilidadpersona` -- INSERT INTO `habilidadpersona` (`idHabilidadPersona`, `idHabilidad`, `idPersona`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 1, 1, 0, NULL, NULL), (2, 3, 1, 0, NULL, NULL), (3, 5, 1, 0, NULL, NULL), (4, 2, 2, 0, NULL, NULL), (5, 4, 2, 0, NULL, NULL), (6, 6, 2, 0, NULL, NULL), (7, 1, 3, 0, NULL, NULL), (8, 2, 3, 0, NULL, NULL), (9, 5, 3, 0, NULL, NULL), (10, 1, 4, 0, NULL, NULL), (11, 6, 4, 0, NULL, NULL), (12, 5, 4, 0, NULL, NULL), (13, 7, 5, 0, NULL, NULL), (14, 3, 5, 0, NULL, NULL), (15, 2, 5, 0, NULL, NULL), (16, 3, 6, 0, NULL, NULL), (17, 4, 6, 0, NULL, NULL), (18, 6, 6, 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `localidad` -- CREATE TABLE `localidad` ( `idLocalidad` int(11) NOT NULL, `idProvincia` int(11) NOT NULL, `nombreLocalidad` varchar(50) DEFAULT NULL, `codigoPostal` smallint(6) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `localidad` -- INSERT INTO `localidad` (`idLocalidad`, `idProvincia`, `nombreLocalidad`, `codigoPostal`, `created_at`, `updated_at`) VALUES (2961, 22, 'ALLEN', 8328, NULL, NULL), (2962, 22, '<NAME>', 8305, NULL, NULL), (2967, 22, '<NAME>', 8303, NULL, NULL), (2968, 22, 'CIPOLLETTI', 8324, NULL, NULL), (2973, 22, 'CONTRALMIRANTE CORDERO', 8301, NULL, NULL), (2978, 22, 'CUATRO ESQUINAS', 8324, NULL, NULL), (2984, 22, 'GENERAL FERNANDEZ ORO', 8324, NULL, NULL), (2985, 22, 'GENERAL ROCA', 8332, NULL, NULL), (2994, 22, '<NAME>', 8305, NULL, NULL), (3001, 22, '<NAME>', 8305, NULL, NULL), (3005, 22, '<NAME>', 8336, NULL, NULL), (3095, 22, '<NAME>', 8308, NULL, NULL), (4623, 20, 'ARROYITO', 8313, NULL, NULL), (4627, 20, 'CENTENARIO', 8309, NULL, NULL), (4629, 20, '<NAME>', 8316, NULL, NULL), (4631, 20, '<NAME>', 8300, NULL, NULL), (4634, 20, 'NEUQUEN', 8300, NULL, NULL), (4637, 20, 'PLOTTIER', 8316, NULL, NULL), (4642, 20, 'SENILLOSA', 8316, NULL, NULL), (4643, 20, '<NAME>', 8311, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `mensajechat` -- CREATE TABLE `mensajechat` ( `idMensajeChat` int(11) NOT NULL, `idConversacionChat` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `mensaje` varchar(511) DEFAULT NULL, `visto` tinyint(1) DEFAULT 0, `fechaVisto` timestamp NULL DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `mensajechat` -- INSERT INTO `mensajechat` (`idMensajeChat`, `idConversacionChat`, `idPersona`, `mensaje`, `visto`, `fechaVisto`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 1, 6, 'euuuuuu', 0, NULL, 0, '2019-12-09 23:13:52', '2019-12-09 23:13:52'), (2, 1, 6, 'holis', 0, NULL, 0, '2019-12-09 23:23:14', '2019-12-09 23:23:14'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `multa` -- CREATE TABLE `multa` ( `idMulta` int(11) NOT NULL, `idTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `motivo` varchar(511) DEFAULT NULL, `valor` varchar(16) DEFAULT NULL, `fechaPagado` timestamp NULL DEFAULT NULL, `pagado` tinyint(1) DEFAULT 0, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `pagorecibido` -- CREATE TABLE `pagorecibido` ( `idPagoRecibido` int(11) NOT NULL, `idTrabajo` int(11) NOT NULL, `idPago` varchar(255) NOT NULL, `monto` float(8,2) NOT NULL, `metodo` varchar(255) NOT NULL, `tarjeta` varchar(255) NOT NULL, `fechapago` timestamp NULL DEFAULT NULL, `fechaaprobado` timestamp NULL DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `persona` -- CREATE TABLE `persona` ( `idPersona` int(11) NOT NULL, `nombrePersona` varchar(80) NOT NULL, `apellidoPersona` varchar(80) NOT NULL, `dniPersona` varchar(10) DEFAULT NULL, `telefonoPersona` varchar(32) DEFAULT NULL, `idLocalidad` int(11) NOT NULL, `imagenPersona` varchar(511) DEFAULT NULL, `numeroCBU` varchar(22) DEFAULT NULL, `idUsuario` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `persona` -- INSERT INTO `persona` (`idPersona`, `nombrePersona`, `apellidoPersona`, `dniPersona`, `telefonoPersona`, `idLocalidad`, `imagenPersona`, `numeroCBU`, `idUsuario`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 'Juan', 'Sanchez', '89576214', '2995049638', 4634, 'diegoImplorando.jpg', '1234123412341234123412', 1, 0, '2019-09-23 03:37:12', '2019-09-23 03:37:12'), (2, '<NAME>', 'Perez', '46325896', '02995698835', 4634, 'nickiAdolorida.jpg', '1234156785678234123412', 2, 0, '2019-09-23 03:39:52', '2019-09-23 03:39:52'), (3, 'Sofia', 'Galletas', '45698746', '2991365289', 4634, 'ofeliaPensando.jpg', '1234123412341234125678', 3, 0, '2019-09-23 03:41:13', '2019-09-23 03:41:13'), (4, '<NAME>', 'Quintana', '43589633', '2994896324', 4634, 'diegoContento.jpg', '1234123412341234123412', 4, 0, '2019-09-23 03:42:34', '2019-09-23 03:42:34'), (5, 'Emiliano', 'Gonzales', '46987456', '2991365852', 2968, 'juanRomanContento.jpg', '1234123456781234123412', 5, 0, '2019-09-23 03:45:11', '2019-09-23 03:45:11'), (6, 'Federico', 'de Girasol', '46986325', '2998963258', 4634, 'juanRomanLegendario.jpg', '1234123412341234123412', 6, 0, '2019-09-23 03:58:03', '2019-09-23 03:58:03'), (7, '<NAME>', 'Por Vos', '12312312', '2994122312', 4634, 'sistema.jpg', '5678123412341234123412', 7, 0, '2019-09-23 03:58:03', '2019-09-23 03:58:03'); -- -------------------------------------------------------- -- -- Table structure for table `preferenciapersona` -- CREATE TABLE `preferenciapersona` ( `idPreferenciaPersona` int(11) NOT NULL, `idCategoriaTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `preferenciapersona` -- INSERT INTO `preferenciapersona` (`idPreferenciaPersona`, `idCategoriaTrabajo`, `idPersona`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 1, 1, 0, NULL, NULL), (2, 2, 2, 0, NULL, NULL), (3, 3, 3, 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `provincia` -- CREATE TABLE `provincia` ( `idProvincia` int(11) NOT NULL, `nombreProvincia` varchar(50) DEFAULT NULL, `codigoIso31662` char(4) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `provincia` -- INSERT INTO `provincia` (`idProvincia`, `nombreProvincia`, `codigoIso31662`, `created_at`, `updated_at`) VALUES (20, 'Neuquén', 'AR-Q', NULL, NULL), (22, 'Río Negro', 'AR-R', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `rol` -- CREATE TABLE `rol` ( `idRol` int(11) NOT NULL, `nombreRol` varchar(80) NOT NULL, `descripcionRol` varchar(80) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `rol` -- INSERT INTO `rol` (`idRol`, `nombreRol`, `descripcionRol`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 'Administrador', 'Administrador', 0, NULL, NULL), (2, 'Usuario', 'Usuario', 0, NULL, NULL), (3, 'Gestor', 'Usuario', 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `trabajo` -- CREATE TABLE `trabajo` ( `idTrabajo` int(11) NOT NULL, `idEstado` int(11) NOT NULL, `idCategoriaTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `idLocalidad` int(11) NOT NULL, `titulo` varchar(255) DEFAULT NULL, `descripcion` varchar(511) DEFAULT NULL, `monto` float(8,2) DEFAULT NULL, `imagenTrabajo` varchar(511) DEFAULT NULL, `tiempoExpiracion` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `trabajo` -- INSERT INTO `trabajo` (`idTrabajo`, `idEstado`, `idCategoriaTrabajo`, `idPersona`, `idLocalidad`, `titulo`, `descripcion`, `monto`, `imagenTrabajo`, `tiempoExpiracion`, `created_at`, `updated_at`, `eliminado`) VALUES (1, 1, 1, 3, 4634, '<NAME>', 'Alguien que pueda llevar a mi perrita al petshop MiPerrito', 600.00, 'categoriaMascota.jpg', '2019-12-12 03:00:00', '2019-09-23 03:47:02', '2019-09-23 03:47:02', 0), (2, 1, 2, 5, 4634, 'Quien me lava mi auto ????', 'Alguien que me lave el auto que no tengo ganas xD', 300.00, 'categoriaAuto.jpg', '2019-12-12 03:00:00', '2019-09-23 03:48:40', '2019-09-23 03:48:40', 0), (3, 1, 3, 1, 4634, 'Recital de <NAME>', 'quien puede hacer la fila por mi el dia del recital', 150.00, 'categoriaServicios.jpg', '2019-12-12 03:00:00', '2019-09-23 03:51:06', '2019-09-23 03:51:06', 0), (4, 1, 4, 4, 4634, 'cortar el cesped', 'tengo que cortar el cesped antes del finde. si queda bien lo llamo la proxima vez y recomiendo. pongo 5 estrellas', 560.00, 'categoriaTurnos.png', '2019-12-12 03:00:00', '2019-09-23 03:55:10', '2019-09-23 03:55:10', 0), (5, 1, 5, 4, 4634, 'armar la pelopincho', 'alguien para armar la pile porfa. me operaron y no puedo hacer fuerza. gracias', 360.00, 'categoriaTramite.png', '2019-12-12 03:00:00', '2019-09-23 03:56:35', '2019-09-23 03:56:35', 0), (6, 1, 6, 6, 4634, 'pasear el perro', 'quien lo puede pasear a mi perro. es por el lunes a la tarde', 240.00, 'categoriaCasa.jpg', '2019-12-12 03:00:00', '2019-09-23 04:01:51', '2019-09-23 04:01:51', 0); -- -------------------------------------------------------- -- -- Table structure for table `trabajoasignado` -- CREATE TABLE `trabajoasignado` ( `idTrabajoAsignado` int(11) NOT NULL, `idTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `trabajoaspirante` -- CREATE TABLE `trabajoaspirante` ( `idTrabajoAspirante` int(11) NOT NULL, `idTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `trabajoaspirante` -- INSERT INTO `trabajoaspirante` (`idTrabajoAspirante`, `idTrabajo`, `idPersona`, `eliminado`, `created_at`, `updated_at`) VALUES (1, 6, 1, 0, NULL, NULL), (2, 6, 2, 0, NULL, NULL), (3, 6, 3, 0, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `usuario` -- CREATE TABLE `usuario` ( `idUsuario` int(11) NOT NULL, `nombreUsuario` varchar(80) NOT NULL, `mailUsuario` varchar(80) NOT NULL, `auth_key` varchar(255) DEFAULT NULL, `claveUsuario` varchar(255) NOT NULL, `idRol` int(11) NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `usuario` -- INSERT INTO `usuario` (`idUsuario`, `nombreUsuario`, `mailUsuario`, `auth_key`, `claveUsuario`, `idRol`, `email_verified_at`, `remember_token`, `created_at`, `updated_at`, `eliminado`) VALUES (1, 'juan88', '<EMAIL>', 'authkey', <KEY>', 2, '2019-11-07 23:06:06', NULL, '2019-09-23 03:36:43', '2019-09-23 03:36:43', 0), (2, 'Maria', '<EMAIL>', 'authkey', <KEY>', 2, '2019-11-07 23:06:06', NULL, '2019-09-23 03:39:18', '2019-09-23 03:39:18', 0), (3, 'sofi89', '<EMAIL>', 'authkey', '$2y$10$wJYQxiIoDss0pMwOVGa9remm7eAthTg8dt6RkaduQLuTrK7jxH9US', 2, '2019-11-07 23:06:06', NULL, '2019-09-23 03:40:50', '2019-09-23 03:40:50', 0), (4, 'MarceloQ', '<EMAIL>', 'authkey', <KEY>', 2, '2019-11-07 23:06:06', NULL, '2019-09-23 03:41:52', '2019-09-23 03:41:52', 0), (5, 'emiElMasCopado', '<EMAIL>', 'authkey', <KEY>', 2, '2019-11-07 23:06:06', NULL, '2019-09-23 03:44:18', '2019-09-23 03:44:18', 0), (6, 'elpana', '<EMAIL>', 'authkey', <KEY>', 1, '2019-11-07 23:06:06', NULL, '2019-09-23 03:57:22', '2019-09-23 03:57:22', 0), (7, 'lohagoporvos', '<EMAIL>', 'authkey', <KEY>', 1, '2019-11-07 23:06:06', NULL, '2019-09-23 03:57:22', '2019-09-23 03:57:22', 0); -- -------------------------------------------------------- -- -- Table structure for table `valoracion` -- CREATE TABLE `valoracion` ( `idValoracion` int(11) NOT NULL, `valor` int(11) NOT NULL DEFAULT 0, `idTrabajo` int(11) NOT NULL, `idPersona` int(11) NOT NULL, `comentarioValoracion` varchar(511) DEFAULT NULL, `imagenValoracion` varchar(511) DEFAULT NULL, `eliminado` tinyint(1) DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `categoriaTrabajo` -- ALTER TABLE `categoriaTrabajo` ADD PRIMARY KEY (`idCategoriaTrabajo`); -- -- Indexes for table `comentario` -- ALTER TABLE `comentario` ADD PRIMARY KEY (`idComentario`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idPersona` (`idPersona`), ADD KEY `idComentarioPadre` (`idComentarioPadre`); -- -- Indexes for table `conversacionchat` -- ALTER TABLE `conversacionchat` ADD PRIMARY KEY (`idConversacionChat`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idPersona1` (`idPersona1`), ADD KEY `idPersona2` (`idPersona2`); -- -- Indexes for table `estado` -- ALTER TABLE `estado` ADD PRIMARY KEY (`idEstado`); -- -- Indexes for table `estadotrabajo` -- ALTER TABLE `estadotrabajo` ADD PRIMARY KEY (`idEstadoTrabajo`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idEstado` (`idEstado`); -- -- Indexes for table `habilidad` -- ALTER TABLE `habilidad` ADD PRIMARY KEY (`idHabilidad`); -- -- Indexes for table `habilidadpersona` -- ALTER TABLE `habilidadpersona` ADD PRIMARY KEY (`idHabilidadPersona`), ADD KEY `idHabilidad` (`idHabilidad`), ADD KEY `idPersona` (`idPersona`); -- -- Indexes for table `localidad` -- ALTER TABLE `localidad` ADD PRIMARY KEY (`idLocalidad`), ADD KEY `idProvincia` (`idProvincia`); -- -- Indexes for table `mensajechat` -- ALTER TABLE `mensajechat` ADD PRIMARY KEY (`idMensajeChat`), ADD KEY `idConversacionChat` (`idConversacionChat`), ADD KEY `idPersona` (`idPersona`); -- -- Indexes for table `multa` -- ALTER TABLE `multa` ADD PRIMARY KEY (`idMulta`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idPersona` (`idPersona`); -- -- Indexes for table `pagorecibido` -- ALTER TABLE `pagorecibido` ADD PRIMARY KEY (`idPagoRecibido`), ADD KEY `idTrabajo` (`idTrabajo`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `persona` -- ALTER TABLE `persona` ADD PRIMARY KEY (`idPersona`), ADD KEY `idLocalidad` (`idLocalidad`), ADD KEY `idUsuario` (`idUsuario`); -- -- Indexes for table `preferenciapersona` -- ALTER TABLE `preferenciapersona` ADD PRIMARY KEY (`idPreferenciaPersona`), ADD KEY `idCategoriaTrabajo` (`idCategoriaTrabajo`), ADD KEY `idPersona` (`idPersona`); -- -- Indexes for table `provincia` -- ALTER TABLE `provincia` ADD PRIMARY KEY (`idProvincia`); -- -- Indexes for table `rol` -- ALTER TABLE `rol` ADD PRIMARY KEY (`idRol`); -- -- Indexes for table `trabajo` -- ALTER TABLE `trabajo` ADD PRIMARY KEY (`idTrabajo`), ADD KEY `idEstado` (`idEstado`), ADD KEY `idLocalidad` (`idLocalidad`), ADD KEY `idPersona` (`idPersona`), ADD KEY `idCategoriaTrabajo` (`idCategoriaTrabajo`); -- -- Indexes for table `trabajoasignado` -- ALTER TABLE `trabajoasignado` ADD PRIMARY KEY (`idTrabajoAsignado`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idPersona` (`idPersona`); -- -- Indexes for table `trabajoaspirante` -- ALTER TABLE `trabajoaspirante` ADD PRIMARY KEY (`idTrabajoAspirante`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idPersona` (`idPersona`); -- -- Indexes for table `usuario` -- ALTER TABLE `usuario` ADD PRIMARY KEY (`idUsuario`), ADD KEY `idRol` (`idRol`); -- -- Indexes for table `valoracion` -- ALTER TABLE `valoracion` ADD PRIMARY KEY (`idValoracion`), ADD KEY `idTrabajo` (`idTrabajo`), ADD KEY `idPersona` (`idPersona`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `categoriaTrabajo` -- ALTER TABLE `categoriaTrabajo` MODIFY `idCategoriaTrabajo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `comentario` -- ALTER TABLE `comentario` MODIFY `idComentario` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `conversacionchat` -- ALTER TABLE `conversacionchat` MODIFY `idConversacionChat` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `estado` -- ALTER TABLE `estado` MODIFY `idEstado` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `estadotrabajo` -- ALTER TABLE `estadotrabajo` MODIFY `idEstadoTrabajo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `habilidad` -- ALTER TABLE `habilidad` MODIFY `idHabilidad` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `habilidadpersona` -- ALTER TABLE `habilidadpersona` MODIFY `idHabilidadPersona` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `localidad` -- ALTER TABLE `localidad` MODIFY `idLocalidad` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4644; -- -- AUTO_INCREMENT for table `mensajechat` -- ALTER TABLE `mensajechat` MODIFY `idMensajeChat` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `multa` -- ALTER TABLE `multa` MODIFY `idMulta` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `pagorecibido` -- ALTER TABLE `pagorecibido` MODIFY `idPagoRecibido` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `persona` -- ALTER TABLE `persona` MODIFY `idPersona` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `preferenciapersona` -- ALTER TABLE `preferenciapersona` MODIFY `idPreferenciaPersona` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `provincia` -- ALTER TABLE `provincia` MODIFY `idProvincia` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT for table `rol` -- ALTER TABLE `rol` MODIFY `idRol` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `trabajo` -- ALTER TABLE `trabajo` MODIFY `idTrabajo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `trabajoasignado` -- ALTER TABLE `trabajoasignado` MODIFY `idTrabajoAsignado` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `trabajoaspirante` -- ALTER TABLE `trabajoaspirante` MODIFY `idTrabajoAspirante` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `usuario` -- ALTER TABLE `usuario` MODIFY `idUsuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `valoracion` -- ALTER TABLE `valoracion` MODIFY `idValoracion` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `comentario` -- ALTER TABLE `comentario` ADD CONSTRAINT `comentario_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `comentario_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`), ADD CONSTRAINT `comentario_ibfk_3` FOREIGN KEY (`idComentarioPadre`) REFERENCES `comentario` (`idComentario`); -- -- Constraints for table `conversacionchat` -- ALTER TABLE `conversacionchat` ADD CONSTRAINT `conversacionchat_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `conversacionchat_ibfk_2` FOREIGN KEY (`idPersona1`) REFERENCES `persona` (`idPersona`), ADD CONSTRAINT `conversacionchat_ibfk_3` FOREIGN KEY (`idPersona2`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `estadotrabajo` -- ALTER TABLE `estadotrabajo` ADD CONSTRAINT `estadotrabajo_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `estadotrabajo_ibfk_2` FOREIGN KEY (`idEstado`) REFERENCES `estado` (`idEstado`); -- -- Constraints for table `habilidadpersona` -- ALTER TABLE `habilidadpersona` ADD CONSTRAINT `habilidadpersona_ibfk_1` FOREIGN KEY (`idHabilidad`) REFERENCES `habilidad` (`idHabilidad`), ADD CONSTRAINT `habilidadpersona_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `localidad` -- ALTER TABLE `localidad` ADD CONSTRAINT `localidad_ibfk_1` FOREIGN KEY (`idProvincia`) REFERENCES `provincia` (`idProvincia`); -- -- Constraints for table `mensajechat` -- ALTER TABLE `mensajechat` ADD CONSTRAINT `mensajechat_ibfk_1` FOREIGN KEY (`idConversacionChat`) REFERENCES `conversacionchat` (`idConversacionChat`), ADD CONSTRAINT `mensajechat_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `multa` -- ALTER TABLE `multa` ADD CONSTRAINT `multa_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `multa_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `pagorecibido` -- ALTER TABLE `pagorecibido` ADD CONSTRAINT `pagorecibido_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`); -- -- Constraints for table `persona` -- ALTER TABLE `persona` ADD CONSTRAINT `persona_ibfk_1` FOREIGN KEY (`idLocalidad`) REFERENCES `localidad` (`idLocalidad`), ADD CONSTRAINT `persona_ibfk_2` FOREIGN KEY (`idUsuario`) REFERENCES `usuario` (`idUsuario`); -- -- Constraints for table `preferenciapersona` -- ALTER TABLE `preferenciapersona` ADD CONSTRAINT `preferenciapersona_ibfk_1` FOREIGN KEY (`idCategoriaTrabajo`) REFERENCES `categoriaTrabajo` (`idCategoriaTrabajo`), ADD CONSTRAINT `preferenciapersona_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `trabajo` -- ALTER TABLE `trabajo` ADD CONSTRAINT `trabajo_ibfk_1` FOREIGN KEY (`idEstado`) REFERENCES `estado` (`idEstado`), ADD CONSTRAINT `trabajo_ibfk_2` FOREIGN KEY (`idLocalidad`) REFERENCES `localidad` (`idLocalidad`), ADD CONSTRAINT `trabajo_ibfk_3` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`), ADD CONSTRAINT `trabajo_ibfk_4` FOREIGN KEY (`idCategoriaTrabajo`) REFERENCES `categoriaTrabajo` (`idCategoriaTrabajo`); -- -- Constraints for table `trabajoasignado` -- ALTER TABLE `trabajoasignado` ADD CONSTRAINT `trabajoasignado_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `trabajoasignado_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `trabajoaspirante` -- ALTER TABLE `trabajoaspirante` ADD CONSTRAINT `trabajoaspirante_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `trabajoaspirante_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); -- -- Constraints for table `usuario` -- ALTER TABLE `usuario` ADD CONSTRAINT `usuario_ibfk_1` FOREIGN KEY (`idRol`) REFERENCES `rol` (`idRol`); -- -- Constraints for table `valoracion` -- ALTER TABLE `valoracion` ADD CONSTRAINT `valoracion_ibfk_1` FOREIGN KEY (`idTrabajo`) REFERENCES `trabajo` (`idTrabajo`), ADD CONSTRAINT `valoracion_ibfk_2` FOREIGN KEY (`idPersona`) REFERENCES `persona` (`idPersona`); 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 */;
/* Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+ | Id | Num | +----+-----+ | 1 | 1 | | 2 | 1 | | 3 | 1 | | 4 | 2 | | 5 | 1 | | 6 | 2 | | 7 | 2 | +----+-----+ For example, given the above Logs table, 1 is the only number that appears consecutively for at least three times. +-----------------+ | ConsecutiveNums | +-----------------+ | 1 | +-----------------+ for more information: https://leetcode.com/problems/consecutive-numbers/description/ */ #MySQL select distinct log1.Num ConsecutiveNums from Logs log1 inner join Logs log2 on log1.Id = log2.Id - 1 inner join Logs log3 on log1.Id = log3.Id - 2 where log1.Num = log2.Num and log1.num = log3.num;
CREATE TABLE `blogpost` ( `id` binary(16) NOT NULL, `auditing_created_at` datetime NOT NULL, `auditing_updated_at` datetime NOT NULL, `content` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `blogpost_author` binary(16) NOT NULL ); CREATE TABLE `blogpost_comment` ( `id` binary(16) NOT NULL, `auditing_created_at` datetime NOT NULL, `auditing_updated_at` datetime NOT NULL, `content` varchar(255) NOT NULL, `blogpost_comment_author` binary(16) NOT NULL, `blogpost_id` binary(16) DEFAULT NULL ); CREATE TABLE `blogpost_comments` ( `blogpost_id` binary(16) NOT NULL, `comment_id` binary(16) NOT NULL ); ALTER TABLE `blogpost` ADD PRIMARY KEY (`id`), ADD KEY `FK_blogpost_author` (`blogpost_author`); ALTER TABLE `blogpost_comment` ADD PRIMARY KEY (`id`), ADD CONSTRAINT `FK_blogpost_comment_author` FOREIGN KEY (`blogpost_comment_author`) REFERENCES `trampoline_user` (`id`), ADD CONSTRAINT `fk_blogpost_comment_blogpost` FOREIGN KEY (`blogpost_id`) REFERENCES `blogpost` (`id`); ALTER TABLE `blogpost_comments` ADD UNIQUE KEY `UK_jxj0my1uu4x2ung6qtofj6uyo` (`comment_id`), ADD KEY `fk_blogpost_blogpost_comment` (`blogpost_id`);
<gh_stars>10-100 -- file:jsonb.sql ln:776 expect:true SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'
-- file:triggers.sql ln:871 expect:true UPDATE city_table SET city_name = NEW.city_name, population = NEW.population, country_id = ctry_id WHERE city_id = OLD.city_id
<reponame>scheltwort-it-services/common_schema -- -- -- delimiter // drop procedure if exists _get_split_query_table_definitions_clause // create procedure _get_split_query_table_definitions_clause( in id_from int unsigned, in id_to int unsigned, in split_query_type enum ( 'unsupported', 'delete', 'update', 'select', 'insert_select', 'replace_select'), out table_definitions_found tinyint unsigned, out table_definitions_id_from int unsigned, out table_definitions_id_to int unsigned ) comment 'Get type of query supported by split() statement' language SQL deterministic reads sql data sql security invoker main_body: begin declare statement_level int unsigned; declare starting_id int unsigned; declare terminating_id int unsigned; declare following_select_id int unsigned; set table_definitions_found := false; set table_definitions_id_from := null; set table_definitions_id_to := null; if split_query_type = 'unsupported' then leave main_body; end if; set @_statement_level=null; select level from _sql_tokens where id = id_from into @_statement_level; set statement_level=@_statement_level; if split_query_type = 'update' then select MIN(id) from _sql_tokens where (id between id_from and id_to) and level = statement_level and state = 'alpha' and LOWER(token) = 'set' into @_terminating_id; set terminating_id=@_terminating_id; if terminating_id is not null then set table_definitions_found := true; set table_definitions_id_from := id_from + 1; set table_definitions_id_to := terminating_id - 1; end if; leave main_body; end if; if split_query_type = 'delete' then -- find FROM select MIN(id) from _sql_tokens where (id between id_from and id_to) and level = statement_level and state = 'alpha' and LOWER(token) = 'from' into @_starting_id; set starting_id=@_starting_id; if starting_id is not null then set table_definitions_found := true; set table_definitions_id_from := starting_id + 1; -- But if there's USING, then override: select MIN(id) from _sql_tokens where (id between table_definitions_id_from and id_to) and level = statement_level and state = 'alpha' and LOWER(token) = 'using' into @_starting_id; set starting_id=@_starting_id; if starting_id is not null then set table_definitions_id_from := starting_id + 1; end if; -- now find the terminating token: WHERE, ORDER or LIMIT (or end of line) select MIN(id) from _sql_tokens where (id between table_definitions_id_from and id_to) and level = statement_level and state = 'alpha' and LOWER(token) in ('where', 'order', 'limit') into @_terminating_id; set terminating_id=@_terminating_id; if terminating_id is not null then set table_definitions_id_to := terminating_id - 1; else set table_definitions_id_to := id_to; end if; end if; leave main_body; end if; if split_query_type in ('insert_select', 'replace_select') then -- We know for sure the 'INSERT' or 'REPLACE' are followed by a 'SELECT'. -- It just so happens that there's nothing special about it: we can parse the query -- as if it were a SELECT query: we just look for the FROM clause. set split_query_type := 'select'; end if; if split_query_type = 'select' then -- find FROM select MIN(id) from _sql_tokens where (id between id_from and id_to) and level = statement_level and state = 'alpha' and LOWER(token) = 'from' into @_starting_id; set starting_id=@_starting_id; if starting_id is not null then set table_definitions_found := true; set table_definitions_id_from := starting_id + 1; -- now find the terminating token: WHERE, ORDER or LIMIT (or end of line) select MIN(id) from _sql_tokens where (id between table_definitions_id_from and id_to) and level = statement_level and state = 'alpha' and LOWER(token) in ('partition', 'where', 'group', 'having', 'order', 'limit', 'procedure', 'into', 'for', 'lock') into @_terminating_id; set terminating_id=@_terminating_id; if terminating_id is not null then set table_definitions_id_to := terminating_id - 1; else set table_definitions_id_to := id_to; end if; end if; leave main_body; end if; end; // delimiter ;
with histogram as ( select case when di.itemid in ( -- HEART RATE 211, --"Heart Rate" 220045, --"Heart Rate" -- Systolic/diastolic 51, -- Arterial BP [Systolic] 442, -- Manual BP [Systolic] 455, -- NBP [Systolic] 6701, -- Arterial BP #2 [Systolic] 220179, -- Non Invasive Blood Pressure systolic 220050, -- Arterial Blood Pressure systolic 8368, -- Arterial BP [Diastolic] 8440, -- Manual BP [Diastolic] 8441, -- NBP [Diastolic] 8555, -- Arterial BP #2 [Diastolic] 220180, -- Non Invasive Blood Pressure diastolic 220051, -- Arterial Blood Pressure diastolic -- MEAN ARTERIAL PRESSURE 456, --"NBP Mean" 52, --"Arterial BP Mean" 6702, -- Arterial BP Mean #2 443, -- Manual BP Mean(calc) 220052, --"Arterial Blood Pressure mean" 220181, --"Non Invasive Blood Pressure mean" 225312, --"ART BP mean" -- RESPIRATORY RATE 618,-- Respiratory Rate 615,-- Resp Rate (Total) 220210,-- Respiratory Rate 224690, -- Respiratory Rate (Total) -- SPO2, peripheral 646, 220277, -- GLUCOSE, both lab and fingerstick 807,-- Fingerstick Glucose 811,-- Glucose (70-105) 1529,-- Glucose 3745,-- BloodGlucose 3744,-- Blood Glucose 225664,-- Glucose finger stick 220621,-- Glucose (serum) 226537,-- Glucose (whole blood) -- TEMPERATURE 223762, -- "Temperature Celsius" 676, -- "Temperature C" 223761, -- "Temperature Fahrenheit" 678 -- "Temperature F" ) then 0 WHEN ( di.itemid >= 1 AND di.itemid < 161 ) THEN 1 WHEN ( di.itemid >= 161 AND di.itemid < 428 ) THEN 2 WHEN ( di.itemid >= 428 AND di.itemid < 615 ) THEN 3 WHEN ( di.itemid >= 615 AND di.itemid < 742 ) THEN 4 WHEN ( di.itemid >= 742 AND di.itemid < 3338 ) THEN 5 WHEN ( di.itemid >= 3338 AND di.itemid < 3723 ) THEN 6 WHEN ( di.itemid >= 3723 AND di.itemid < 8523 ) THEN 7 WHEN ( di.itemid >= 8523 AND di.itemid < 220074 ) THEN 8 WHEN ( di.itemid >= 220074 AND di.itemid < 323769 ) THEN 9 ELSE 10 end as bucket , min(di.itemid) as minitemid , max(di.itemid) as maxitemid , count(di.itemid) as freq from d_items di left join chartevents ce on di.itemid = ce.itemid group by bucket order by bucket ) select bucket, minitemid, maxitemid, freq, repeat('*', (freq::float / max(freq) over() * 20)::int) as bar from histogram;
<reponame>smith750/kc DELIMITER / alter table EPS_PROPOSAL_BUDGET_EXT drop column VER_NBR / alter table EPS_PROPOSAL_BUDGET_EXT drop column OBJ_ID / alter table EPS_PROPOSAL_BUDGET_EXT drop column UPDATE_TIMESTAMP / alter table EPS_PROPOSAL_BUDGET_EXT drop column UPDATE_USER / alter table EPS_PROPOSAL_BUDGET_EXT add column PROPOSAL_NUMBER varchar(12) / update EPS_PROPOSAL_BUDGET_EXT budget set PROPOSAL_NUMBER = (select prop.PROPOSAL_NUMBER from EPS_PROPOSAL prop left join BUDGET_DOCUMENT budgetDoc on prop.DOCUMENT_NUMBER = budgetDoc.PARENT_DOCUMENT_KEY where budgetDoc.DOCUMENT_NUMBER = budget.DOCUMENT_NUMBER) / alter table EPS_PROPOSAL_BUDGET_EXT modify column PROPOSAL_NUMBER varchar(12) not null / alter table EPS_PROPOSAL_BUDGET_EXT add column STATUS_CODE char(1) / update EPS_PROPOSAL_BUDGET_EXT prop_budget set STATUS_CODE = (select BUDGET_STATUS from EPS_PROPOSAL prop where prop.PROPOSAL_NUMBER = prop_budget.PROPOSAL_NUMBER) where (select FINAL_VERSION_FLAG from BUDGET where prop_budget.BUDGET_ID = BUDGET.BUDGET_ID) = 'Y' / update EPS_PROPOSAL_BUDGET_EXT prop_budget set STATUS_CODE = '2' where STATUS_CODE is null / alter table EPS_PROPOSAL_BUDGET_EXT modify column STATUS_CODE char(1) not null DELIMITER ;
<reponame>MichaelRechenberg/cs411project /* Wipe the slate clean */ DROP TABLE IF EXISTS HeartbeatSequence; DROP TABLE IF EXISTS Comments; DROP TABLE IF EXISTS Hardware; DROP TABLE IF EXISTS Machine; DROP TABLE IF EXISTS Users; DROP TABLE IF EXISTS DownageCategory; DROP TABLE IF EXISTS DownageCategoryBatch; CREATE TABLE IF NOT EXISTS Users ( NetID VARCHAR(20) NOT NULL, isTA BOOLEAN NOT NULL, FirstName VARCHAR(50) NOT NULL, LastName VARCHAR(50) NOT NULL, PRIMARY KEY(NetID) ); CREATE TABLE IF NOT EXISTS Hardware ( HardwareID INT NOT NULL, Type INT NOT NULL, PRIMARY KEY(HardwareID) ); CREATE TABLE IF NOT EXISTS Machine ( MachineID INT NOT NULL, /* Can be NULL b/c it could be the case that no one has used this machine yet */ NetIDofLastUsed VARCHAR(20), /* 0 for BROKEN, 1 for ALIVE */ Status INT NOT NULL, FOREIGN KEY(NetIDofLastUsed) REFERENCES Users(NetID), PRIMARY KEY(MachineID) ); CREATE TABLE IF NOT EXISTS Comments ( CommentID INT NOT NULL AUTO_INCREMENT, LastModifiedTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, /* The Downage Category for this Comment */ Category VARCHAR(50) NOT NULL, /* The text comment made by the user */ CommentText VARCHAR(400) NOT NULL, /* Flag indicating if this comment has been resolved. Once resolved, a Comment should not be made "unresolved" again */ /* DEFAULT FALSE b/c when you first create a Comment, it isn't resolved yet */ IsResolved BOOLEAN NOT NULL DEFAULT FALSE, /* Id for a piece of hardware associated with this comment (if any) */ HardwareID INT, /* NetID of the student authoring this comment */ AuthorNetID VARCHAR(20) NOT NULL, /* MachineID of the machine this comment is associated with */ MachineID INT NOT NULL, FOREIGN KEY(MachineID) REFERENCES Machine(MachineID), FOREIGN KEY(AuthorNetID) REFERENCES Users(NetID), FOREIGN KEY(HardwareID) REFERENCES Hardware(HardwareID), PRIMARY KEY(CommentID) ); CREATE TABLE IF NOT EXISTS HeartbeatSequence ( SeqID INT NOT NULL AUTO_INCREMENT, FirstTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, LastTS TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, Tfail TIME NOT NULL, /* The number of heartbeats received during this heartbeat sequence */ /* UPDATE this column by one each time we get a heartbeat and LastTS will be updated to the current timestamp automatically */ NumHeartBeats INT NOT NULL DEFAULT 0, NetID VARCHAR(20) NOT NULL, MachineID INT NOT NULL, FOREIGN KEY(NetID) REFERENCES Users(NetID), FOREIGN KEY(MachineID) REFERENCES Machine(MachineID), PRIMARY KEY(SeqID) ); CREATE TABLE IF NOT EXISTS DownageCategoryBatch ( BatchID INT NOT NULL AUTO_INCREMENT, CompletedTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(BatchID) ); CREATE TABLE IF NOT EXISTS DownageCategory ( DownageCategoryID INT NOT NULL AUTO_INCREMENT, BatchID INT NOT NULL, BatchRank INT NOT NULL, CategoryText VARCHAR(128) NOT NULL, /* A NULL MachineID means that this DownageCategory is for lab-wide downage categories */ MachineID INT, PRIMARY KEY (DownageCategoryID), FOREIGN KEY(BatchID) REFERENCES DownageCategoryBatch(BatchID), FOREIGN KEY(MachineID) REFERENCES Machine(MachineID) ); CREATE TABLE IF NOT EXISTS MachineLocation ( MachineID INT NOT NULL, X_COORDINATE INT NOT NULL, Y_COORDINATE INT NOT NULL, FOREIGN KEY(MachineID) REFERENCES Machine(MachineID), PRIMARY KEY(MachineID) );
<reponame>Sandeepchau/MixErp22 DROP FUNCTION IF EXISTS sales.settle_customer_due(_customer_id integer, _office_id integer); CREATE FUNCTION sales.settle_customer_due(_customer_id integer, _office_id integer) RETURNS void STRICT VOLATILE AS $$ DECLARE _settled_transactions bigint[]; DECLARE _settling_amount numeric(30, 6); DECLARE _closing_balance numeric(30, 6); DECLARE _total_sales numeric(30, 6); DECLARE _customer_account_id integer = inventory.get_account_id_by_customer_id(_customer_id); BEGIN --Closing balance of the customer SELECT SUM ( CASE WHEN tran_type = 'Cr' THEN amount_in_local_currency ELSE amount_in_local_currency * -1 END ) INTO _closing_balance FROM finance.transaction_details INNER JOIN finance.transaction_master ON finance.transaction_master.transaction_master_id = finance.transaction_details.transaction_master_id WHERE finance.transaction_master.verification_status_id > 0 AND NOT finance.transaction_master.deleted AND finance.transaction_master.office_id = _office_id AND finance.transaction_details.account_id = _customer_account_id; --Since customer account is receivable, change the balance to debit _closing_balance := _closing_balance * -1; --Sum of total sales amount SELECT SUM ( COALESCE(inventory.checkouts.taxable_total, 0) + COALESCE(inventory.checkouts.tax, 0) + COALESCE(inventory.checkouts.nontaxable_total, 0) - COALESCE(inventory.checkouts.discount, 0) ) INTO _total_sales FROM inventory.checkouts INNER JOIN sales.sales ON sales.sales.checkout_id = inventory.checkouts.checkout_id INNER JOIN finance.transaction_master ON inventory.checkouts.transaction_master_id = finance.transaction_master.transaction_master_id WHERE finance.transaction_master.verification_status_id > 0 AND finance.transaction_master.office_id = _office_id AND sales.sales.customer_id = _customer_id; _settling_amount := _total_sales - _closing_balance; WITH all_sales AS ( SELECT inventory.checkouts.transaction_master_id, SUM ( COALESCE(inventory.checkouts.taxable_total, 0) + COALESCE(inventory.checkouts.tax, 0) + COALESCE(inventory.checkouts.nontaxable_total, 0) - COALESCE(inventory.checkouts.discount, 0) ) as due FROM inventory.checkouts INNER JOIN sales.sales ON sales.sales.checkout_id = inventory.checkouts.checkout_id INNER JOIN finance.transaction_master ON inventory.checkouts.transaction_master_id = finance.transaction_master.transaction_master_id WHERE finance.transaction_master.book = ANY(ARRAY['Sales.Direct', 'Sales.Delivery']) AND finance.transaction_master.office_id = _office_id AND finance.transaction_master.verification_status_id > 0 --Approved AND sales.sales.customer_id = _customer_id --of this customer GROUP BY inventory.checkouts.transaction_master_id ), sales_summary AS ( SELECT transaction_master_id, due, SUM(due) OVER(ORDER BY transaction_master_id) AS cumulative_due FROM all_sales ) SELECT ARRAY_AGG(transaction_master_id) INTO _settled_transactions FROM sales_summary WHERE cumulative_due <= _settling_amount; UPDATE sales.sales SET credit_settled = true WHERE transaction_master_id = ANY(_settled_transactions); END $$ LANGUAGE plpgsql;
<reponame>Vasyka/koku -- -- PostgreSQL database dump -- -- Dumped from database version 12.6 (Debian 12.6-1.pgdg100+1) -- Dumped by pg_dump version 12.6 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; -- -- Name: process_cost_model_audit(); Type: FUNCTION; Schema: ; Owner: - -- CREATE FUNCTION process_cost_model_audit() RETURNS trigger LANGUAGE plpgsql AS $$ DECLARE provider_uuids uuid[]; BEGIN -- -- Create a row in cost_model_audit to reflect the operation performed on cost_model, -- make use of the special variable TG_OP to work out the operation. -- IF (TG_OP = 'DELETE') THEN provider_uuids := (SELECT array_agg(provider_uuid) FROM cost_model_map WHERE cost_model_id = OLD.uuid); INSERT INTO cost_model_audit SELECT nextval('cost_model_audit_id_seq'), 'DELETE', now(), provider_uuids, OLD.*; RETURN OLD; ELSIF (TG_OP = 'UPDATE') THEN provider_uuids := (SELECT array_agg(provider_uuid) FROM cost_model_map WHERE cost_model_id = NEW.uuid); INSERT INTO cost_model_audit SELECT nextval('cost_model_audit_id_seq'), 'UPDATE', now(), provider_uuids, NEW.*; RETURN NEW; ELSIF (TG_OP = 'INSERT') THEN provider_uuids := (SELECT array_agg(provider_uuid) FROM cost_model_map WHERE cost_model_id = NEW.uuid); INSERT INTO cost_model_audit SELECT nextval('cost_model_audit_id_seq'), 'INSERT', now(), provider_uuids, NEW.*; RETURN NEW; END IF; RETURN NULL; -- result is ignored since this is an AFTER trigger END; $$; SET default_tablespace = ''; SET default_table_access_method = heap; -- -- Name: cost_model; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE cost_model ( uuid uuid NOT NULL, name text NOT NULL, description text NOT NULL, source_type character varying(50) NOT NULL, created_timestamp timestamp with time zone NOT NULL, updated_timestamp timestamp with time zone NOT NULL, rates jsonb NOT NULL, markup jsonb NOT NULL ); -- -- Name: cost_model_audit; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE cost_model_audit ( id integer NOT NULL, operation character varying(16) NOT NULL, audit_timestamp timestamp with time zone NOT NULL, provider_uuids uuid[], uuid uuid NOT NULL, name text NOT NULL, description text NOT NULL, source_type character varying(50) NOT NULL, created_timestamp timestamp with time zone NOT NULL, updated_timestamp timestamp with time zone NOT NULL, rates jsonb NOT NULL, markup jsonb NOT NULL ); -- -- Name: cost_model_audit_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE cost_model_audit_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: cost_model_audit_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE cost_model_audit_id_seq OWNED BY cost_model_audit.id; -- -- Name: cost_model_map; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE cost_model_map ( id integer NOT NULL, provider_uuid uuid NOT NULL, cost_model_id uuid ); -- -- Name: cost_model_map_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE cost_model_map_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: cost_model_map_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE cost_model_map_id_seq OWNED BY cost_model_map.id; -- -- Name: django_migrations; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE django_migrations ( id integer NOT NULL, app character varying(255) NOT NULL, name character varying(255) NOT NULL, applied timestamp with time zone NOT NULL ); -- -- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE django_migrations_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE django_migrations_id_seq OWNED BY django_migrations.id; -- -- Name: partitioned_tables; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE partitioned_tables ( id integer NOT NULL, schema_name text NOT NULL, table_name text NOT NULL, partition_of_table_name text NOT NULL, partition_type text NOT NULL, partition_col text NOT NULL, partition_parameters jsonb NOT NULL, active boolean DEFAULT true NOT NULL ); -- -- Name: partitioned_tables_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE partitioned_tables_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: partitioned_tables_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE partitioned_tables_id_seq OWNED BY partitioned_tables.id; -- -- Name: presto_delete_wrapper_log; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE presto_delete_wrapper_log ( id uuid DEFAULT public.uuid_generate_v4() NOT NULL, action_ts timestamp with time zone DEFAULT now() NOT NULL, table_name text NOT NULL, where_clause text NOT NULL, result_rows bigint ); -- -- Name: TABLE presto_delete_wrapper_log; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON TABLE presto_delete_wrapper_log IS 'Table to log and execute delete statements initiated from Presto'; -- -- Name: COLUMN presto_delete_wrapper_log.table_name; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_delete_wrapper_log.table_name IS 'Target table from which to delete'; -- -- Name: COLUMN presto_delete_wrapper_log.where_clause; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_delete_wrapper_log.where_clause IS 'Where clause for delete action'; -- -- Name: COLUMN presto_delete_wrapper_log.result_rows; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_delete_wrapper_log.result_rows IS 'Number of records affected by the delete action'; -- -- Name: presto_pk_delete_wrapper_log; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE presto_pk_delete_wrapper_log ( transaction_id text NOT NULL, action_ts timestamp with time zone DEFAULT now() NOT NULL, table_name text NOT NULL, pk_column text NOT NULL, pk_value text NOT NULL, pk_value_cast text NOT NULL ); -- -- Name: TABLE presto_pk_delete_wrapper_log; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON TABLE presto_pk_delete_wrapper_log IS 'Table to hold primary key values to use when bulk-deleting using the presto delete wrapper log'; -- -- Name: COLUMN presto_pk_delete_wrapper_log.transaction_id; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_pk_delete_wrapper_log.transaction_id IS 'Presto transaction identifier'; -- -- Name: COLUMN presto_pk_delete_wrapper_log.table_name; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_pk_delete_wrapper_log.table_name IS 'Target table in which the primary key values reside'; -- -- Name: COLUMN presto_pk_delete_wrapper_log.pk_column; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_pk_delete_wrapper_log.pk_column IS 'Name of the primary key column for the target table'; -- -- Name: COLUMN presto_pk_delete_wrapper_log.pk_value; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_pk_delete_wrapper_log.pk_value IS 'String representation of the primary key value'; -- -- Name: COLUMN presto_pk_delete_wrapper_log.pk_value_cast; Type: COMMENT; Schema: ; Owner: - -- COMMENT ON COLUMN presto_pk_delete_wrapper_log.pk_value_cast IS 'Data type to which the string primary key value should be cast'; -- -- Name: reporting_awscostentrylineitem_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentrylineitem_daily_summary ( usage_start date NOT NULL, usage_end date, usage_account_id character varying(50) NOT NULL, product_code character varying(50) NOT NULL, product_family character varying(150), availability_zone character varying(50), region character varying(50), instance_type character varying(50), unit character varying(63), resource_ids text[], resource_count integer, usage_amount numeric(24,9), normalization_factor double precision, normalized_usage_amount double precision, currency_code character varying(10) NOT NULL, unblended_rate numeric(24,9), unblended_cost numeric(24,9), markup_cost numeric(24,9), blended_rate numeric(24,9), blended_cost numeric(24,9), public_on_demand_cost numeric(24,9), public_on_demand_rate numeric(24,9), tax_type text, tags jsonb, source_uuid uuid, account_alias_id integer, cost_entry_bill_id integer, organizational_unit_id integer, uuid uuid NOT NULL ) PARTITION BY RANGE (usage_start); -- -- Name: reporting_aws_compute_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_compute_summary AS SELECT row_number() OVER (ORDER BY c.usage_start, c.instance_type, c.source_uuid) AS id, c.usage_start, c.usage_start AS usage_end, c.instance_type, r.resource_ids, cardinality(r.resource_ids) AS resource_count, c.usage_amount, c.unit, c.unblended_cost, c.markup_cost, c.currency_code, c.source_uuid FROM (( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.instance_type, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, reporting_awscostentrylineitem_daily_summary.source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.instance_type, reporting_awscostentrylineitem_daily_summary.source_uuid) c JOIN ( SELECT x.usage_start, x.instance_type, array_agg(DISTINCT x.resource_id ORDER BY x.resource_id) AS resource_ids FROM ( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.instance_type, unnest(reporting_awscostentrylineitem_daily_summary.resource_ids) AS resource_id FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL))) x GROUP BY x.usage_start, x.instance_type) r ON (((c.usage_start = r.usage_start) AND ((c.instance_type)::text = (r.instance_type)::text)))) WITH NO DATA; -- -- Name: reporting_aws_compute_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_compute_summary_by_account AS SELECT row_number() OVER (ORDER BY c.usage_start, c.usage_account_id, c.instance_type) AS id, c.usage_start, c.usage_start AS usage_end, c.usage_account_id, c.account_alias_id, c.organizational_unit_id, c.instance_type, r.resource_ids, cardinality(r.resource_ids) AS resource_count, c.usage_amount, c.unit, c.unblended_cost, c.markup_cost, c.currency_code, c.source_uuid FROM (( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.instance_type, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.instance_type) c JOIN ( SELECT x.usage_start, x.usage_account_id, max(x.account_alias_id) AS account_alias_id, x.instance_type, array_agg(DISTINCT x.resource_id ORDER BY x.resource_id) AS resource_ids FROM ( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.account_alias_id, reporting_awscostentrylineitem_daily_summary.instance_type, unnest(reporting_awscostentrylineitem_daily_summary.resource_ids) AS resource_id FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL))) x GROUP BY x.usage_start, x.usage_account_id, x.instance_type) r ON (((c.usage_start = r.usage_start) AND ((c.instance_type)::text = (r.instance_type)::text) AND ((c.usage_account_id)::text = (r.usage_account_id)::text)))) WITH NO DATA; -- -- Name: reporting_aws_compute_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_compute_summary_by_region AS SELECT row_number() OVER (ORDER BY c.usage_start, c.usage_account_id, c.region, c.availability_zone, c.instance_type) AS id, c.usage_start, c.usage_start AS usage_end, c.usage_account_id, c.account_alias_id, c.organizational_unit_id, c.region, c.availability_zone, c.instance_type, r.resource_ids, cardinality(r.resource_ids) AS resource_count, c.usage_amount, c.unit, c.unblended_cost, c.markup_cost, c.currency_code, c.source_uuid FROM (( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, reporting_awscostentrylineitem_daily_summary.instance_type, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, reporting_awscostentrylineitem_daily_summary.instance_type) c JOIN ( SELECT x.usage_start, x.usage_account_id, max(x.account_alias_id) AS account_alias_id, x.region, x.availability_zone, x.instance_type, array_agg(DISTINCT x.resource_id ORDER BY x.resource_id) AS resource_ids FROM ( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.account_alias_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, reporting_awscostentrylineitem_daily_summary.instance_type, unnest(reporting_awscostentrylineitem_daily_summary.resource_ids) AS resource_id FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL))) x GROUP BY x.usage_start, x.usage_account_id, x.region, x.availability_zone, x.instance_type) r ON (((c.usage_start = r.usage_start) AND ((c.region)::text = (r.region)::text) AND ((c.availability_zone)::text = (r.availability_zone)::text) AND ((c.instance_type)::text = (r.instance_type)::text) AND ((c.usage_account_id)::text = (r.usage_account_id)::text)))) WITH NO DATA; -- -- Name: reporting_aws_compute_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_compute_summary_by_service AS SELECT row_number() OVER (ORDER BY c.usage_start, c.usage_account_id, c.product_code, c.product_family, c.instance_type) AS id, c.usage_start, c.usage_start AS usage_end, c.usage_account_id, c.account_alias_id, c.organizational_unit_id, c.product_code, c.product_family, c.instance_type, r.resource_ids, cardinality(r.resource_ids) AS resource_count, c.usage_amount, c.unit, c.unblended_cost, c.markup_cost, c.currency_code, c.source_uuid FROM (( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family, reporting_awscostentrylineitem_daily_summary.instance_type, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family, reporting_awscostentrylineitem_daily_summary.instance_type) c JOIN ( SELECT x.usage_start, x.usage_account_id, max(x.account_alias_id) AS account_alias_id, x.product_code, x.product_family, x.instance_type, array_agg(DISTINCT x.resource_id ORDER BY x.resource_id) AS resource_ids FROM ( SELECT reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.account_alias_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family, reporting_awscostentrylineitem_daily_summary.instance_type, unnest(reporting_awscostentrylineitem_daily_summary.resource_ids) AS resource_id FROM reporting_awscostentrylineitem_daily_summary WHERE ((reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_awscostentrylineitem_daily_summary.instance_type IS NOT NULL))) x GROUP BY x.usage_start, x.usage_account_id, x.product_code, x.product_family, x.instance_type) r ON (((c.usage_start = r.usage_start) AND ((c.product_code)::text = (r.product_code)::text) AND ((c.product_family)::text = (r.product_family)::text) AND ((c.instance_type)::text = (r.instance_type)::text) AND ((c.usage_account_id)::text = (r.usage_account_id)::text)))) WITH NO DATA; -- -- Name: reporting_aws_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.source_uuid) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, reporting_awscostentrylineitem_daily_summary.source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_aws_cost_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_cost_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id WITH NO DATA; -- -- Name: reporting_aws_cost_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_cost_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone WITH NO DATA; -- -- Name: reporting_aws_cost_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_cost_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_aws_database_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_database_summary AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.product_code, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (((reporting_awscostentrylineitem_daily_summary.product_code)::text = ANY ((ARRAY['AmazonRDS'::character varying, 'AmazonDynamoDB'::character varying, 'AmazonElastiCache'::character varying, 'AmazonNeptune'::character varying, 'AmazonRedshift'::character varying, 'AmazonDocumentDB'::character varying])::text[])) AND (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code WITH NO DATA; -- -- Name: reporting_aws_network_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_network_summary AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.product_code, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (((reporting_awscostentrylineitem_daily_summary.product_code)::text = ANY ((ARRAY['AmazonVPC'::character varying, 'AmazonCloudFront'::character varying, 'AmazonRoute53'::character varying, 'AmazonAPIGateway'::character varying])::text[])) AND (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code WITH NO DATA; -- -- Name: reporting_aws_storage_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_storage_summary AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.source_uuid, reporting_awscostentrylineitem_daily_summary.product_family) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.product_family, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, reporting_awscostentrylineitem_daily_summary.source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (((reporting_awscostentrylineitem_daily_summary.product_family)::text ~~ '%Storage%'::text) AND ((reporting_awscostentrylineitem_daily_summary.unit)::text = 'GB-Mo'::text) AND (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.source_uuid, reporting_awscostentrylineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_aws_storage_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_storage_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_family) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.product_family, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (((reporting_awscostentrylineitem_daily_summary.product_family)::text ~~ '%Storage%'::text) AND ((reporting_awscostentrylineitem_daily_summary.unit)::text = 'GB-Mo'::text) AND (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_aws_storage_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_storage_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, reporting_awscostentrylineitem_daily_summary.product_family) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, reporting_awscostentrylineitem_daily_summary.product_family, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (((reporting_awscostentrylineitem_daily_summary.product_family)::text ~~ '%Storage%'::text) AND ((reporting_awscostentrylineitem_daily_summary.unit)::text = 'GB-Mo'::text) AND (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.region, reporting_awscostentrylineitem_daily_summary.availability_zone, reporting_awscostentrylineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_aws_storage_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_aws_storage_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family) AS id, reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_start AS usage_end, reporting_awscostentrylineitem_daily_summary.usage_account_id, max(reporting_awscostentrylineitem_daily_summary.account_alias_id) AS account_alias_id, max(reporting_awscostentrylineitem_daily_summary.organizational_unit_id) AS organizational_unit_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family, sum(reporting_awscostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_awscostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_awscostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_awscostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_awscostentrylineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_awscostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_awscostentrylineitem_daily_summary WHERE (((reporting_awscostentrylineitem_daily_summary.product_family)::text ~~ '%Storage%'::text) AND ((reporting_awscostentrylineitem_daily_summary.unit)::text = 'GB-Mo'::text) AND (reporting_awscostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_awscostentrylineitem_daily_summary.usage_start, reporting_awscostentrylineitem_daily_summary.usage_account_id, reporting_awscostentrylineitem_daily_summary.product_code, reporting_awscostentrylineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_awsaccountalias; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awsaccountalias ( id integer NOT NULL, account_id character varying(50) NOT NULL, account_alias character varying(63) ); -- -- Name: reporting_awsaccountalias_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awsaccountalias_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awsaccountalias_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awsaccountalias_id_seq OWNED BY reporting_awsaccountalias.id; -- -- Name: reporting_awscostentry; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentry ( id integer NOT NULL, interval_start timestamp with time zone NOT NULL, interval_end timestamp with time zone NOT NULL, bill_id integer NOT NULL ); -- -- Name: reporting_awscostentry_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentry_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentry_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentry_id_seq OWNED BY reporting_awscostentry.id; -- -- Name: reporting_awscostentrybill; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentrybill ( id integer NOT NULL, billing_resource character varying(50) NOT NULL, bill_type character varying(50), payer_account_id character varying(50), billing_period_start timestamp with time zone NOT NULL, billing_period_end timestamp with time zone NOT NULL, summary_data_creation_datetime timestamp with time zone, summary_data_updated_datetime timestamp with time zone, finalized_datetime timestamp with time zone, derived_cost_datetime timestamp with time zone, provider_id uuid NOT NULL ); -- -- Name: reporting_awscostentrybill_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentrybill_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentrybill_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentrybill_id_seq OWNED BY reporting_awscostentrybill.id; -- -- Name: reporting_awscostentrylineitem; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentrylineitem ( id bigint NOT NULL, tags jsonb, invoice_id character varying(63), line_item_type character varying(50) NOT NULL, usage_account_id character varying(50) NOT NULL, usage_start timestamp with time zone NOT NULL, usage_end timestamp with time zone NOT NULL, product_code character varying(50) NOT NULL, usage_type character varying(50), operation character varying(50), availability_zone character varying(50), resource_id character varying(256), usage_amount numeric(24,9), normalization_factor double precision, normalized_usage_amount numeric(24,9), currency_code character varying(10) NOT NULL, unblended_rate numeric(24,9), unblended_cost numeric(24,9), blended_rate numeric(24,9), blended_cost numeric(24,9), public_on_demand_cost numeric(24,9), public_on_demand_rate numeric(24,9), reservation_amortized_upfront_fee numeric(24,9), reservation_amortized_upfront_cost_for_usage numeric(24,9), reservation_recurring_fee_for_usage numeric(24,9), reservation_unused_quantity numeric(24,9), reservation_unused_recurring_fee numeric(24,9), tax_type text, cost_entry_id integer NOT NULL, cost_entry_bill_id integer NOT NULL, cost_entry_pricing_id integer, cost_entry_product_id integer, cost_entry_reservation_id integer ); -- -- Name: reporting_awscostentrylineitem_daily; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentrylineitem_daily ( id bigint NOT NULL, line_item_type character varying(50) NOT NULL, usage_account_id character varying(50) NOT NULL, usage_start date NOT NULL, usage_end date, product_code character varying(50) NOT NULL, usage_type character varying(50), operation character varying(50), availability_zone character varying(50), resource_id character varying(256), usage_amount numeric(24,9), normalization_factor double precision, normalized_usage_amount double precision, currency_code character varying(10) NOT NULL, unblended_rate numeric(24,9), unblended_cost numeric(24,9), blended_rate numeric(24,9), blended_cost numeric(24,9), public_on_demand_cost numeric(24,9), public_on_demand_rate numeric(24,9), tax_type text, tags jsonb, cost_entry_bill_id integer, cost_entry_pricing_id integer, cost_entry_product_id integer, cost_entry_reservation_id integer ); -- -- Name: reporting_awscostentrylineitem_daily_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentrylineitem_daily_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentrylineitem_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentrylineitem_daily_id_seq OWNED BY reporting_awscostentrylineitem_daily.id; -- -- Name: reporting_awscostentrylineitem_daily_summary_default; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentrylineitem_daily_summary_default ( usage_start date NOT NULL, usage_end date, usage_account_id character varying(50) NOT NULL, product_code character varying(50) NOT NULL, product_family character varying(150), availability_zone character varying(50), region character varying(50), instance_type character varying(50), unit character varying(63), resource_ids text[], resource_count integer, usage_amount numeric(24,9), normalization_factor double precision, normalized_usage_amount double precision, currency_code character varying(10) NOT NULL, unblended_rate numeric(24,9), unblended_cost numeric(24,9), markup_cost numeric(24,9), blended_rate numeric(24,9), blended_cost numeric(24,9), public_on_demand_cost numeric(24,9), public_on_demand_rate numeric(24,9), tax_type text, tags jsonb, source_uuid uuid, account_alias_id integer, cost_entry_bill_id integer, organizational_unit_id integer, uuid uuid NOT NULL ); ALTER TABLE ONLY reporting_awscostentrylineitem_daily_summary ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_default DEFAULT; -- -- Name: reporting_awscostentrylineitem_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentrylineitem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentrylineitem_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentrylineitem_id_seq OWNED BY reporting_awscostentrylineitem.id; -- -- Name: reporting_awscostentrypricing; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentrypricing ( id integer NOT NULL, term character varying(63), unit character varying(63) ); -- -- Name: reporting_awscostentrypricing_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentrypricing_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentrypricing_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentrypricing_id_seq OWNED BY reporting_awscostentrypricing.id; -- -- Name: reporting_awscostentryproduct; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentryproduct ( id integer NOT NULL, sku character varying(128), product_name text, product_family character varying(150), service_code character varying(50), region character varying(50), instance_type character varying(50), memory double precision, memory_unit character varying(24), vcpu integer, CONSTRAINT reporting_awscostentryproduct_vcpu_check CHECK ((vcpu >= 0)) ); -- -- Name: reporting_awscostentryproduct_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentryproduct_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentryproduct_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentryproduct_id_seq OWNED BY reporting_awscostentryproduct.id; -- -- Name: reporting_awscostentryreservation; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awscostentryreservation ( id integer NOT NULL, reservation_arn text NOT NULL, number_of_reservations integer, units_per_reservation numeric(24,9), start_time timestamp with time zone, end_time timestamp with time zone, CONSTRAINT reporting_awscostentryreservation_number_of_reservations_check CHECK ((number_of_reservations >= 0)) ); -- -- Name: reporting_awscostentryreservation_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awscostentryreservation_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awscostentryreservation_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awscostentryreservation_id_seq OWNED BY reporting_awscostentryreservation.id; -- -- Name: reporting_awsenabledtagkeys; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awsenabledtagkeys ( key character varying(253) NOT NULL, enabled boolean DEFAULT true NOT NULL ); -- -- Name: reporting_awsorganizationalunit; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awsorganizationalunit ( id integer NOT NULL, org_unit_name character varying(250) NOT NULL, org_unit_id character varying(50) NOT NULL, org_unit_path text NOT NULL, level smallint NOT NULL, created_timestamp date NOT NULL, deleted_timestamp date, account_alias_id integer, provider_id uuid, CONSTRAINT reporting_awsorganizationalunit_level_check CHECK ((level >= 0)) ); -- -- Name: reporting_awsorganizationalunit_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_awsorganizationalunit_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_awsorganizationalunit_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_awsorganizationalunit_id_seq OWNED BY reporting_awsorganizationalunit.id; -- -- Name: reporting_awstags_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awstags_summary ( uuid uuid NOT NULL, key text NOT NULL, "values" text[] NOT NULL, usage_account_id text, account_alias_id integer, cost_entry_bill_id integer NOT NULL ); -- -- Name: reporting_awstags_values; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_awstags_values ( uuid uuid NOT NULL, key text NOT NULL, value text NOT NULL, usage_account_ids text[] NOT NULL, account_aliases text[] NOT NULL ); -- -- Name: reporting_azurecostentrylineitem_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azurecostentrylineitem_daily_summary ( subscription_guid text NOT NULL, instance_type text, service_name text, resource_location text, tags jsonb, usage_start date NOT NULL, usage_end date, usage_quantity numeric(24,9), pretax_cost numeric(24,9), markup_cost numeric(24,9), currency text, instance_ids text[], instance_count integer, unit_of_measure text, source_uuid uuid, cost_entry_bill_id integer NOT NULL, meter_id integer, uuid uuid NOT NULL ) PARTITION BY RANGE (usage_start); -- -- Name: reporting_azure_compute_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_compute_summary AS SELECT row_number() OVER (ORDER BY c.usage_start, c.subscription_guid, c.instance_type) AS id, c.usage_start, c.usage_start AS usage_end, c.subscription_guid, c.instance_type, r.instance_ids, cardinality(r.instance_ids) AS instance_count, c.usage_quantity, c.unit_of_measure, c.pretax_cost, c.markup_cost, c.currency, c.source_uuid FROM (( SELECT reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.instance_type, sum(reporting_azurecostentrylineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_azurecostentrylineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE ((reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_azurecostentrylineitem_daily_summary.instance_type IS NOT NULL) AND (reporting_azurecostentrylineitem_daily_summary.unit_of_measure = 'Hrs'::text)) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.instance_type) c JOIN ( SELECT x.usage_start, x.subscription_guid, x.instance_type, array_agg(DISTINCT x.instance_id ORDER BY x.instance_id) AS instance_ids FROM ( SELECT reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.instance_type, unnest(reporting_azurecostentrylineitem_daily_summary.instance_ids) AS instance_id FROM reporting_azurecostentrylineitem_daily_summary WHERE ((reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_azurecostentrylineitem_daily_summary.instance_type IS NOT NULL))) x GROUP BY x.usage_start, x.subscription_guid, x.instance_type) r ON (((c.usage_start = r.usage_start) AND (c.subscription_guid = r.subscription_guid) AND (c.instance_type = r.instance_type)))) WITH NO DATA; -- -- Name: reporting_azure_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.source_uuid) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, reporting_azurecostentrylineitem_daily_summary.source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_azure_cost_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_cost_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, reporting_azurecostentrylineitem_daily_summary.subscription_guid, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid WITH NO DATA; -- -- Name: reporting_azure_cost_summary_by_location; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_cost_summary_by_location AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.resource_location) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.resource_location, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.resource_location WITH NO DATA; -- -- Name: reporting_azure_cost_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_cost_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_azure_database_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_database_summary AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name, sum(reporting_azurecostentrylineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_azurecostentrylineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE ((reporting_azurecostentrylineitem_daily_summary.service_name = ANY (ARRAY['Cosmos DB'::text, 'Cache for Redis'::text])) OR ((reporting_azurecostentrylineitem_daily_summary.service_name ~~* '%database%'::text) AND (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date))) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_azure_network_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_network_summary AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name, sum(reporting_azurecostentrylineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_azurecostentrylineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE ((reporting_azurecostentrylineitem_daily_summary.service_name = ANY (ARRAY['Virtual Network'::text, 'VPN'::text, 'DNS'::text, 'Traffic Manager'::text, 'ExpressRoute'::text, 'Load Balancer'::text, 'Application Gateway'::text])) AND (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_azure_storage_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_azure_storage_summary AS SELECT row_number() OVER (ORDER BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name) AS id, reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.usage_start AS usage_end, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name, sum(reporting_azurecostentrylineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_azurecostentrylineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_azurecostentrylineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_azurecostentrylineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_azurecostentrylineitem_daily_summary.currency) AS currency, (max((reporting_azurecostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_azurecostentrylineitem_daily_summary WHERE ((reporting_azurecostentrylineitem_daily_summary.service_name ~~ '%Storage%'::text) AND (reporting_azurecostentrylineitem_daily_summary.unit_of_measure = 'GB-Mo'::text) AND (reporting_azurecostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date)) GROUP BY reporting_azurecostentrylineitem_daily_summary.usage_start, reporting_azurecostentrylineitem_daily_summary.subscription_guid, reporting_azurecostentrylineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_azurecostentrybill; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azurecostentrybill ( id integer NOT NULL, billing_period_start timestamp with time zone NOT NULL, billing_period_end timestamp with time zone NOT NULL, summary_data_creation_datetime timestamp with time zone, summary_data_updated_datetime timestamp with time zone, finalized_datetime timestamp with time zone, derived_cost_datetime timestamp with time zone, provider_id uuid NOT NULL ); -- -- Name: reporting_azurecostentrybill_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_azurecostentrybill_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_azurecostentrybill_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_azurecostentrybill_id_seq OWNED BY reporting_azurecostentrybill.id; -- -- Name: reporting_azurecostentrylineitem_daily; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azurecostentrylineitem_daily ( id bigint NOT NULL, subscription_guid text NOT NULL, tags jsonb, usage_date date NOT NULL, usage_quantity numeric(24,9), pretax_cost numeric(24,9), cost_entry_bill_id integer NOT NULL, cost_entry_product_id integer, meter_id integer ); -- -- Name: reporting_azurecostentrylineitem_daily_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_azurecostentrylineitem_daily_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_azurecostentrylineitem_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_azurecostentrylineitem_daily_id_seq OWNED BY reporting_azurecostentrylineitem_daily.id; -- -- Name: reporting_azurecostentrylineitem_daily_summary_default; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azurecostentrylineitem_daily_summary_default ( subscription_guid text NOT NULL, instance_type text, service_name text, resource_location text, tags jsonb, usage_start date NOT NULL, usage_end date, usage_quantity numeric(24,9), pretax_cost numeric(24,9), markup_cost numeric(24,9), currency text, instance_ids text[], instance_count integer, unit_of_measure text, source_uuid uuid, cost_entry_bill_id integer NOT NULL, meter_id integer, uuid uuid NOT NULL ); ALTER TABLE ONLY reporting_azurecostentrylineitem_daily_summary ATTACH PARTITION reporting_azurecostentrylineitem_daily_summary_default DEFAULT; -- -- Name: reporting_azurecostentryproductservice; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azurecostentryproductservice ( id integer NOT NULL, instance_id text NOT NULL, resource_location text, consumed_service text, resource_type text, resource_group text, additional_info jsonb, service_tier text, service_name text, service_info1 text, service_info2 text, instance_type text, provider_id uuid ); -- -- Name: reporting_azurecostentryproductservice_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_azurecostentryproductservice_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_azurecostentryproductservice_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_azurecostentryproductservice_id_seq OWNED BY reporting_azurecostentryproductservice.id; -- -- Name: reporting_azureenabledtagkeys; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azureenabledtagkeys ( id bigint NOT NULL, key character varying(253) NOT NULL ); -- -- Name: reporting_azureenabledtagkeys_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_azureenabledtagkeys_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_azureenabledtagkeys_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_azureenabledtagkeys_id_seq OWNED BY reporting_azureenabledtagkeys.id; -- -- Name: reporting_azuremeter; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azuremeter ( id integer NOT NULL, meter_id uuid NOT NULL, meter_name text NOT NULL, meter_category text, meter_subcategory text, meter_region text, resource_rate numeric(24,9), currency text, unit_of_measure text, provider_id uuid ); -- -- Name: reporting_azuremeter_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_azuremeter_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_azuremeter_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_azuremeter_id_seq OWNED BY reporting_azuremeter.id; -- -- Name: reporting_azuretags_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azuretags_summary ( uuid uuid NOT NULL, key text NOT NULL, "values" text[] NOT NULL, subscription_guid text, cost_entry_bill_id integer NOT NULL ); -- -- Name: reporting_azuretags_values; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_azuretags_values ( uuid uuid NOT NULL, key text NOT NULL, value text NOT NULL, subscription_guids text[] NOT NULL ); -- -- Name: reporting_gcpcostentrylineitem_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpcostentrylineitem_daily_summary ( uuid uuid DEFAULT public.uuid_generate_v4() NOT NULL, account_id character varying(20) NOT NULL, project_id character varying(256) NOT NULL, project_name character varying(256) NOT NULL, service_id character varying(256), service_alias character varying(256), sku_id character varying(256), sku_alias character varying(256), usage_start date NOT NULL, usage_end date, region character varying(50), instance_type character varying(50), unit character varying(63), line_item_type character varying(256), usage_amount numeric(24,9), currency character varying(10) NOT NULL, unblended_cost numeric(24,9), markup_cost numeric(24,9), tags jsonb, source_uuid uuid, cost_entry_bill_id integer NOT NULL ) PARTITION BY RANGE (usage_start); -- -- Name: reporting_gcp_compute_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_compute_summary AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.source_uuid) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.instance_type, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_gcpcostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_gcp_compute_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_compute_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.instance_type, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.account_id, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_gcpcostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.account_id WITH NO DATA; -- -- Name: reporting_gcp_compute_summary_by_project; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_compute_summary_by_project AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.instance_type, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_gcpcostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id WITH NO DATA; -- -- Name: reporting_gcp_compute_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_compute_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.instance_type, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_gcpcostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region WITH NO DATA; -- -- Name: reporting_gcp_compute_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_compute_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.instance_type, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (reporting_gcpcostentrylineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.instance_type, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias WITH NO DATA; -- -- Name: reporting_gcp_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.source_uuid) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_gcp_cost_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_cost_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.account_id, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id WITH NO DATA; -- -- Name: reporting_gcp_cost_summary_by_project; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_cost_summary_by_project AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id FROM reporting_gcpcostentrylineitem_daily_summary WHERE (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id WITH NO DATA; -- -- Name: reporting_gcp_cost_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_cost_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region WITH NO DATA; -- -- Name: reporting_gcp_cost_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_cost_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias WITH NO DATA; -- -- Name: reporting_gcp_database_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_database_summary AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.account_id, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias FROM reporting_gcpcostentrylineitem_daily_summary WHERE (((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%SQL%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Spanner%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Bigtable%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Firestore%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Firebase%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Memorystore%'::text) OR (((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%MongoDB%'::text) AND (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias WITH NO DATA; -- -- Name: reporting_gcp_network_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_network_summary AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, reporting_gcpcostentrylineitem_daily_summary.account_id, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias FROM reporting_gcpcostentrylineitem_daily_summary WHERE (((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Network%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%VPC%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Firewall%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Route%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%IP%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%DNS%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%CDN%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%NAT%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Traffic Director%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Service Discovery%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Cloud Domains%'::text) OR ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Private Service Connect%'::text) OR (((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text ~~ '%Cloud Armor%'::text) AND (reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias WITH NO DATA; -- -- Name: reporting_gcp_storage_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_storage_summary AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.source_uuid) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text = ANY ((ARRAY['Filestore'::character varying, 'Storage'::character varying, 'Cloud Storage'::character varying, 'Data Transfer'::character varying])::text[]))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_gcp_storage_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_storage_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.account_id, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text = ANY ((ARRAY['Filestore'::character varying, 'Storage'::character varying, 'Cloud Storage'::character varying, 'Data Transfer'::character varying])::text[]))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id WITH NO DATA; -- -- Name: reporting_gcp_storage_summary_by_project; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_storage_summary_by_project AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text = ANY ((ARRAY['Filestore'::character varying, 'Storage'::character varying, 'Cloud Storage'::character varying, 'Data Transfer'::character varying])::text[]))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.project_id, reporting_gcpcostentrylineitem_daily_summary.project_name, reporting_gcpcostentrylineitem_daily_summary.account_id WITH NO DATA; -- -- Name: reporting_gcp_storage_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_storage_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text = ANY ((ARRAY['Filestore'::character varying, 'Storage'::character varying, 'Cloud Storage'::character varying, 'Data Transfer'::character varying])::text[]))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.region WITH NO DATA; -- -- Name: reporting_gcp_storage_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_gcp_storage_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias) AS id, reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.usage_start AS usage_end, sum(reporting_gcpcostentrylineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_gcpcostentrylineitem_daily_summary.unit)::text) AS unit, sum(reporting_gcpcostentrylineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_gcpcostentrylineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_gcpcostentrylineitem_daily_summary.currency)::text) AS currency, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias, (max((reporting_gcpcostentrylineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_gcpcostentrylineitem_daily_summary WHERE ((reporting_gcpcostentrylineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_gcpcostentrylineitem_daily_summary.service_alias)::text = ANY ((ARRAY['Filestore'::character varying, 'Storage'::character varying, 'Cloud Storage'::character varying, 'Data Transfer'::character varying])::text[]))) GROUP BY reporting_gcpcostentrylineitem_daily_summary.usage_start, reporting_gcpcostentrylineitem_daily_summary.account_id, reporting_gcpcostentrylineitem_daily_summary.service_id, reporting_gcpcostentrylineitem_daily_summary.service_alias WITH NO DATA; -- -- Name: reporting_gcpcostentrybill; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpcostentrybill ( id integer NOT NULL, billing_period_start timestamp with time zone NOT NULL, billing_period_end timestamp with time zone NOT NULL, summary_data_creation_datetime timestamp with time zone, summary_data_updated_datetime timestamp with time zone, finalized_datetime timestamp with time zone, derived_cost_datetime timestamp with time zone, provider_id uuid NOT NULL ); -- -- Name: reporting_gcpcostentrybill_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_gcpcostentrybill_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_gcpcostentrybill_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_gcpcostentrybill_id_seq OWNED BY reporting_gcpcostentrybill.id; -- -- Name: reporting_gcpcostentrylineitem; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpcostentrylineitem ( id bigint NOT NULL, usage_start timestamp with time zone NOT NULL, usage_end timestamp with time zone NOT NULL, tags jsonb, usage_type character varying(50), location character varying(256), country character varying(256), region character varying(256), zone character varying(256), export_time character varying(256), cost numeric(24,9), currency character varying(256), conversion_rate character varying(256), usage_to_pricing_units numeric(24,9), usage_pricing_unit character varying(256), credits character varying(256), invoice_month character varying(256), cost_type character varying(256), line_item_type character varying(256), cost_entry_bill_id integer NOT NULL, cost_entry_product_id bigint, project_id integer NOT NULL ); -- -- Name: reporting_gcpcostentrylineitem_daily; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpcostentrylineitem_daily ( id bigint NOT NULL, line_item_type character varying(256), usage_start date NOT NULL, usage_end date, tags jsonb, usage_type character varying(50), region character varying(256), cost numeric(24,9), currency character varying(256), conversion_rate character varying(256), usage_in_pricing_units numeric(24,9), usage_pricing_unit character varying(256), invoice_month character varying(256), tax_type character varying(256), cost_entry_bill_id integer NOT NULL, cost_entry_product_id bigint, project_id integer NOT NULL ); -- -- Name: reporting_gcpcostentrylineitem_daily_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_gcpcostentrylineitem_daily_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_gcpcostentrylineitem_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_gcpcostentrylineitem_daily_id_seq OWNED BY reporting_gcpcostentrylineitem_daily.id; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_default; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpcostentrylineitem_daily_summary_default ( uuid uuid DEFAULT public.uuid_generate_v4() NOT NULL, account_id character varying(20) NOT NULL, project_id character varying(256) NOT NULL, project_name character varying(256) NOT NULL, service_id character varying(256), service_alias character varying(256), sku_id character varying(256), sku_alias character varying(256), usage_start date NOT NULL, usage_end date, region character varying(50), instance_type character varying(50), unit character varying(63), line_item_type character varying(256), usage_amount numeric(24,9), currency character varying(10) NOT NULL, unblended_cost numeric(24,9), markup_cost numeric(24,9), tags jsonb, source_uuid uuid, cost_entry_bill_id integer NOT NULL ); ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily_summary ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_default DEFAULT; -- -- Name: reporting_gcpcostentrylineitem_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_gcpcostentrylineitem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_gcpcostentrylineitem_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_gcpcostentrylineitem_id_seq OWNED BY reporting_gcpcostentrylineitem.id; -- -- Name: reporting_gcpcostentryproductservice; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpcostentryproductservice ( id bigint NOT NULL, service_id character varying(256), service_alias character varying(256), sku_id character varying(256), sku_alias character varying(256) ); -- -- Name: reporting_gcpcostentryproductservice_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_gcpcostentryproductservice_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_gcpcostentryproductservice_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_gcpcostentryproductservice_id_seq OWNED BY reporting_gcpcostentryproductservice.id; -- -- Name: reporting_gcpenabledtagkeys; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpenabledtagkeys ( id bigint NOT NULL, key character varying(253) NOT NULL ); -- -- Name: reporting_gcpenabledtagkeys_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_gcpenabledtagkeys_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_gcpenabledtagkeys_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_gcpenabledtagkeys_id_seq OWNED BY reporting_gcpenabledtagkeys.id; -- -- Name: reporting_gcpproject; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcpproject ( id integer NOT NULL, account_id character varying(20) NOT NULL, project_id character varying(256) NOT NULL, project_name character varying(256) NOT NULL, project_labels character varying(256) ); -- -- Name: reporting_gcpproject_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_gcpproject_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_gcpproject_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_gcpproject_id_seq OWNED BY reporting_gcpproject.id; -- -- Name: reporting_gcptags_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcptags_summary ( uuid uuid NOT NULL, key text NOT NULL, "values" text[] NOT NULL, account_id text, cost_entry_bill_id integer NOT NULL, project_id text, project_name text ); -- -- Name: reporting_gcptags_values; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_gcptags_values ( uuid uuid NOT NULL, key text NOT NULL, value text NOT NULL, account_ids text[] NOT NULL, project_ids text[], project_names text[] ); -- -- Name: reporting_ocpusagelineitem_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagelineitem_daily_summary ( cluster_id character varying(50), cluster_alias character varying(256), data_source character varying(64), namespace character varying(253), node character varying(253), resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, pod_labels jsonb, pod_usage_cpu_core_hours numeric(18,6), pod_request_cpu_core_hours numeric(18,6), pod_limit_cpu_core_hours numeric(18,6), pod_usage_memory_gigabyte_hours numeric(18,6), pod_request_memory_gigabyte_hours numeric(18,6), pod_limit_memory_gigabyte_hours numeric(18,6), node_capacity_cpu_cores numeric(18,6), node_capacity_cpu_core_hours numeric(18,6), node_capacity_memory_gigabytes numeric(18,6), node_capacity_memory_gigabyte_hours numeric(18,6), cluster_capacity_cpu_core_hours numeric(18,6), cluster_capacity_memory_gigabyte_hours numeric(18,6), persistentvolumeclaim character varying(253), persistentvolume character varying(253), storageclass character varying(50), volume_labels jsonb, persistentvolumeclaim_capacity_gigabyte numeric(18,6), persistentvolumeclaim_capacity_gigabyte_months numeric(18,6), volume_request_storage_gigabyte_months numeric(18,6), persistentvolumeclaim_usage_gigabyte_months numeric(18,6), infrastructure_raw_cost numeric(33,15), infrastructure_project_raw_cost numeric(33,15), infrastructure_usage_cost jsonb, infrastructure_markup_cost numeric(33,15), infrastructure_project_markup_cost numeric(33,15), infrastructure_monthly_cost numeric(33,15), supplementary_usage_cost jsonb, supplementary_monthly_cost numeric(33,15), monthly_cost_type text, source_uuid uuid, report_period_id integer, uuid uuid NOT NULL ) PARTITION BY RANGE (usage_start); -- -- Name: reporting_ocp_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_raw_cost) AS infrastructure_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_markup_cost) AS infrastructure_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.supplementary_monthly_cost) AS supplementary_monthly_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_monthly_cost) AS infrastructure_monthly_cost, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE (reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocp_cost_summary_by_node; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_cost_summary_by_node AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.node) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.node, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_raw_cost) AS infrastructure_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_markup_cost) AS infrastructure_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.supplementary_monthly_cost) AS supplementary_monthly_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_monthly_cost) AS infrastructure_monthly_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_project_markup_cost) AS infrastructure_project_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_project_raw_cost) AS infrastructure_project_raw_cost, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE (reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.node, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocp_cost_summary_by_project; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_cost_summary_by_project AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_project_raw_cost) AS infrastructure_project_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_project_markup_cost) AS infrastructure_project_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.supplementary_monthly_cost) AS supplementary_monthly_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_monthly_cost) AS infrastructure_monthly_cost, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE (reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocp_pod_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_pod_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, max((reporting_ocpusagelineitem_daily_summary.data_source)::text) AS data_source, array_agg(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_ids, count(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_count, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_raw_cost) AS infrastructure_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_markup_cost) AS infrastructure_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.pod_usage_cpu_core_hours) AS pod_usage_cpu_core_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_request_cpu_core_hours) AS pod_request_cpu_core_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_limit_cpu_core_hours) AS pod_limit_cpu_core_hours, max(reporting_ocpusagelineitem_daily_summary.cluster_capacity_cpu_core_hours) AS cluster_capacity_cpu_core_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_usage_memory_gigabyte_hours) AS pod_usage_memory_gigabyte_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_request_memory_gigabyte_hours) AS pod_request_memory_gigabyte_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_limit_memory_gigabyte_hours) AS pod_limit_memory_gigabyte_hours, max(reporting_ocpusagelineitem_daily_summary.cluster_capacity_memory_gigabyte_hours) AS cluster_capacity_memory_gigabyte_hours, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE ((reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_ocpusagelineitem_daily_summary.data_source)::text = 'Pod'::text)) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocp_pod_summary_by_project; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_pod_summary_by_project AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace, max((reporting_ocpusagelineitem_daily_summary.data_source)::text) AS data_source, array_agg(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_ids, count(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_count, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_raw_cost) AS infrastructure_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_markup_cost) AS infrastructure_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.pod_usage_cpu_core_hours) AS pod_usage_cpu_core_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_request_cpu_core_hours) AS pod_request_cpu_core_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_limit_cpu_core_hours) AS pod_limit_cpu_core_hours, max(reporting_ocpusagelineitem_daily_summary.cluster_capacity_cpu_core_hours) AS cluster_capacity_cpu_core_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_usage_memory_gigabyte_hours) AS pod_usage_memory_gigabyte_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_request_memory_gigabyte_hours) AS pod_request_memory_gigabyte_hours, sum(reporting_ocpusagelineitem_daily_summary.pod_limit_memory_gigabyte_hours) AS pod_limit_memory_gigabyte_hours, max(reporting_ocpusagelineitem_daily_summary.cluster_capacity_memory_gigabyte_hours) AS cluster_capacity_memory_gigabyte_hours, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE ((reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_ocpusagelineitem_daily_summary.data_source)::text = 'Pod'::text)) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocp_volume_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_volume_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, max((reporting_ocpusagelineitem_daily_summary.data_source)::text) AS data_source, array_agg(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_ids, count(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_count, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_raw_cost) AS infrastructure_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_markup_cost) AS infrastructure_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.persistentvolumeclaim_usage_gigabyte_months) AS persistentvolumeclaim_usage_gigabyte_months, sum(reporting_ocpusagelineitem_daily_summary.volume_request_storage_gigabyte_months) AS volume_request_storage_gigabyte_months, sum(reporting_ocpusagelineitem_daily_summary.persistentvolumeclaim_capacity_gigabyte_months) AS persistentvolumeclaim_capacity_gigabyte_months, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE ((reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_ocpusagelineitem_daily_summary.data_source)::text = 'Storage'::text)) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocp_volume_summary_by_project; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocp_volume_summary_by_project AS SELECT row_number() OVER (ORDER BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace) AS id, reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.usage_start AS usage_end, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace, max((reporting_ocpusagelineitem_daily_summary.data_source)::text) AS data_source, array_agg(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_ids, count(DISTINCT reporting_ocpusagelineitem_daily_summary.resource_id) AS resource_count, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.supplementary_usage_cost ->> 'storage'::text))::numeric)) AS supplementary_usage_cost, json_build_object('cpu', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'cpu'::text))::numeric), 'memory', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'memory'::text))::numeric), 'storage', sum(((reporting_ocpusagelineitem_daily_summary.infrastructure_usage_cost ->> 'storage'::text))::numeric)) AS infrastructure_usage_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_raw_cost) AS infrastructure_raw_cost, sum(reporting_ocpusagelineitem_daily_summary.infrastructure_markup_cost) AS infrastructure_markup_cost, sum(reporting_ocpusagelineitem_daily_summary.persistentvolumeclaim_usage_gigabyte_months) AS persistentvolumeclaim_usage_gigabyte_months, sum(reporting_ocpusagelineitem_daily_summary.volume_request_storage_gigabyte_months) AS volume_request_storage_gigabyte_months, sum(reporting_ocpusagelineitem_daily_summary.persistentvolumeclaim_capacity_gigabyte_months) AS persistentvolumeclaim_capacity_gigabyte_months, reporting_ocpusagelineitem_daily_summary.source_uuid FROM reporting_ocpusagelineitem_daily_summary WHERE ((reporting_ocpusagelineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((reporting_ocpusagelineitem_daily_summary.data_source)::text = 'Storage'::text)) GROUP BY reporting_ocpusagelineitem_daily_summary.usage_start, reporting_ocpusagelineitem_daily_summary.cluster_id, reporting_ocpusagelineitem_daily_summary.cluster_alias, reporting_ocpusagelineitem_daily_summary.namespace, reporting_ocpusagelineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocpawscostlineitem_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpawscostlineitem_daily_summary ( cluster_id character varying(50), cluster_alias character varying(256), namespace character varying(253)[] NOT NULL, node character varying(253), resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, product_code character varying(50) NOT NULL, product_family character varying(150), instance_type character varying(50), usage_account_id character varying(50) NOT NULL, availability_zone character varying(50), region character varying(50), unit character varying(63), tags jsonb, usage_amount numeric(24,9), normalized_usage_amount double precision, currency_code character varying(10), unblended_cost numeric(30,15), markup_cost numeric(30,15), shared_projects integer NOT NULL, project_costs jsonb, source_uuid uuid, account_alias_id integer, cost_entry_bill_id integer, report_period_id integer, uuid uuid NOT NULL ); -- -- Name: reporting_ocpazurecostlineitem_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpazurecostlineitem_daily_summary ( cluster_id character varying(50), cluster_alias character varying(256), namespace character varying(253)[] NOT NULL, node character varying(253), resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, subscription_guid text NOT NULL, instance_type text, service_name text, resource_location text, tags jsonb, usage_quantity numeric(24,9), pretax_cost numeric(17,9), markup_cost numeric(17,9), currency text, unit_of_measure text, shared_projects integer NOT NULL, project_costs jsonb, source_uuid uuid, cost_entry_bill_id integer NOT NULL, report_period_id integer, uuid uuid NOT NULL ); -- -- Name: reporting_ocpallcostlineitem_daily_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpallcostlineitem_daily_summary AS ( SELECT row_number() OVER () AS id, lids.source_type, lids.cluster_id, max(lids.cluster_alias) as cluster_alias, lids.namespace, lids.node, lids.resource_id, lids.usage_start, lids.usage_start as usage_end, lids.usage_account_id, max(lids.account_alias_id) as account_alias_id, lids.product_code, lids.product_family, lids.instance_type, lids.region, lids.availability_zone, lids.tags, sum(lids.usage_amount) as usage_amount, max(lids.unit) as unit, sum(lids.unblended_cost) as unblended_cost, sum(lids.markup_cost) as markup_cost, max(lids.currency_code) as currency_code, max(lids.shared_projects) as shared_projects, lids.project_costs as project_costs, max(lids.source_uuid::text)::uuid as source_uuid FROM ( SELECT 'AWS'::text AS source_type, aws.cluster_id, aws.cluster_alias, aws.namespace, aws.node, aws.resource_id, aws.usage_start, aws.usage_end, aws.usage_account_id, aws.account_alias_id, aws.product_code, aws.product_family, aws.instance_type, aws.region, aws.availability_zone, aws.tags, aws.usage_amount, aws.unit, aws.unblended_cost, aws.markup_cost, aws.currency_code, aws.shared_projects, aws.project_costs, aws.source_uuid FROM reporting_ocpawscostlineitem_daily_summary AS aws WHERE aws.usage_start >= date_trunc('month'::text, (now() - '2 month'::interval))::date UNION SELECT 'Azure'::text AS source_type, azure.cluster_id, azure.cluster_alias, azure.namespace, azure.node, azure.resource_id, azure.usage_start, azure.usage_end, azure.subscription_guid AS usage_account_id, NULL::integer AS account_alias_id, azure.service_name AS product_code, NULL::character varying AS product_family, azure.instance_type, azure.resource_location AS region, NULL::character varying AS availability_zone, azure.tags, azure.usage_quantity AS usage_amount, azure.unit_of_measure AS unit, azure.pretax_cost AS unblended_cost, azure.markup_cost, azure.currency AS currency_code, azure.shared_projects, azure.project_costs, azure.source_uuid FROM reporting_ocpazurecostlineitem_daily_summary AS azure WHERE azure.usage_start >= date_trunc('month'::text, (now() - '2 month'::interval))::date ) AS lids GROUP BY lids.source_type, lids.cluster_id, lids.cluster_alias, lids.namespace, lids.node, lids.resource_id, lids.usage_start, lids.usage_account_id, lids.account_alias_id, lids.product_code, lids.product_family, lids.instance_type, lids.region, lids.availability_zone, lids.tags, lids.project_costs ) WITH NO DATA ; -- -- Name: reporting_ocpall_compute_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_compute_summary AS SELECT row_number() OVER (ORDER BY lids.usage_start, lids.cluster_id, lids.usage_account_id, lids.product_code) AS id, lids.usage_start, lids.usage_start AS usage_end, lids.cluster_id, max(lids.cluster_alias) AS cluster_alias, lids.usage_account_id, max(lids.account_alias_id) AS account_alias_id, lids.product_code, lids.instance_type, lids.resource_id, sum(lids.usage_amount) AS usage_amount, max(lids.unit) AS unit, sum(lids.unblended_cost) AS unblended_cost, sum(lids.markup_cost) AS markup_cost, max(lids.currency_code) AS currency_code, (max((lids.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary lids WHERE ((lids.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (lids.instance_type IS NOT NULL)) GROUP BY lids.usage_start, lids.cluster_id, lids.usage_account_id, lids.product_code, lids.instance_type, lids.resource_id WITH NO DATA; -- -- Name: reporting_ocpall_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.source_uuid) AS id, reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpallcostlineitem_daily_summary.cluster_id, max(reporting_ocpallcostlineitem_daily_summary.cluster_alias) AS cluster_alias, sum(reporting_ocpallcostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpallcostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpallcostlineitem_daily_summary.currency_code) AS currency_code, reporting_ocpallcostlineitem_daily_summary.source_uuid FROM reporting_ocpallcostlineitem_daily_summary WHERE (reporting_ocpallcostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.cluster_alias, reporting_ocpallcostlineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocpall_cost_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_cost_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id) AS id, reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpallcostlineitem_daily_summary.cluster_id, max(reporting_ocpallcostlineitem_daily_summary.cluster_alias) AS cluster_alias, reporting_ocpallcostlineitem_daily_summary.usage_account_id, max(reporting_ocpallcostlineitem_daily_summary.account_alias_id) AS account_alias_id, sum(reporting_ocpallcostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpallcostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpallcostlineitem_daily_summary.currency_code) AS currency_code, (max((reporting_ocpallcostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary WHERE (reporting_ocpallcostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id WITH NO DATA; -- -- Name: reporting_ocpall_cost_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_cost_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id, reporting_ocpallcostlineitem_daily_summary.region, reporting_ocpallcostlineitem_daily_summary.availability_zone) AS id, reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpallcostlineitem_daily_summary.cluster_id, max(reporting_ocpallcostlineitem_daily_summary.cluster_alias) AS cluster_alias, reporting_ocpallcostlineitem_daily_summary.usage_account_id, max(reporting_ocpallcostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpallcostlineitem_daily_summary.region, reporting_ocpallcostlineitem_daily_summary.availability_zone, sum(reporting_ocpallcostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpallcostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpallcostlineitem_daily_summary.currency_code) AS currency_code, (max((reporting_ocpallcostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary WHERE (reporting_ocpallcostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id, reporting_ocpallcostlineitem_daily_summary.region, reporting_ocpallcostlineitem_daily_summary.availability_zone WITH NO DATA; -- -- Name: reporting_ocpall_cost_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_cost_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id, reporting_ocpallcostlineitem_daily_summary.product_code, reporting_ocpallcostlineitem_daily_summary.product_family) AS id, reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpallcostlineitem_daily_summary.cluster_id, max(reporting_ocpallcostlineitem_daily_summary.cluster_alias) AS cluster_alias, reporting_ocpallcostlineitem_daily_summary.usage_account_id, max(reporting_ocpallcostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpallcostlineitem_daily_summary.product_code, reporting_ocpallcostlineitem_daily_summary.product_family, sum(reporting_ocpallcostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpallcostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpallcostlineitem_daily_summary.currency_code) AS currency_code, (max((reporting_ocpallcostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary WHERE (reporting_ocpallcostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id, reporting_ocpallcostlineitem_daily_summary.product_code, reporting_ocpallcostlineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_ocpall_database_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_database_summary AS SELECT row_number() OVER (ORDER BY lids.usage_start, lids.cluster_id, lids.usage_account_id, lids.product_code) AS id, lids.usage_start, lids.usage_start AS usage_end, lids.cluster_id, max(lids.cluster_alias) AS cluster_alias, lids.usage_account_id, max(lids.account_alias_id) AS account_alias_id, lids.product_code, sum(lids.usage_amount) AS usage_amount, max(lids.unit) AS unit, sum(lids.unblended_cost) AS unblended_cost, sum(lids.markup_cost) AS markup_cost, max(lids.currency_code) AS currency_code, (max((lids.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary lids WHERE ((lids.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (((lids.product_code)::text = ANY ((ARRAY['AmazonRDS'::character varying, 'AmazonDynamoDB'::character varying, 'AmazonElastiCache'::character varying, 'AmazonNeptune'::character varying, 'AmazonRedshift'::character varying, 'AmazonDocumentDB'::character varying, 'Cosmos DB'::character varying, 'Cache for Redis'::character varying])::text[])) OR ((lids.product_code)::text ~~ '%Database%'::text))) GROUP BY lids.usage_start, lids.cluster_id, lids.usage_account_id, lids.product_code WITH NO DATA; -- -- Name: reporting_ocpall_network_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_network_summary AS SELECT row_number() OVER (ORDER BY lids.usage_start, lids.cluster_id, lids.usage_account_id, lids.product_code) AS id, lids.cluster_id, max(lids.cluster_alias) AS cluster_alias, lids.usage_account_id, max(lids.account_alias_id) AS account_alias_id, lids.usage_start, lids.usage_start AS usage_end, lids.product_code, sum(lids.usage_amount) AS usage_amount, max(lids.unit) AS unit, sum(lids.unblended_cost) AS unblended_cost, sum(lids.markup_cost) AS markup_cost, max(lids.currency_code) AS currency_code, (max((lids.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary lids WHERE ((lids.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND ((lids.product_code)::text = ANY ((ARRAY['AmazonVPC'::character varying, 'AmazonCloudFront'::character varying, 'AmazonRoute53'::character varying, 'AmazonAPIGateway'::character varying, 'Virtual Network'::character varying, 'VPN'::character varying, 'DNS'::character varying, 'Traffic Manager'::character varying, 'ExpressRoute'::character varying, 'Load Balancer'::character varying, 'Application Gateway'::character varying])::text[]))) GROUP BY lids.usage_start, lids.cluster_id, lids.usage_account_id, lids.product_code WITH NO DATA; -- -- Name: reporting_ocpall_storage_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpall_storage_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id, reporting_ocpallcostlineitem_daily_summary.product_family, reporting_ocpallcostlineitem_daily_summary.product_code) AS id, reporting_ocpallcostlineitem_daily_summary.cluster_id, max(reporting_ocpallcostlineitem_daily_summary.cluster_alias) AS cluster_alias, reporting_ocpallcostlineitem_daily_summary.usage_account_id, max(reporting_ocpallcostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpallcostlineitem_daily_summary.product_family, reporting_ocpallcostlineitem_daily_summary.product_code, sum(reporting_ocpallcostlineitem_daily_summary.usage_amount) AS usage_amount, max(reporting_ocpallcostlineitem_daily_summary.unit) AS unit, sum(reporting_ocpallcostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpallcostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpallcostlineitem_daily_summary.currency_code) AS currency_code, (max((reporting_ocpallcostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpallcostlineitem_daily_summary WHERE ((reporting_ocpallcostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) AND (((reporting_ocpallcostlineitem_daily_summary.product_family)::text ~~ '%Storage%'::text) OR ((reporting_ocpallcostlineitem_daily_summary.product_code)::text ~~ '%Storage%'::text)) AND (reporting_ocpallcostlineitem_daily_summary.unit = 'GB-Mo'::text)) GROUP BY reporting_ocpallcostlineitem_daily_summary.usage_start, reporting_ocpallcostlineitem_daily_summary.cluster_id, reporting_ocpallcostlineitem_daily_summary.usage_account_id, reporting_ocpallcostlineitem_daily_summary.product_family, reporting_ocpallcostlineitem_daily_summary.product_code WITH NO DATA; -- -- Name: reporting_ocpawscostlineitem_project_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpawscostlineitem_project_daily_summary ( cluster_id character varying(50), cluster_alias character varying(256), data_source character varying(64), namespace character varying(253) NOT NULL, node character varying(253), pod_labels jsonb, resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, product_code character varying(50) NOT NULL, product_family character varying(150), instance_type character varying(50), usage_account_id character varying(50) NOT NULL, availability_zone character varying(50), region character varying(50), unit character varying(63), usage_amount numeric(30,15), normalized_usage_amount double precision, currency_code character varying(10), unblended_cost numeric(30,15), markup_cost numeric(30,15), project_markup_cost numeric(30,15), pod_cost numeric(30,15), source_uuid uuid, account_alias_id integer, cost_entry_bill_id integer, report_period_id integer, uuid uuid NOT NULL, persistentvolume character varying(253), persistentvolumeclaim character varying(253), storageclass character varying(50) ); -- -- Name: reporting_ocpazurecostlineitem_project_daily_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpazurecostlineitem_project_daily_summary ( cluster_id character varying(50), cluster_alias character varying(256), data_source character varying(64), namespace character varying(253) NOT NULL, node character varying(253), pod_labels jsonb, resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, subscription_guid text NOT NULL, instance_type text, service_name text, resource_location text, usage_quantity numeric(24,9), unit_of_measure text, currency text, pretax_cost numeric(17,9), markup_cost numeric(17,9), project_markup_cost numeric(17,9), pod_cost numeric(24,6), source_uuid uuid, cost_entry_bill_id integer NOT NULL, report_period_id integer, uuid uuid NOT NULL, persistentvolume character varying(253), persistentvolumeclaim character varying(253), storageclass character varying(50) ); -- -- Name: reporting_ocpallcostlineitem_project_daily_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpallcostlineitem_project_daily_summary AS SELECT row_number() OVER () AS id, lids.source_type, lids.cluster_id, lids.cluster_alias, lids.data_source, lids.namespace, lids.node, lids.pod_labels, lids.resource_id, lids.usage_start, lids.usage_end, lids.usage_account_id, lids.account_alias_id, lids.product_code, lids.product_family, lids.instance_type, lids.region, lids.availability_zone, lids.usage_amount, lids.unit, lids.unblended_cost, lids.project_markup_cost, lids.pod_cost, lids.currency_code, lids.source_uuid FROM ( SELECT 'AWS'::text AS source_type, reporting_ocpawscostlineitem_project_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_project_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_project_daily_summary.data_source, (reporting_ocpawscostlineitem_project_daily_summary.namespace)::text AS namespace, (reporting_ocpawscostlineitem_project_daily_summary.node)::text AS node, reporting_ocpawscostlineitem_project_daily_summary.pod_labels, reporting_ocpawscostlineitem_project_daily_summary.resource_id, reporting_ocpawscostlineitem_project_daily_summary.usage_start, reporting_ocpawscostlineitem_project_daily_summary.usage_end, reporting_ocpawscostlineitem_project_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_project_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_project_daily_summary.product_code, reporting_ocpawscostlineitem_project_daily_summary.product_family, reporting_ocpawscostlineitem_project_daily_summary.instance_type, reporting_ocpawscostlineitem_project_daily_summary.region, reporting_ocpawscostlineitem_project_daily_summary.availability_zone, sum(reporting_ocpawscostlineitem_project_daily_summary.usage_amount) AS usage_amount, max((reporting_ocpawscostlineitem_project_daily_summary.unit)::text) AS unit, sum(reporting_ocpawscostlineitem_project_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_project_daily_summary.project_markup_cost) AS project_markup_cost, sum(reporting_ocpawscostlineitem_project_daily_summary.pod_cost) AS pod_cost, max((reporting_ocpawscostlineitem_project_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_project_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_project_daily_summary WHERE (reporting_ocpawscostlineitem_project_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY 'AWS'::text, reporting_ocpawscostlineitem_project_daily_summary.usage_start, reporting_ocpawscostlineitem_project_daily_summary.usage_end, reporting_ocpawscostlineitem_project_daily_summary.cluster_id, reporting_ocpawscostlineitem_project_daily_summary.data_source, reporting_ocpawscostlineitem_project_daily_summary.namespace, reporting_ocpawscostlineitem_project_daily_summary.node, reporting_ocpawscostlineitem_project_daily_summary.usage_account_id, reporting_ocpawscostlineitem_project_daily_summary.resource_id, reporting_ocpawscostlineitem_project_daily_summary.product_code, reporting_ocpawscostlineitem_project_daily_summary.product_family, reporting_ocpawscostlineitem_project_daily_summary.instance_type, reporting_ocpawscostlineitem_project_daily_summary.region, reporting_ocpawscostlineitem_project_daily_summary.availability_zone, reporting_ocpawscostlineitem_project_daily_summary.pod_labels UNION SELECT 'Azure'::text AS source_type, reporting_ocpazurecostlineitem_project_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_project_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_project_daily_summary.data_source, (reporting_ocpazurecostlineitem_project_daily_summary.namespace)::text AS namespace, (reporting_ocpazurecostlineitem_project_daily_summary.node)::text AS node, reporting_ocpazurecostlineitem_project_daily_summary.pod_labels, reporting_ocpazurecostlineitem_project_daily_summary.resource_id, reporting_ocpazurecostlineitem_project_daily_summary.usage_start, reporting_ocpazurecostlineitem_project_daily_summary.usage_end, reporting_ocpazurecostlineitem_project_daily_summary.subscription_guid AS usage_account_id, NULL::integer AS account_alias_id, reporting_ocpazurecostlineitem_project_daily_summary.service_name AS product_code, NULL::text AS product_family, reporting_ocpazurecostlineitem_project_daily_summary.instance_type, reporting_ocpazurecostlineitem_project_daily_summary.resource_location AS region, NULL::text AS availability_zone, sum(reporting_ocpazurecostlineitem_project_daily_summary.usage_quantity) AS usage_amount, max(reporting_ocpazurecostlineitem_project_daily_summary.unit_of_measure) AS unit, sum(reporting_ocpazurecostlineitem_project_daily_summary.pretax_cost) AS unblended_cost, sum(reporting_ocpazurecostlineitem_project_daily_summary.project_markup_cost) AS project_markup_cost, sum(reporting_ocpazurecostlineitem_project_daily_summary.pod_cost) AS pod_cost, max(reporting_ocpazurecostlineitem_project_daily_summary.currency) AS currency_code, (max((reporting_ocpazurecostlineitem_project_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_project_daily_summary WHERE (reporting_ocpazurecostlineitem_project_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '2 mons'::interval)))::date) GROUP BY 'Azure'::text, reporting_ocpazurecostlineitem_project_daily_summary.usage_start, reporting_ocpazurecostlineitem_project_daily_summary.usage_end, reporting_ocpazurecostlineitem_project_daily_summary.cluster_id, reporting_ocpazurecostlineitem_project_daily_summary.data_source, reporting_ocpazurecostlineitem_project_daily_summary.namespace, reporting_ocpazurecostlineitem_project_daily_summary.node, reporting_ocpazurecostlineitem_project_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_project_daily_summary.resource_id, reporting_ocpazurecostlineitem_project_daily_summary.service_name, NULL::text, reporting_ocpazurecostlineitem_project_daily_summary.instance_type, reporting_ocpazurecostlineitem_project_daily_summary.resource_location, NULL::text, reporting_ocpazurecostlineitem_project_daily_summary.pod_labels) lids WITH NO DATA; -- -- Name: reporting_ocpaws_compute_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_compute_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.instance_type, reporting_ocpawscostlineitem_daily_summary.resource_id) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_daily_summary.instance_type, reporting_ocpawscostlineitem_daily_summary.resource_id, sum(reporting_ocpawscostlineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_ocpawscostlineitem_daily_summary.unit)::text) AS unit, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE ((reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) AND (reporting_ocpawscostlineitem_daily_summary.instance_type IS NOT NULL)) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.instance_type, reporting_ocpawscostlineitem_daily_summary.resource_id WITH NO DATA; -- -- Name: reporting_ocpaws_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id WITH NO DATA; -- -- Name: reporting_ocpaws_cost_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_cost_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id WITH NO DATA; -- -- Name: reporting_ocpaws_cost_summary_by_region; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_cost_summary_by_region AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.region, reporting_ocpawscostlineitem_daily_summary.availability_zone) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_daily_summary.region, reporting_ocpawscostlineitem_daily_summary.availability_zone, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.region, reporting_ocpawscostlineitem_daily_summary.availability_zone WITH NO DATA; -- -- Name: reporting_ocpaws_cost_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_cost_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_code, reporting_ocpawscostlineitem_daily_summary.product_family) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_daily_summary.product_code, reporting_ocpawscostlineitem_daily_summary.product_family, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_code, reporting_ocpawscostlineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_ocpaws_database_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_database_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_code) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_daily_summary.product_code, sum(reporting_ocpawscostlineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_ocpawscostlineitem_daily_summary.unit)::text) AS unit, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (((reporting_ocpawscostlineitem_daily_summary.product_code)::text = ANY ((ARRAY['AmazonRDS'::character varying, 'AmazonDynamoDB'::character varying, 'AmazonElastiCache'::character varying, 'AmazonNeptune'::character varying, 'AmazonRedshift'::character varying, 'AmazonDocumentDB'::character varying])::text[])) AND (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date)) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_code WITH NO DATA; -- -- Name: reporting_ocpaws_network_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_network_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_code) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_daily_summary.product_code, sum(reporting_ocpawscostlineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_ocpawscostlineitem_daily_summary.unit)::text) AS unit, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (((reporting_ocpawscostlineitem_daily_summary.product_code)::text = ANY ((ARRAY['AmazonVPC'::character varying, 'AmazonCloudFront'::character varying, 'AmazonRoute53'::character varying, 'AmazonAPIGateway'::character varying])::text[])) AND (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date)) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_code WITH NO DATA; -- -- Name: reporting_ocpaws_storage_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpaws_storage_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_family) AS id, reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpawscostlineitem_daily_summary.cluster_id, max((reporting_ocpawscostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpawscostlineitem_daily_summary.usage_account_id, max(reporting_ocpawscostlineitem_daily_summary.account_alias_id) AS account_alias_id, reporting_ocpawscostlineitem_daily_summary.product_family, sum(reporting_ocpawscostlineitem_daily_summary.usage_amount) AS usage_amount, max((reporting_ocpawscostlineitem_daily_summary.unit)::text) AS unit, sum(reporting_ocpawscostlineitem_daily_summary.unblended_cost) AS unblended_cost, sum(reporting_ocpawscostlineitem_daily_summary.markup_cost) AS markup_cost, max((reporting_ocpawscostlineitem_daily_summary.currency_code)::text) AS currency_code, (max((reporting_ocpawscostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpawscostlineitem_daily_summary WHERE (((reporting_ocpawscostlineitem_daily_summary.product_family)::text ~~ '%Storage%'::text) AND ((reporting_ocpawscostlineitem_daily_summary.unit)::text = 'GB-Mo'::text) AND (reporting_ocpawscostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date)) GROUP BY reporting_ocpawscostlineitem_daily_summary.usage_start, reporting_ocpawscostlineitem_daily_summary.cluster_id, reporting_ocpawscostlineitem_daily_summary.usage_account_id, reporting_ocpawscostlineitem_daily_summary.product_family WITH NO DATA; -- -- Name: reporting_ocpawstags_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpawstags_summary ( uuid uuid NOT NULL, key character varying(253) NOT NULL, "values" text[] NOT NULL, usage_account_id character varying(50), namespace text NOT NULL, node text, account_alias_id integer, cost_entry_bill_id integer NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpawstags_values; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpawstags_values ( uuid uuid NOT NULL, key text NOT NULL, value text NOT NULL, usage_account_ids text[] NOT NULL, account_aliases text[] NOT NULL, cluster_ids text[] NOT NULL, cluster_aliases text[] NOT NULL, namespaces text[] NOT NULL, nodes text[] ); -- -- Name: reporting_ocpazure_compute_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_compute_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.instance_type, reporting_ocpazurecostlineitem_daily_summary.resource_id) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.instance_type, reporting_ocpazurecostlineitem_daily_summary.resource_id, sum(reporting_ocpazurecostlineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_ocpazurecostlineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE ((reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) AND (reporting_ocpazurecostlineitem_daily_summary.instance_type IS NOT NULL) AND (reporting_ocpazurecostlineitem_daily_summary.unit_of_measure = 'Hrs'::text)) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.instance_type, reporting_ocpazurecostlineitem_daily_summary.resource_id WITH NO DATA; -- -- Name: reporting_ocpazure_cost_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_cost_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.source_uuid) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, reporting_ocpazurecostlineitem_daily_summary.source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.source_uuid WITH NO DATA; -- -- Name: reporting_ocpazure_cost_summary_by_account; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_cost_summary_by_account AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid WITH NO DATA; -- -- Name: reporting_ocpazure_cost_summary_by_location; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_cost_summary_by_location AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.resource_location) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.resource_location, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.resource_location WITH NO DATA; -- -- Name: reporting_ocpazure_cost_summary_by_service; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_cost_summary_by_service AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_ocpazure_database_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_database_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name, sum(reporting_ocpazurecostlineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_ocpazurecostlineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE ((reporting_ocpazurecostlineitem_daily_summary.service_name = ANY (ARRAY['Cosmos DB'::text, 'Cache for Redis'::text])) OR ((reporting_ocpazurecostlineitem_daily_summary.service_name ~~* '%database%'::text) AND (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date))) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_ocpazure_network_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_network_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name, sum(reporting_ocpazurecostlineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_ocpazurecostlineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE ((reporting_ocpazurecostlineitem_daily_summary.service_name = ANY (ARRAY['Virtual Network'::text, 'VPN'::text, 'DNS'::text, 'Traffic Manager'::text, 'ExpressRoute'::text, 'Load Balancer'::text, 'Application Gateway'::text])) AND (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date)) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_ocpazure_storage_summary; Type: MATERIALIZED VIEW; Schema: ; Owner: - -- CREATE MATERIALIZED VIEW reporting_ocpazure_storage_summary AS SELECT row_number() OVER (ORDER BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name) AS id, reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.usage_start AS usage_end, reporting_ocpazurecostlineitem_daily_summary.cluster_id, max((reporting_ocpazurecostlineitem_daily_summary.cluster_alias)::text) AS cluster_alias, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name, sum(reporting_ocpazurecostlineitem_daily_summary.usage_quantity) AS usage_quantity, max(reporting_ocpazurecostlineitem_daily_summary.unit_of_measure) AS unit_of_measure, sum(reporting_ocpazurecostlineitem_daily_summary.pretax_cost) AS pretax_cost, sum(reporting_ocpazurecostlineitem_daily_summary.markup_cost) AS markup_cost, max(reporting_ocpazurecostlineitem_daily_summary.currency) AS currency, (max((reporting_ocpazurecostlineitem_daily_summary.source_uuid)::text))::uuid AS source_uuid FROM reporting_ocpazurecostlineitem_daily_summary WHERE ((reporting_ocpazurecostlineitem_daily_summary.service_name ~~ '%Storage%'::text) AND (reporting_ocpazurecostlineitem_daily_summary.unit_of_measure = 'GB-Mo'::text) AND (reporting_ocpazurecostlineitem_daily_summary.usage_start >= (date_trunc('month'::text, (now() - '1 mon'::interval)))::date)) GROUP BY reporting_ocpazurecostlineitem_daily_summary.usage_start, reporting_ocpazurecostlineitem_daily_summary.cluster_id, reporting_ocpazurecostlineitem_daily_summary.subscription_guid, reporting_ocpazurecostlineitem_daily_summary.service_name WITH NO DATA; -- -- Name: reporting_ocpazuretags_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpazuretags_summary ( uuid uuid NOT NULL, key character varying(253) NOT NULL, "values" text[] NOT NULL, subscription_guid text, namespace text NOT NULL, node text, cost_entry_bill_id integer NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpazuretags_values; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpazuretags_values ( uuid uuid NOT NULL, key text NOT NULL, value text NOT NULL, subscription_guids text[] NOT NULL, cluster_ids text[] NOT NULL, cluster_aliases text[] NOT NULL, namespaces text[] NOT NULL, nodes text[] ); -- -- Name: reporting_ocpcosts_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpcosts_summary ( id integer NOT NULL, cluster_id character varying(50), cluster_alias character varying(256), namespace character varying(253), pod character varying(253), node character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, pod_charge_cpu_core_hours numeric(27,9), pod_charge_memory_gigabyte_hours numeric(27,9), persistentvolumeclaim_charge_gb_month numeric(27,9), infra_cost numeric(33,15), project_infra_cost numeric(33,15), markup_cost numeric(27,9), project_markup_cost numeric(27,9), pod_labels jsonb, monthly_cost numeric(33,15), report_period_id integer ); -- -- Name: reporting_ocpcosts_summary_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpcosts_summary_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpcosts_summary_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpcosts_summary_id_seq OWNED BY reporting_ocpcosts_summary.id; -- -- Name: reporting_ocpenabledtagkeys; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpenabledtagkeys ( id bigint NOT NULL, key character varying(253) NOT NULL ); -- -- Name: reporting_ocpenabledtagkeys_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpenabledtagkeys_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpenabledtagkeys_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpenabledtagkeys_id_seq OWNED BY reporting_ocpenabledtagkeys.id; -- -- Name: reporting_ocpnamespacelabellineitem; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpnamespacelabellineitem ( id bigint NOT NULL, namespace character varying(253), namespace_labels jsonb, report_id integer NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpnamespacelabellineitem_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpnamespacelabellineitem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpnamespacelabellineitem_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpnamespacelabellineitem_id_seq OWNED BY reporting_ocpnamespacelabellineitem.id; -- -- Name: reporting_ocpnodelabellineitem; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpnodelabellineitem ( id bigint NOT NULL, node character varying(253), node_labels jsonb, report_id integer NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpnodelabellineitem_daily; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpnodelabellineitem_daily ( id bigint NOT NULL, cluster_id character varying(50), cluster_alias character varying(256), node character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, node_labels jsonb, total_seconds integer NOT NULL, report_period_id integer ); -- -- Name: reporting_ocpnodelabellineitem_daily_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpnodelabellineitem_daily_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpnodelabellineitem_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpnodelabellineitem_daily_id_seq OWNED BY reporting_ocpnodelabellineitem_daily.id; -- -- Name: reporting_ocpnodelabellineitem_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpnodelabellineitem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpnodelabellineitem_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpnodelabellineitem_id_seq OWNED BY reporting_ocpnodelabellineitem.id; -- -- Name: reporting_ocpstoragelineitem; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpstoragelineitem ( id bigint NOT NULL, namespace character varying(253) NOT NULL, pod character varying(253), persistentvolumeclaim character varying(253) NOT NULL, persistentvolume character varying(253) NOT NULL, storageclass character varying(50), persistentvolumeclaim_capacity_bytes numeric(73,9), persistentvolumeclaim_capacity_byte_seconds numeric(73,9), volume_request_storage_byte_seconds numeric(73,9), persistentvolumeclaim_usage_byte_seconds numeric(73,9), persistentvolume_labels jsonb, persistentvolumeclaim_labels jsonb, report_id integer NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpstoragelineitem_daily; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpstoragelineitem_daily ( id bigint NOT NULL, cluster_id character varying(50), cluster_alias character varying(256), namespace character varying(253) NOT NULL, pod character varying(253), node character varying(253), persistentvolumeclaim character varying(253) NOT NULL, persistentvolume character varying(253) NOT NULL, storageclass character varying(50), usage_start date NOT NULL, usage_end date NOT NULL, persistentvolumeclaim_capacity_bytes numeric(73,9), persistentvolumeclaim_capacity_byte_seconds numeric(73,9), volume_request_storage_byte_seconds numeric(73,9), persistentvolumeclaim_usage_byte_seconds numeric(73,9), total_seconds integer NOT NULL, persistentvolume_labels jsonb, persistentvolumeclaim_labels jsonb, report_period_id integer ); -- -- Name: reporting_ocpstoragelineitem_daily_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpstoragelineitem_daily_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpstoragelineitem_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpstoragelineitem_daily_id_seq OWNED BY reporting_ocpstoragelineitem_daily.id; -- -- Name: reporting_ocpstoragelineitem_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpstoragelineitem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpstoragelineitem_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpstoragelineitem_id_seq OWNED BY reporting_ocpstoragelineitem.id; -- -- Name: reporting_ocpstoragevolumelabel_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpstoragevolumelabel_summary ( uuid uuid NOT NULL, key text NOT NULL, "values" text[] NOT NULL, namespace text NOT NULL, node text, report_period_id integer NOT NULL ); -- -- Name: reporting_ocptags_values; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocptags_values ( uuid uuid NOT NULL, key text NOT NULL, value text NOT NULL, cluster_ids text[] NOT NULL, cluster_aliases text[] NOT NULL, namespaces text[] NOT NULL, nodes text[] ); -- -- Name: reporting_ocpusagelineitem; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagelineitem ( id bigint NOT NULL, namespace character varying(253) NOT NULL, pod character varying(253) NOT NULL, node character varying(253) NOT NULL, resource_id character varying(253), pod_usage_cpu_core_seconds numeric(73,9), pod_request_cpu_core_seconds numeric(73,9), pod_limit_cpu_core_seconds numeric(73,9), pod_usage_memory_byte_seconds numeric(73,9), pod_request_memory_byte_seconds numeric(73,9), pod_limit_memory_byte_seconds numeric(73,9), node_capacity_cpu_cores numeric(73,9), node_capacity_cpu_core_seconds numeric(73,9), node_capacity_memory_bytes numeric(73,9), node_capacity_memory_byte_seconds numeric(73,9), pod_labels jsonb, report_id integer NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpusagelineitem_daily; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagelineitem_daily ( id bigint NOT NULL, cluster_id character varying(50), cluster_alias character varying(256), namespace character varying(253) NOT NULL, pod character varying(253) NOT NULL, node character varying(253) NOT NULL, resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, pod_usage_cpu_core_seconds numeric(73,9), pod_request_cpu_core_seconds numeric(73,9), pod_limit_cpu_core_seconds numeric(73,9), pod_usage_memory_byte_seconds numeric(73,9), pod_request_memory_byte_seconds numeric(73,9), pod_limit_memory_byte_seconds numeric(73,9), node_capacity_cpu_cores numeric(73,9), node_capacity_cpu_core_seconds numeric(73,9), node_capacity_memory_bytes numeric(73,9), node_capacity_memory_byte_seconds numeric(73,9), cluster_capacity_cpu_core_seconds numeric(73,9), cluster_capacity_memory_byte_seconds numeric(73,9), total_seconds integer NOT NULL, pod_labels jsonb, report_period_id integer ); -- -- Name: reporting_ocpusagelineitem_daily_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpusagelineitem_daily_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpusagelineitem_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpusagelineitem_daily_id_seq OWNED BY reporting_ocpusagelineitem_daily.id; -- -- Name: reporting_ocpusagelineitem_daily_summary_default; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagelineitem_daily_summary_default ( cluster_id character varying(50), cluster_alias character varying(256), data_source character varying(64), namespace character varying(253), node character varying(253), resource_id character varying(253), usage_start date NOT NULL, usage_end date NOT NULL, pod_labels jsonb, pod_usage_cpu_core_hours numeric(18,6), pod_request_cpu_core_hours numeric(18,6), pod_limit_cpu_core_hours numeric(18,6), pod_usage_memory_gigabyte_hours numeric(18,6), pod_request_memory_gigabyte_hours numeric(18,6), pod_limit_memory_gigabyte_hours numeric(18,6), node_capacity_cpu_cores numeric(18,6), node_capacity_cpu_core_hours numeric(18,6), node_capacity_memory_gigabytes numeric(18,6), node_capacity_memory_gigabyte_hours numeric(18,6), cluster_capacity_cpu_core_hours numeric(18,6), cluster_capacity_memory_gigabyte_hours numeric(18,6), persistentvolumeclaim character varying(253), persistentvolume character varying(253), storageclass character varying(50), volume_labels jsonb, persistentvolumeclaim_capacity_gigabyte numeric(18,6), persistentvolumeclaim_capacity_gigabyte_months numeric(18,6), volume_request_storage_gigabyte_months numeric(18,6), persistentvolumeclaim_usage_gigabyte_months numeric(18,6), infrastructure_raw_cost numeric(33,15), infrastructure_project_raw_cost numeric(33,15), infrastructure_usage_cost jsonb, infrastructure_markup_cost numeric(33,15), infrastructure_project_markup_cost numeric(33,15), infrastructure_monthly_cost numeric(33,15), supplementary_usage_cost jsonb, supplementary_monthly_cost numeric(33,15), monthly_cost_type text, source_uuid uuid, report_period_id integer, uuid uuid NOT NULL ); ALTER TABLE ONLY reporting_ocpusagelineitem_daily_summary ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default DEFAULT; -- -- Name: reporting_ocpusagelineitem_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpusagelineitem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpusagelineitem_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpusagelineitem_id_seq OWNED BY reporting_ocpusagelineitem.id; -- -- Name: reporting_ocpusagepodlabel_summary; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagepodlabel_summary ( uuid uuid NOT NULL, key text NOT NULL, "values" text[] NOT NULL, namespace text NOT NULL, node text, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpusagereport; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagereport ( id integer NOT NULL, interval_start timestamp with time zone NOT NULL, interval_end timestamp with time zone NOT NULL, report_period_id integer NOT NULL ); -- -- Name: reporting_ocpusagereport_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpusagereport_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpusagereport_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpusagereport_id_seq OWNED BY reporting_ocpusagereport.id; -- -- Name: reporting_ocpusagereportperiod; Type: TABLE; Schema: ; Owner: - -- CREATE TABLE reporting_ocpusagereportperiod ( id integer NOT NULL, cluster_id character varying(50) NOT NULL, cluster_alias character varying(256), report_period_start timestamp with time zone NOT NULL, report_period_end timestamp with time zone NOT NULL, summary_data_creation_datetime timestamp with time zone, summary_data_updated_datetime timestamp with time zone, derived_cost_datetime timestamp with time zone, provider_id uuid NOT NULL ); -- -- Name: reporting_ocpusagereportperiod_id_seq; Type: SEQUENCE; Schema: ; Owner: - -- CREATE SEQUENCE reporting_ocpusagereportperiod_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: reporting_ocpusagereportperiod_id_seq; Type: SEQUENCE OWNED BY; Schema: ; Owner: - -- ALTER SEQUENCE reporting_ocpusagereportperiod_id_seq OWNED BY reporting_ocpusagereportperiod.id; -- -- Name: cost_model_audit id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model_audit ALTER COLUMN id SET DEFAULT nextval('cost_model_audit_id_seq'::regclass); -- -- Name: cost_model_map id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model_map ALTER COLUMN id SET DEFAULT nextval('cost_model_map_id_seq'::regclass); -- -- Name: django_migrations id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY django_migrations ALTER COLUMN id SET DEFAULT nextval('django_migrations_id_seq'::regclass); -- -- Name: partitioned_tables id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY partitioned_tables ALTER COLUMN id SET DEFAULT nextval('partitioned_tables_id_seq'::regclass); -- -- Name: reporting_awsaccountalias id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsaccountalias ALTER COLUMN id SET DEFAULT nextval('reporting_awsaccountalias_id_seq'::regclass); -- -- Name: reporting_awscostentry id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentry ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentry_id_seq'::regclass); -- -- Name: reporting_awscostentrybill id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrybill ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentrybill_id_seq'::regclass); -- -- Name: reporting_awscostentrylineitem id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentrylineitem_id_seq'::regclass); -- -- Name: reporting_awscostentrylineitem_daily id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentrylineitem_daily_id_seq'::regclass); -- -- Name: reporting_awscostentrypricing id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrypricing ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentrypricing_id_seq'::regclass); -- -- Name: reporting_awscostentryproduct id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentryproduct ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentryproduct_id_seq'::regclass); -- -- Name: reporting_awscostentryreservation id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentryreservation ALTER COLUMN id SET DEFAULT nextval('reporting_awscostentryreservation_id_seq'::regclass); -- -- Name: reporting_awsorganizationalunit id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsorganizationalunit ALTER COLUMN id SET DEFAULT nextval('reporting_awsorganizationalunit_id_seq'::regclass); -- -- Name: reporting_azurecostentrybill id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrybill ALTER COLUMN id SET DEFAULT nextval('reporting_azurecostentrybill_id_seq'::regclass); -- -- Name: reporting_azurecostentrylineitem_daily id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily ALTER COLUMN id SET DEFAULT nextval('reporting_azurecostentrylineitem_daily_id_seq'::regclass); -- -- Name: reporting_azurecostentryproductservice id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentryproductservice ALTER COLUMN id SET DEFAULT nextval('reporting_azurecostentryproductservice_id_seq'::regclass); -- -- Name: reporting_azureenabledtagkeys id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azureenabledtagkeys ALTER COLUMN id SET DEFAULT nextval('reporting_azureenabledtagkeys_id_seq'::regclass); -- -- Name: reporting_azuremeter id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuremeter ALTER COLUMN id SET DEFAULT nextval('reporting_azuremeter_id_seq'::regclass); -- -- Name: reporting_gcpcostentrybill id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrybill ALTER COLUMN id SET DEFAULT nextval('reporting_gcpcostentrybill_id_seq'::regclass); -- -- Name: reporting_gcpcostentrylineitem id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem ALTER COLUMN id SET DEFAULT nextval('reporting_gcpcostentrylineitem_id_seq'::regclass); -- -- Name: reporting_gcpcostentrylineitem_daily id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily ALTER COLUMN id SET DEFAULT nextval('reporting_gcpcostentrylineitem_daily_id_seq'::regclass); -- -- Name: reporting_gcpcostentryproductservice id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentryproductservice ALTER COLUMN id SET DEFAULT nextval('reporting_gcpcostentryproductservice_id_seq'::regclass); -- -- Name: reporting_gcpenabledtagkeys id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpenabledtagkeys ALTER COLUMN id SET DEFAULT nextval('reporting_gcpenabledtagkeys_id_seq'::regclass); -- -- Name: reporting_gcpproject id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpproject ALTER COLUMN id SET DEFAULT nextval('reporting_gcpproject_id_seq'::regclass); -- -- Name: reporting_ocpcosts_summary id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpcosts_summary ALTER COLUMN id SET DEFAULT nextval('reporting_ocpcosts_summary_id_seq'::regclass); -- -- Name: reporting_ocpenabledtagkeys id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpenabledtagkeys ALTER COLUMN id SET DEFAULT nextval('reporting_ocpenabledtagkeys_id_seq'::regclass); -- -- Name: reporting_ocpnamespacelabellineitem id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnamespacelabellineitem ALTER COLUMN id SET DEFAULT nextval('reporting_ocpnamespacelabellineitem_id_seq'::regclass); -- -- Name: reporting_ocpnodelabellineitem id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem ALTER COLUMN id SET DEFAULT nextval('reporting_ocpnodelabellineitem_id_seq'::regclass); -- -- Name: reporting_ocpnodelabellineitem_daily id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem_daily ALTER COLUMN id SET DEFAULT nextval('reporting_ocpnodelabellineitem_daily_id_seq'::regclass); -- -- Name: reporting_ocpstoragelineitem id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem ALTER COLUMN id SET DEFAULT nextval('reporting_ocpstoragelineitem_id_seq'::regclass); -- -- Name: reporting_ocpstoragelineitem_daily id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem_daily ALTER COLUMN id SET DEFAULT nextval('reporting_ocpstoragelineitem_daily_id_seq'::regclass); -- -- Name: reporting_ocpusagelineitem id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem ALTER COLUMN id SET DEFAULT nextval('reporting_ocpusagelineitem_id_seq'::regclass); -- -- Name: reporting_ocpusagelineitem_daily id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem_daily ALTER COLUMN id SET DEFAULT nextval('reporting_ocpusagelineitem_daily_id_seq'::regclass); -- -- Name: reporting_ocpusagereport id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereport ALTER COLUMN id SET DEFAULT nextval('reporting_ocpusagereport_id_seq'::regclass); -- -- Name: reporting_ocpusagereportperiod id; Type: DEFAULT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereportperiod ALTER COLUMN id SET DEFAULT nextval('reporting_ocpusagereportperiod_id_seq'::regclass); -- -- Data for Name: django_migrations; Type: TABLE DATA; Schema: ; Owner: - -- insert into django_migrations (id, app, name, applied) values (1, 'api', '0001_initial_squashed_0008_auto_20190305_2015', '2021-04-26 19:57:07.090488+00'::timestamptz), (2, 'api', '0009_providerstatus_squashed_0042_auto_20200116_2048', '2021-04-26 19:57:07.091769+00'::timestamptz), (3, 'api', '0010_auto_20200128_2138', '2021-04-26 19:57:07.092774+00'::timestamptz), (4, 'api', '0011_auto_20200204_1647', '2021-04-26 19:57:07.093735+00'::timestamptz), (5, 'api', '0012_auto_20200225_2022', '2021-04-26 19:57:07.094697+00'::timestamptz), (6, 'api', '0013_auto_20200226_1953', '2021-04-26 19:57:07.095664+00'::timestamptz), (7, 'api', '0014_reload_azure_map', '2021-04-26 19:57:07.096622+00'::timestamptz), (8, 'api', '0015_auto_20200311_2049', '2021-04-26 19:57:07.097553+00'::timestamptz), (9, 'api', '0016_auto_20200324_1420', '2021-04-26 19:57:07.098493+00'::timestamptz), (10, 'api', '0017_delete_cloudaccount', '2021-04-26 19:57:07.099428+00'::timestamptz), (11, 'api', '0018_auto_20200326_0102', '2021-04-26 19:57:07.100365+00'::timestamptz), (12, 'api', '0019_delete_costmodelmetricsmap', '2021-04-26 19:57:07.1013+00'::timestamptz), (13, 'api', '0020_sources_out_of_order_delete', '2021-04-26 19:57:07.10223+00'::timestamptz), (14, 'api', '0021_delete_providerstatus', '2021-04-26 19:57:07.103162+00'::timestamptz), (15, 'api', '0022_auto_20200812_1945', '2021-04-26 19:57:07.104097+00'::timestamptz), (16, 'api', '0023_auto_20200820_2314', '2021-04-26 19:57:07.105039+00'::timestamptz), (17, 'api', '0024_auto_20200824_1759', '2021-04-26 19:57:07.105964+00'::timestamptz), (18, 'api', '0025_db_functions', '2021-04-26 19:57:07.106868+00'::timestamptz), (19, 'api', '0026_provider_data_updated_timestamp', '2021-04-26 19:57:07.107741+00'::timestamptz), (20, 'api', '0027_customer_date_updated', '2021-04-26 19:57:07.108635+00'::timestamptz), (21, 'api', '0028_public_function_update', '2021-04-26 19:57:07.109516+00'::timestamptz), (22, 'api', '0029_auto_20200921_2016', '2021-04-26 19:57:07.110405+00'::timestamptz), (23, 'api', '0030_auto_20201007_1403', '2021-04-26 19:57:07.114753+00'::timestamptz), (24, 'api', '0031_clone_schema', '2021-04-26 19:57:07.116592+00'::timestamptz), (25, 'api', '0032_presto_delete_log_trigger_func', '2021-04-26 19:57:07.118406+00'::timestamptz), (26, 'api', '0033_sources_name_text', '2021-04-26 19:57:07.124069+00'::timestamptz), (27, 'api', '0034_remove_sources_endpoint_id', '2021-04-26 19:57:07.126633+00'::timestamptz), (28, 'api', '0035_reapply_partition_and_clone_func', '2021-04-26 19:57:07.128497+00'::timestamptz), (29, 'api', '0036_reapply_check_migrations_func', '2021-04-26 19:57:07.130384+00'::timestamptz), (30, 'api', '0037_auto_20210223_2136', '2021-04-26 19:57:07.13291+00'::timestamptz), (31, 'api', '0038_drop_app_needs_migrations_func', '2021-04-26 19:57:07.134741+00'::timestamptz), (32, 'api', '0039_create_hive_db', '2021-04-26 19:57:07.136522+00'::timestamptz), (33, 'api', '0040_auto_20210318_1514', '2021-04-26 19:57:07.144889+00'::timestamptz), (34, 'api', '0041_array_subtract_dbfunc', '2021-04-26 19:57:07.146735+00'::timestamptz), (35, 'api', '0042_reapply_clone_func', '2021-04-26 19:57:07.148486+00'::timestamptz), (36, 'api', '0043_apply_turbo_schema_clone_func', '2021-04-26 19:57:07.150248+00'::timestamptz), (37, 'contenttypes', '0001_initial', '2021-04-26 19:57:07.154361+00'::timestamptz), (38, 'contenttypes', '0002_remove_content_type_name', '2021-04-26 19:57:07.15869+00'::timestamptz), (39, 'auth', '0001_initial', '2021-04-26 19:57:07.167685+00'::timestamptz), (40, 'auth', '0002_alter_permission_name_max_length', '2021-04-26 19:57:07.172819+00'::timestamptz), (41, 'auth', '0003_alter_user_email_max_length', '2021-04-26 19:57:07.177902+00'::timestamptz), (42, 'auth', '0004_alter_user_username_opts', '2021-04-26 19:57:07.183086+00'::timestamptz), (43, 'auth', '0005_alter_user_last_login_null', '2021-04-26 19:57:07.188288+00'::timestamptz), (44, 'auth', '0006_require_contenttypes_0002', '2021-04-26 19:57:07.189756+00'::timestamptz), (45, 'auth', '0007_alter_validators_add_error_messages', '2021-04-26 19:57:07.195048+00'::timestamptz), (46, 'auth', '0008_alter_user_username_max_length', '2021-04-26 19:57:07.20042+00'::timestamptz), (47, 'auth', '0009_alter_user_last_name_max_length', '2021-04-26 19:57:07.206683+00'::timestamptz), (48, 'auth', '0010_alter_group_name_max_length', '2021-04-26 19:57:07.212211+00'::timestamptz), (49, 'auth', '0011_update_proxy_permissions', '2021-04-26 19:57:07.214252+00'::timestamptz), (50, 'auth', '0012_alter_user_first_name_max_length', '2021-04-26 19:57:07.219808+00'::timestamptz), (51, 'cost_models', '0001_initial_squashed_0018_auto_20200116_2048', '2021-04-26 19:57:07.25429+00'::timestamptz), (52, 'cost_models', '0002_auto_20200318_1233', '2021-04-26 19:57:07.255371+00'::timestamptz), (53, 'cost_models', '0002_auto_20210318_1514', '2021-04-26 19:57:07.263476+00'::timestamptz), (54, 'reporting', '0001_squashed_0090_ocpallcostlineitemdailysummary_ocpallcostlineitemprojectdailysummary', '2021-04-26 19:57:16.231442+00'::timestamptz), (55, 'reporting', '0091_aws_compute_cost_correction', '2021-04-26 19:57:16.233163+00'::timestamptz), (56, 'reporting', '0092_auto_20200203_1758', '2021-04-26 19:57:16.23462+00'::timestamptz), (57, 'reporting', '0093_auto_20200210_1920', '2021-04-26 19:57:16.236181+00'::timestamptz), (58, 'reporting', '0094_auto_20200211_1449', '2021-04-26 19:57:16.237776+00'::timestamptz), (59, 'reporting', '0095_auto_20200212_1606', '2021-04-26 19:57:16.239214+00'::timestamptz), (60, 'reporting', '0096_auto_20200218_2227', '2021-04-26 19:57:16.240665+00'::timestamptz), (61, 'reporting', '0097_auto_20200221_1331', '2021-04-26 19:57:16.242276+00'::timestamptz), (62, 'reporting', '0098_auto_20200221_2034', '2021-04-26 19:57:16.243851+00'::timestamptz), (63, 'reporting', '0099_ocp_performance', '2021-04-26 19:57:16.245355+00'::timestamptz), (64, 'reporting', '0100_aws_azure_query_perforance', '2021-04-26 19:57:16.246936+00'::timestamptz), (65, 'reporting', '0101_ocpenabledtagkeys', '2021-04-26 19:57:16.248437+00'::timestamptz), (66, 'reporting', '0102_auto_20200228_1812', '2021-04-26 19:57:16.249987+00'::timestamptz), (67, 'reporting', '0103_azurecomputesummary_azurecostsummary_azurecostsummarybyaccount_azurecostsummarybylocation_azurecosts', '2021-04-26 19:57:16.251588+00'::timestamptz), (68, 'reporting', '0104_ocpallcomputesummary_ocpallcostsummary_ocpallcostsummarybyaccount_ocpallcostsummarybyregion_ocpallco', '2021-04-26 19:57:16.253147+00'::timestamptz), (69, 'reporting', '0105_ocpcostsummary_ocpcostsummarybynode_ocpcostsummarybyproject_ocppodsummary_ocppodsummarybyproject_ocp', '2021-04-26 19:57:16.254752+00'::timestamptz), (70, 'reporting', '0106_ocpawscostsummary', '2021-04-26 19:57:16.256347+00'::timestamptz), (71, 'reporting', '0107_ocpazurecomputesummary_ocpazurecostsummary_ocpazurecostsummarybyaccount_ocpazurecostsummarybylocatio', '2021-04-26 19:57:16.257926+00'::timestamptz), (72, 'reporting', '0108_auto_20200405_1316', '2021-04-26 19:57:16.259498+00'::timestamptz), (73, 'reporting', '0109_remove_ocpusagelineitemdailysummary_pod', '2021-04-26 19:57:16.260994+00'::timestamptz), (74, 'reporting', '0110_summary_indexes', '2021-04-26 19:57:16.262591+00'::timestamptz), (75, 'reporting', '0111_drop_azure_service_not_null', '2021-04-26 19:57:16.264153+00'::timestamptz), (76, 'reporting', '0112_auto_20200416_1733', '2021-04-26 19:57:16.265759+00'::timestamptz), (77, 'reporting', '0113_aws_organizational_units', '2021-04-26 19:57:16.267344+00'::timestamptz), (78, 'reporting', '0114_adding_source_uuid', '2021-04-26 19:57:16.268956+00'::timestamptz), (79, 'reporting', '0115_populate_source_uuid', '2021-04-26 19:57:16.270486+00'::timestamptz), (80, 'reporting', '0116_ocpall_unique_index', '2021-04-26 19:57:16.27209+00'::timestamptz), (81, 'reporting', '0117_auto_20200617_1452', '2021-04-26 19:57:16.273689+00'::timestamptz), (82, 'reporting', '0118_auto_20200630_1819', '2021-04-26 19:57:16.275121+00'::timestamptz), (83, 'reporting', '0119_auto_20200707_1934', '2021-04-26 19:57:16.276619+00'::timestamptz), (84, 'reporting', '0120_auto_20200724_1354', '2021-04-26 19:57:16.278102+00'::timestamptz), (85, 'reporting', '0121_auto_20200728_2258', '2021-04-26 19:57:16.279552+00'::timestamptz), (86, 'reporting', '0122_auto_20200803_2307', '2021-04-26 19:57:16.280968+00'::timestamptz), (87, 'reporting', '0123_auto_20200727_2302', '2021-04-26 19:57:16.282421+00'::timestamptz), (88, 'reporting', '0124_auto_20200806_1943', '2021-04-26 19:57:16.283911+00'::timestamptz), (89, 'reporting', '0125_azure_unit_normalization', '2021-04-26 19:57:16.285321+00'::timestamptz), (90, 'reporting', '0126_clear_org_units', '2021-04-26 19:57:16.286843+00'::timestamptz), (91, 'reporting', '0127_ocpazure_unit_normalization', '2021-04-26 19:57:16.288323+00'::timestamptz), (92, 'reporting', '0128_auto_20200820_1540', '2021-04-26 19:57:16.289836+00'::timestamptz), (93, 'reporting', '0129_partitioned_daily_summary', '2021-04-26 19:57:16.291277+00'::timestamptz), (94, 'reporting', '0130_auto_20200826_1819', '2021-04-26 19:57:16.292728+00'::timestamptz), (95, 'reporting', '0131_auto_20200827_1253', '2021-04-26 19:57:16.294069+00'::timestamptz), (96, 'reporting', '0132_auto_20200901_1811', '2021-04-26 19:57:16.29528+00'::timestamptz), (97, 'reporting', '0133_auto_20200901_2245', '2021-04-26 19:57:16.296658+00'::timestamptz), (98, 'reporting', '0134_auto_20200902_1602', '2021-04-26 19:57:16.298099+00'::timestamptz), (99, 'reporting', '0135_auto_20200902_1808', '2021-04-26 19:57:16.299558+00'::timestamptz), (100, 'reporting', '0136_auto_20200909_1400', '2021-04-26 19:57:16.300885+00'::timestamptz), (101, 'reporting', '0137_partitioned_tables_triggers', '2021-04-26 19:57:16.302299+00'::timestamptz), (102, 'reporting', '0138_auto_20200918_1724', '2021-04-26 19:57:16.303765+00'::timestamptz), (103, 'reporting', '0139_auto_20200925_1432', '2021-04-26 19:57:16.305254+00'::timestamptz), (104, 'reporting', '0140_auto_20200925_1825', '2021-04-26 19:57:16.306702+00'::timestamptz), (105, 'reporting', '0141_auto_20201002_1925', '2021-04-26 19:57:16.308163+00'::timestamptz), (106, 'reporting', '0142_auto_20201002_1925', '2021-04-26 19:57:16.30957+00'::timestamptz), (107, 'reporting', '0143_awsorganizationalunit_provider', '2021-04-26 19:57:16.729717+00'::timestamptz), (108, 'reporting', '0144_auto_20201007_1441', '2021-04-26 19:57:16.740954+00'::timestamptz), (109, 'reporting', '0145_awsenabledtagkeys_azureenabledtagkeys', '2021-04-26 19:57:16.759904+00'::timestamptz), (110, 'reporting', '0146_auto_20200917_1448', '2021-04-26 19:57:16.960926+00'::timestamptz), (111, 'reporting', '0147_auto_20201028_1305', '2021-04-26 19:57:16.96627+00'::timestamptz), (112, 'reporting', '0148_presto_delete_log', '2021-04-26 19:57:16.979506+00'::timestamptz), (113, 'reporting', '0149_auto_20201112_1414', '2021-04-26 19:57:16.985023+00'::timestamptz), (114, 'reporting', '0150_presto_bulk_pk_delete', '2021-04-26 19:57:16.994917+00'::timestamptz), (115, 'reporting', '0151_ocp_summary_table_presto_interface', '2021-04-26 19:57:17.006577+00'::timestamptz), (116, 'reporting', '0152_gcpcostentrylineitem', '2021-04-26 19:57:17.197367+00'::timestamptz), (117, 'reporting', '0153_ocpnamespacelabellineitem', '2021-04-26 19:57:17.270076+00'::timestamptz), (118, 'reporting', '0154_gcp_summary_tables', '2021-04-26 19:57:17.939637+00'::timestamptz), (119, 'reporting', '0155_gcp_partitioned', '2021-04-26 19:57:18.099899+00'::timestamptz), (120, 'reporting', '0156_auto_20201208_2029', '2021-04-26 19:57:19.114668+00'::timestamptz), (121, 'reporting', '0157_auto_20201214_1757', '2021-04-26 19:57:19.121798+00'::timestamptz), (122, 'reporting', '0158_auto_20201214_1757', '2021-04-26 19:57:19.29959+00'::timestamptz), (123, 'reporting', '0159_gcp_cost_summary', '2021-04-26 19:57:19.408521+00'::timestamptz), (124, 'reporting', '0160_auto_20210114_1548', '2021-04-26 19:57:19.469233+00'::timestamptz), (125, 'reporting', '0161_auto_20210118_2113', '2021-04-26 19:57:19.496598+00'::timestamptz), (126, 'reporting', '0162_auto_20201120_1901', '2021-04-26 19:57:19.548951+00'::timestamptz), (127, 'reporting', '0163_gcp_compute_summary', '2021-04-26 19:57:19.657831+00'::timestamptz), (128, 'reporting', '0164_gcpcomputesummary_gcpcomputesummarybyaccount_gcpcomputesummarybyproject_gcpcomputesummarybyregion_gc', '2021-04-26 19:57:19.67588+00'::timestamptz), (129, 'reporting', '0165_repartition_default_data', '2021-04-26 19:57:19.938277+00'::timestamptz), (130, 'reporting', '0166_gcp_storage_summary', '2021-04-26 19:57:20.074495+00'::timestamptz), (131, 'reporting', '0167_gcpdatabasesummary_gcpnetworksummary', '2021-04-26 19:57:20.17812+00'::timestamptz), (132, 'reporting', '0168_auto_20210211_2210', '2021-04-26 19:57:20.226655+00'::timestamptz), (133, 'reporting', '0169_auto_20210216_1448', '2021-04-26 19:57:20.318397+00'::timestamptz), (134, 'reporting', '0170_auto_20210305_1659', '2021-04-26 19:57:20.582359+00'::timestamptz), (135, 'reporting', '0171_gcp_database_network_additions', '2021-04-26 19:57:20.687035+00'::timestamptz), (136, 'reporting', '0172_auto_20210318_1514', '2021-04-26 19:57:20.7058+00'::timestamptz), (137, 'reporting', '0173_auto_20210325_1354', '2021-04-26 19:57:20.823637+00'::timestamptz), (138, 'reporting', '0174_update_ocpall_matviews', '2021-04-26 19:57:20.828972+00'::timestamptz), (139, 'reporting', '0175_auto_20210407_2043', '2021-04-26 19:57:20.921299+00'::timestamptz), (140, 'reporting', '0176_update_aws_enabled_keys', '2021-04-26 19:57:20.956162+00'::timestamptz), (141, 'reporting_common', '0001_initial_squashed_0007_auto_20190208_0316_squashed_0019_auto_20191022_1602', '2021-04-26 19:57:21.074656+00'::timestamptz), (142, 'reporting_common', '0020_auto_20191022_1620_squashed_0025_auto_20200116_2048', '2021-04-26 19:57:21.076435+00'::timestamptz), (143, 'reporting_common', '0021_delete_reportcolumnmap', '2021-04-26 19:57:21.078024+00'::timestamptz), (144, 'reporting_common', '0022_auto_20200505_1707', '2021-04-26 19:57:21.079507+00'::timestamptz), (145, 'reporting_common', '0023_delete_siunitscale', '2021-04-26 19:57:21.081071+00'::timestamptz), (146, 'reporting_common', '0024_remove_costusagereportmanifest_num_processed_files', '2021-04-26 19:57:21.082692+00'::timestamptz), (147, 'reporting_common', '0025_remove_costusagereportmanifest_task', '2021-04-26 19:57:21.084323+00'::timestamptz), (148, 'reporting_common', '0026_costusagereportmanifest_manifest_modified_datetime', '2021-04-26 19:57:21.085882+00'::timestamptz), (149, 'reporting_common', '0027_auto_20210412_1731', '2021-04-26 19:57:21.298914+00'::timestamptz), (150, 'sessions', '0001_initial', '2021-04-26 19:57:21.307085+00'::timestamptz), (151, 'api', '0001_initial', '2021-04-26 19:57:21.313931+00'::timestamptz), (152, 'reporting', '0001_initial', '2021-04-26 19:57:21.316301+00'::timestamptz), (153, 'reporting_common', '0001_initial', '2021-04-26 19:57:21.318581+00'::timestamptz), (154, 'cost_models', '0001_initial', '2021-04-26 19:57:21.320766+00'::timestamptz), (155, 'api', '0044_auto_20210505_1747', '2021-05-05 18:43:58.190203+00'::timestamptz), (156, 'reporting', '0177_auto_20210506_1650', '2021-05-06 17:07:16.960105+00'::timestamptz), (157, 'reporting', '0178_auto_20210511_1851', '2021-05-11 19:45:16.960105+00'::timestamptz) ; -- -- Data for Name: partitioned_tables; Type: TABLE DATA; Schema: ; Owner: - -- insert into partitioned_tables (id, schema_name, table_name, partition_of_table_name, partition_type, partition_col, partition_parameters, active) values (1, current_schema, 'reporting_ocpusagelineitem_daily_summary_default', 'reporting_ocpusagelineitem_daily_summary', 'range', 'usage_start', '{"default": true}', true), (2, current_schema, 'reporting_awscostentrylineitem_daily_summary_default', 'reporting_awscostentrylineitem_daily_summary', 'range', 'usage_start', '{"default": true}', true), (3, current_schema, 'reporting_azurecostentrylineitem_daily_summary_default', 'reporting_azurecostentrylineitem_daily_summary', 'range', 'usage_start', '{"default": true}', true), (4, current_schema, 'reporting_gcpcostentrylineitem_daily_summary_default', 'reporting_gcpcostentrylineitem_daily_summary', 'range', 'usage_start', '{"default": true}', true) ; -- -- Name: cost_model_audit_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('cost_model_audit_id_seq', 1, false); -- -- Name: cost_model_map_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('cost_model_map_id_seq', 1, false); -- -- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('django_migrations_id_seq', 154, true); -- -- Name: partitioned_tables_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('partitioned_tables_id_seq', 4, true); -- -- Name: reporting_awsaccountalias_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awsaccountalias_id_seq', 1, false); -- -- Name: reporting_awscostentry_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentry_id_seq', 1, false); -- -- Name: reporting_awscostentrybill_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentrybill_id_seq', 1, false); -- -- Name: reporting_awscostentrylineitem_daily_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentrylineitem_daily_id_seq', 1, false); -- -- Name: reporting_awscostentrylineitem_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentrylineitem_id_seq', 1, false); -- -- Name: reporting_awscostentrypricing_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentrypricing_id_seq', 1, false); -- -- Name: reporting_awscostentryproduct_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentryproduct_id_seq', 1, false); -- -- Name: reporting_awscostentryreservation_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awscostentryreservation_id_seq', 1, false); -- -- Name: reporting_awsorganizationalunit_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_awsorganizationalunit_id_seq', 1, false); -- -- Name: reporting_azurecostentrybill_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_azurecostentrybill_id_seq', 1, false); -- -- Name: reporting_azurecostentrylineitem_daily_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_azurecostentrylineitem_daily_id_seq', 1, false); -- -- Name: reporting_azurecostentryproductservice_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_azurecostentryproductservice_id_seq', 1, false); -- -- Name: reporting_azureenabledtagkeys_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_azureenabledtagkeys_id_seq', 1, false); -- -- Name: reporting_azuremeter_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_azuremeter_id_seq', 1, false); -- -- Name: reporting_gcpcostentrybill_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_gcpcostentrybill_id_seq', 1, false); -- -- Name: reporting_gcpcostentrylineitem_daily_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_gcpcostentrylineitem_daily_id_seq', 1, false); -- -- Name: reporting_gcpcostentrylineitem_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_gcpcostentrylineitem_id_seq', 1, false); -- -- Name: reporting_gcpcostentryproductservice_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_gcpcostentryproductservice_id_seq', 1, false); -- -- Name: reporting_gcpenabledtagkeys_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_gcpenabledtagkeys_id_seq', 1, false); -- -- Name: reporting_gcpproject_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_gcpproject_id_seq', 1, false); -- -- Name: reporting_ocpcosts_summary_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpcosts_summary_id_seq', 1, false); -- -- Name: reporting_ocpenabledtagkeys_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpenabledtagkeys_id_seq', 1, false); -- -- Name: reporting_ocpnamespacelabellineitem_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpnamespacelabellineitem_id_seq', 1, false); -- -- Name: reporting_ocpnodelabellineitem_daily_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpnodelabellineitem_daily_id_seq', 1, false); -- -- Name: reporting_ocpnodelabellineitem_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpnodelabellineitem_id_seq', 1, false); -- -- Name: reporting_ocpstoragelineitem_daily_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpstoragelineitem_daily_id_seq', 1, false); -- -- Name: reporting_ocpstoragelineitem_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpstoragelineitem_id_seq', 1, false); -- -- Name: reporting_ocpusagelineitem_daily_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpusagelineitem_daily_id_seq', 1, false); -- -- Name: reporting_ocpusagelineitem_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpusagelineitem_id_seq', 1, false); -- -- Name: reporting_ocpusagereport_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpusagereport_id_seq', 1, false); -- -- Name: reporting_ocpusagereportperiod_id_seq; Type: SEQUENCE SET; Schema: ; Owner: - -- SELECT pg_catalog.setval('reporting_ocpusagereportperiod_id_seq', 1, false); -- -- Name: cost_model_audit cost_model_audit_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model_audit ADD CONSTRAINT cost_model_audit_pkey PRIMARY KEY (id); -- -- Name: cost_model_map cost_model_map_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model_map ADD CONSTRAINT cost_model_map_pkey PRIMARY KEY (id); -- -- Name: cost_model_map cost_model_map_provider_uuid_cost_model_id_40cf193b_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model_map ADD CONSTRAINT cost_model_map_provider_uuid_cost_model_id_40cf193b_uniq UNIQUE (provider_uuid, cost_model_id); -- -- Name: cost_model cost_model_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model ADD CONSTRAINT cost_model_pkey PRIMARY KEY (uuid); -- -- Name: django_migrations django_migrations_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY django_migrations ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpcostentrylineitem_daily_summary p_reporting_gcpcostentrylineitem_daily_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_gcpcostentrylineitem_daily_summary_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: partitioned_tables partitioned_tables_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY partitioned_tables ADD CONSTRAINT partitioned_tables_pkey PRIMARY KEY (id); -- -- Name: partitioned_tables partitioned_tables_schema_name_table_name_5f95f299_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY partitioned_tables ADD CONSTRAINT partitioned_tables_schema_name_table_name_5f95f299_uniq UNIQUE (schema_name, table_name); -- -- Name: presto_delete_wrapper_log presto_delete_wrapper_log_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY presto_delete_wrapper_log ADD CONSTRAINT presto_delete_wrapper_log_pkey PRIMARY KEY (id); -- -- Name: reporting_awsaccountalias reporting_awsaccountalias_account_id_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsaccountalias ADD CONSTRAINT reporting_awsaccountalias_account_id_key UNIQUE (account_id); -- -- Name: reporting_awsaccountalias reporting_awsaccountalias_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsaccountalias ADD CONSTRAINT reporting_awsaccountalias_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentry reporting_awscostentry_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentry ADD CONSTRAINT reporting_awscostentry_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentrybill reporting_awscostentrybi_bill_type_payer_account__6f101061_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrybill ADD CONSTRAINT reporting_awscostentrybi_bill_type_payer_account__6f101061_uniq UNIQUE (bill_type, payer_account_id, billing_period_start, provider_id); -- -- Name: reporting_awscostentrybill reporting_awscostentrybill_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrybill ADD CONSTRAINT reporting_awscostentrybill_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentrylineitem_daily reporting_awscostentrylineitem_daily_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily ADD CONSTRAINT reporting_awscostentrylineitem_daily_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentrylineitem_daily_summary reporting_awscostentrylineitem_daily_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily_summary ADD CONSTRAINT reporting_awscostentrylineitem_daily_summary_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_awscostentrylineitem_daily_summary_default reporting_awscostentrylineitem_daily_summary_default_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily_summary_default ADD CONSTRAINT reporting_awscostentrylineitem_daily_summary_default_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_awscostentrylineitem reporting_awscostentrylineitem_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ADD CONSTRAINT reporting_awscostentrylineitem_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentryproduct reporting_awscostentrypr_sku_product_name_region_fea902ae_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentryproduct ADD CONSTRAINT reporting_awscostentrypr_sku_product_name_region_fea902ae_uniq UNIQUE (sku, product_name, region); -- -- Name: reporting_awscostentrypricing reporting_awscostentrypricing_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrypricing ADD CONSTRAINT reporting_awscostentrypricing_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentrypricing reporting_awscostentrypricing_term_unit_c3978af3_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrypricing ADD CONSTRAINT reporting_awscostentrypricing_term_unit_c3978af3_uniq UNIQUE (term, unit); -- -- Name: reporting_awscostentryproduct reporting_awscostentryproduct_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentryproduct ADD CONSTRAINT reporting_awscostentryproduct_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentryreservation reporting_awscostentryreservation_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentryreservation ADD CONSTRAINT reporting_awscostentryreservation_pkey PRIMARY KEY (id); -- -- Name: reporting_awscostentryreservation reporting_awscostentryreservation_reservation_arn_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentryreservation ADD CONSTRAINT reporting_awscostentryreservation_reservation_arn_key UNIQUE (reservation_arn); -- -- Name: reporting_awsenabledtagkeys reporting_awsenabledtagkeys_key_8c2841c2_pk; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsenabledtagkeys ADD CONSTRAINT reporting_awsenabledtagkeys_key_8c2841c2_pk PRIMARY KEY (key); -- -- Name: reporting_awsorganizationalunit reporting_awsorganizationalunit_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsorganizationalunit ADD CONSTRAINT reporting_awsorganizationalunit_pkey PRIMARY KEY (id); -- -- Name: reporting_awstags_summary reporting_awstags_summar_key_cost_entry_bill_id_u_1f71e435_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awstags_summary ADD CONSTRAINT reporting_awstags_summar_key_cost_entry_bill_id_u_1f71e435_uniq UNIQUE (key, cost_entry_bill_id, usage_account_id); -- -- Name: reporting_awstags_summary reporting_awstags_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awstags_summary ADD CONSTRAINT reporting_awstags_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_awstags_values reporting_awstags_values_key_value_56d23b8e_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awstags_values ADD CONSTRAINT reporting_awstags_values_key_value_56d23b8e_uniq UNIQUE (key, value); -- -- Name: reporting_awstags_values reporting_awstags_values_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awstags_values ADD CONSTRAINT reporting_awstags_values_pkey PRIMARY KEY (uuid); -- -- Name: reporting_azurecostentrybill reporting_azurecostentry_billing_period_start_pro_c99ba20a_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrybill ADD CONSTRAINT reporting_azurecostentry_billing_period_start_pro_c99ba20a_uniq UNIQUE (billing_period_start, provider_id); -- -- Name: reporting_azurecostentryproductservice reporting_azurecostentry_instance_id_instance_typ_44f8ec94_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentryproductservice ADD CONSTRAINT reporting_azurecostentry_instance_id_instance_typ_44f8ec94_uniq UNIQUE (instance_id, instance_type, service_tier, service_name); -- -- Name: reporting_azurecostentrybill reporting_azurecostentrybill_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrybill ADD CONSTRAINT reporting_azurecostentrybill_pkey PRIMARY KEY (id); -- -- Name: reporting_azurecostentrylineitem_daily reporting_azurecostentrylineitem_daily_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily ADD CONSTRAINT reporting_azurecostentrylineitem_daily_pkey PRIMARY KEY (id); -- -- Name: reporting_azurecostentrylineitem_daily_summary reporting_azurecostentrylineitem_daily_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily_summary ADD CONSTRAINT reporting_azurecostentrylineitem_daily_summary_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_azurecostentrylineitem_daily_summary_default reporting_azurecostentrylineitem_daily_summary_default_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily_summary_default ADD CONSTRAINT reporting_azurecostentrylineitem_daily_summary_default_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_azurecostentryproductservice reporting_azurecostentryproductservice_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentryproductservice ADD CONSTRAINT reporting_azurecostentryproductservice_pkey PRIMARY KEY (id); -- -- Name: reporting_azureenabledtagkeys reporting_azureenabledtagkeys_key_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azureenabledtagkeys ADD CONSTRAINT reporting_azureenabledtagkeys_key_key UNIQUE (key); -- -- Name: reporting_azureenabledtagkeys reporting_azureenabledtagkeys_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azureenabledtagkeys ADD CONSTRAINT reporting_azureenabledtagkeys_pkey PRIMARY KEY (id); -- -- Name: reporting_azuremeter reporting_azuremeter_meter_id_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuremeter ADD CONSTRAINT reporting_azuremeter_meter_id_key UNIQUE (meter_id); -- -- Name: reporting_azuremeter reporting_azuremeter_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuremeter ADD CONSTRAINT reporting_azuremeter_pkey PRIMARY KEY (id); -- -- Name: reporting_azuretags_summary reporting_azuretags_summ_key_cost_entry_bill_id_s_bf83e989_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuretags_summary ADD CONSTRAINT reporting_azuretags_summ_key_cost_entry_bill_id_s_bf83e989_uniq UNIQUE (key, cost_entry_bill_id, subscription_guid); -- -- Name: reporting_azuretags_summary reporting_azuretags_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuretags_summary ADD CONSTRAINT reporting_azuretags_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_azuretags_values reporting_azuretags_values_key_value_bb8b5dff_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuretags_values ADD CONSTRAINT reporting_azuretags_values_key_value_bb8b5dff_uniq UNIQUE (key, value); -- -- Name: reporting_azuretags_values reporting_azuretags_values_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuretags_values ADD CONSTRAINT reporting_azuretags_values_pkey PRIMARY KEY (uuid); -- -- Name: reporting_gcpcostentrybill reporting_gcpcostentrybi_billing_period_start_pro_f84030ae_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrybill ADD CONSTRAINT reporting_gcpcostentrybi_billing_period_start_pro_f84030ae_uniq UNIQUE (billing_period_start, provider_id); -- -- Name: reporting_gcpcostentrybill reporting_gcpcostentrybill_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrybill ADD CONSTRAINT reporting_gcpcostentrybill_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpcostentrylineitem_daily reporting_gcpcostentrylineitem_daily_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily ADD CONSTRAINT reporting_gcpcostentrylineitem_daily_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpcostentrylineitem_daily_summary_default reporting_gcpcostentrylineitem_daily_summary_default_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily_summary_default ADD CONSTRAINT reporting_gcpcostentrylineitem_daily_summary_default_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_gcpcostentrylineitem reporting_gcpcostentrylineitem_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem ADD CONSTRAINT reporting_gcpcostentrylineitem_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpcostentryproductservice reporting_gcpcostentrypr_service_id_service_alias_47942f37_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentryproductservice ADD CONSTRAINT reporting_gcpcostentrypr_service_id_service_alias_47942f37_uniq UNIQUE (service_id, service_alias, sku_id, sku_alias); -- -- Name: reporting_gcpcostentryproductservice reporting_gcpcostentryproductservice_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentryproductservice ADD CONSTRAINT reporting_gcpcostentryproductservice_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpenabledtagkeys reporting_gcpenabledtagkeys_key_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpenabledtagkeys ADD CONSTRAINT reporting_gcpenabledtagkeys_key_key UNIQUE (key); -- -- Name: reporting_gcpenabledtagkeys reporting_gcpenabledtagkeys_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpenabledtagkeys ADD CONSTRAINT reporting_gcpenabledtagkeys_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpproject reporting_gcpproject_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpproject ADD CONSTRAINT reporting_gcpproject_pkey PRIMARY KEY (id); -- -- Name: reporting_gcpproject reporting_gcpproject_project_id_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpproject ADD CONSTRAINT reporting_gcpproject_project_id_key UNIQUE (project_id); -- -- Name: reporting_gcptags_summary reporting_gcptags_summar_key_cost_entry_bill_id_a_a0ec79e3_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcptags_summary ADD CONSTRAINT reporting_gcptags_summar_key_cost_entry_bill_id_a_a0ec79e3_uniq UNIQUE (key, cost_entry_bill_id, account_id, project_id, project_name); -- -- Name: reporting_gcptags_summary reporting_gcptags_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcptags_summary ADD CONSTRAINT reporting_gcptags_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_gcptags_values reporting_gcptags_values_key_value_dfee3462_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcptags_values ADD CONSTRAINT reporting_gcptags_values_key_value_dfee3462_uniq UNIQUE (key, value); -- -- Name: reporting_gcptags_values reporting_gcptags_values_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcptags_values ADD CONSTRAINT reporting_gcptags_values_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpawscostlineitem_project_daily_summary reporting_ocpawscostline_uuid_9afa8623_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpawscostline_uuid_9afa8623_uniq UNIQUE (uuid); -- -- Name: reporting_ocpawscostlineitem_project_daily_summary reporting_ocpawscostlinei_uuid_9afa8623_pk; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpawscostlinei_uuid_9afa8623_pk PRIMARY KEY (uuid); -- -- Name: reporting_ocpawscostlineitem_daily_summary reporting_ocpawscostlineitem_daily_summary_uuid_3d5dc959_pk; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_daily_summary ADD CONSTRAINT reporting_ocpawscostlineitem_daily_summary_uuid_3d5dc959_pk PRIMARY KEY (uuid); -- -- Name: reporting_ocpawscostlineitem_daily_summary reporting_ocpawscostlineitem_daily_summary_uuid_3d5dc959_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_daily_summary ADD CONSTRAINT reporting_ocpawscostlineitem_daily_summary_uuid_3d5dc959_uniq UNIQUE (uuid); -- -- Name: reporting_ocpawstags_summary reporting_ocpawstags_sum_key_cost_entry_bill_id_r_00bc8a3b_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_summary ADD CONSTRAINT reporting_ocpawstags_sum_key_cost_entry_bill_id_r_00bc8a3b_uniq UNIQUE (key, cost_entry_bill_id, report_period_id, usage_account_id, namespace, node); -- -- Name: reporting_ocpawstags_summary reporting_ocpawstags_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_summary ADD CONSTRAINT reporting_ocpawstags_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpawstags_values reporting_ocpawstags_values_key_value_1efa08ea_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_values ADD CONSTRAINT reporting_ocpawstags_values_key_value_1efa08ea_uniq UNIQUE (key, value); -- -- Name: reporting_ocpawstags_values reporting_ocpawstags_values_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_values ADD CONSTRAINT reporting_ocpawstags_values_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpazurecostlineitem_project_daily_summary reporting_ocpazurecostli_uuid_1cf2074c_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpazurecostli_uuid_1cf2074c_uniq UNIQUE (uuid); -- -- Name: reporting_ocpazurecostlineitem_project_daily_summary reporting_ocpazurecostlin_uuid_1cf2074c_pk; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpazurecostlin_uuid_1cf2074c_pk PRIMARY KEY (uuid); -- -- Name: reporting_ocpazurecostlineitem_daily_summary reporting_ocpazurecostlineitem_daily_summary_uuid_4063f4f5_pk; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_daily_summary ADD CONSTRAINT reporting_ocpazurecostlineitem_daily_summary_uuid_4063f4f5_pk PRIMARY KEY (uuid); -- -- Name: reporting_ocpazurecostlineitem_daily_summary reporting_ocpazurecostlineitem_daily_summary_uuid_4063f4f5_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_daily_summary ADD CONSTRAINT reporting_ocpazurecostlineitem_daily_summary_uuid_4063f4f5_uniq UNIQUE (uuid); -- -- Name: reporting_ocpazuretags_summary reporting_ocpazuretags_s_key_cost_entry_bill_id_r_7fb461bc_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazuretags_summary ADD CONSTRAINT reporting_ocpazuretags_s_key_cost_entry_bill_id_r_7fb461bc_uniq UNIQUE (key, cost_entry_bill_id, report_period_id, subscription_guid, namespace, node); -- -- Name: reporting_ocpazuretags_summary reporting_ocpazuretags_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazuretags_summary ADD CONSTRAINT reporting_ocpazuretags_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpazuretags_values reporting_ocpazuretags_values_key_value_306fdd41_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazuretags_values ADD CONSTRAINT reporting_ocpazuretags_values_key_value_306fdd41_uniq UNIQUE (key, value); -- -- Name: reporting_ocpazuretags_values reporting_ocpazuretags_values_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazuretags_values ADD CONSTRAINT reporting_ocpazuretags_values_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpcosts_summary reporting_ocpcosts_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpcosts_summary ADD CONSTRAINT reporting_ocpcosts_summary_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpenabledtagkeys reporting_ocpenabledtagkeys_key_key; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpenabledtagkeys ADD CONSTRAINT reporting_ocpenabledtagkeys_key_key UNIQUE (key); -- -- Name: reporting_ocpenabledtagkeys reporting_ocpenabledtagkeys_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpenabledtagkeys ADD CONSTRAINT reporting_ocpenabledtagkeys_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpnamespacelabellineitem reporting_ocpnamespacela_report_id_namespace_00f2972c_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnamespacelabellineitem ADD CONSTRAINT reporting_ocpnamespacela_report_id_namespace_00f2972c_uniq UNIQUE (report_id, namespace); -- -- Name: reporting_ocpnamespacelabellineitem reporting_ocpnamespacelabellineitem_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnamespacelabellineitem ADD CONSTRAINT reporting_ocpnamespacelabellineitem_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpnodelabellineitem_daily reporting_ocpnodelabellineitem_daily_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem_daily ADD CONSTRAINT reporting_ocpnodelabellineitem_daily_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpnodelabellineitem reporting_ocpnodelabellineitem_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem ADD CONSTRAINT reporting_ocpnodelabellineitem_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpnodelabellineitem reporting_ocpnodelabellineitem_report_id_node_babd91c2_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem ADD CONSTRAINT reporting_ocpnodelabellineitem_report_id_node_babd91c2_uniq UNIQUE (report_id, node); -- -- Name: reporting_ocpstoragelineitem reporting_ocpstorageline_report_id_namespace_pers_9bf00103_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem ADD CONSTRAINT reporting_ocpstorageline_report_id_namespace_pers_9bf00103_uniq UNIQUE (report_id, namespace, persistentvolumeclaim); -- -- Name: reporting_ocpstoragelineitem_daily reporting_ocpstoragelineitem_daily_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem_daily ADD CONSTRAINT reporting_ocpstoragelineitem_daily_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpstoragelineitem reporting_ocpstoragelineitem_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem ADD CONSTRAINT reporting_ocpstoragelineitem_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpstoragevolumelabel_summary reporting_ocpstoragevolu_key_report_period_id_nam_17bc3852_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragevolumelabel_summary ADD CONSTRAINT reporting_ocpstoragevolu_key_report_period_id_nam_17bc3852_uniq UNIQUE (key, report_period_id, namespace, node); -- -- Name: reporting_ocpstoragevolumelabel_summary reporting_ocpstoragevolumelabel_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragevolumelabel_summary ADD CONSTRAINT reporting_ocpstoragevolumelabel_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocptags_values reporting_ocptags_values_key_value_135d8752_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocptags_values ADD CONSTRAINT reporting_ocptags_values_key_value_135d8752_uniq UNIQUE (key, value); -- -- Name: reporting_ocptags_values reporting_ocptags_values_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocptags_values ADD CONSTRAINT reporting_ocptags_values_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpusagelineitem reporting_ocpusagelineit_report_id_namespace_pod__dfc2c342_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem ADD CONSTRAINT reporting_ocpusagelineit_report_id_namespace_pod__dfc2c342_uniq UNIQUE (report_id, namespace, pod, node); -- -- Name: reporting_ocpusagelineitem_daily reporting_ocpusagelineitem_daily_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem_daily ADD CONSTRAINT reporting_ocpusagelineitem_daily_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpusagelineitem_daily_summary reporting_ocpusagelineitem_daily_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem_daily_summary ADD CONSTRAINT reporting_ocpusagelineitem_daily_summary_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_ocpusagelineitem_daily_summary_default reporting_ocpusagelineitem_daily_summary_default_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem_daily_summary_default ADD CONSTRAINT reporting_ocpusagelineitem_daily_summary_default_pkey PRIMARY KEY (usage_start, uuid); -- -- Name: reporting_ocpusagelineitem reporting_ocpusagelineitem_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem ADD CONSTRAINT reporting_ocpusagelineitem_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpusagepodlabel_summary reporting_ocpusagepodlab_key_report_period_id_nam_8284236c_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagepodlabel_summary ADD CONSTRAINT reporting_ocpusagepodlab_key_report_period_id_nam_8284236c_uniq UNIQUE (key, report_period_id, namespace, node); -- -- Name: reporting_ocpusagepodlabel_summary reporting_ocpusagepodlabel_summary_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagepodlabel_summary ADD CONSTRAINT reporting_ocpusagepodlabel_summary_pkey PRIMARY KEY (uuid); -- -- Name: reporting_ocpusagereportperiod reporting_ocpusagereport_cluster_id_report_period_ff3ea314_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereportperiod ADD CONSTRAINT reporting_ocpusagereport_cluster_id_report_period_ff3ea314_uniq UNIQUE (cluster_id, report_period_start, provider_id); -- -- Name: reporting_ocpusagereport reporting_ocpusagereport_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereport ADD CONSTRAINT reporting_ocpusagereport_pkey PRIMARY KEY (id); -- -- Name: reporting_ocpusagereport reporting_ocpusagereport_report_period_id_interva_066551f3_uniq; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereport ADD CONSTRAINT reporting_ocpusagereport_report_period_id_interva_066551f3_uniq UNIQUE (report_period_id, interval_start); -- -- Name: reporting_ocpusagereportperiod reporting_ocpusagereportperiod_pkey; Type: CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereportperiod ADD CONSTRAINT reporting_ocpusagereportperiod_pkey PRIMARY KEY (id); -- -- Name: aws_compute_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_compute_summary ON reporting_aws_compute_summary USING btree (usage_start, source_uuid, instance_type); -- -- Name: aws_compute_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_compute_summary_account ON reporting_aws_compute_summary_by_account USING btree (usage_start, usage_account_id, account_alias_id, instance_type); -- -- Name: aws_compute_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_compute_summary_region ON reporting_aws_compute_summary_by_region USING btree (usage_start, usage_account_id, region, availability_zone, instance_type); -- -- Name: aws_compute_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_compute_summary_service ON reporting_aws_compute_summary_by_service USING btree (usage_start, usage_account_id, product_code, product_family, instance_type); -- -- Name: aws_cost_entry; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX aws_cost_entry ON reporting_awscostentrylineitem_daily USING gin (tags); -- -- Name: aws_cost_pcode_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX aws_cost_pcode_like ON reporting_awscostentrylineitem_daily USING gin (product_code public.gin_trgm_ops); -- -- Name: aws_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_cost_summary ON reporting_aws_cost_summary USING btree (usage_start, source_uuid); -- -- Name: aws_cost_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_cost_summary_account ON reporting_aws_cost_summary_by_account USING btree (usage_start, usage_account_id); -- -- Name: aws_cost_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_cost_summary_region ON reporting_aws_cost_summary_by_region USING btree (usage_start, usage_account_id, region, availability_zone); -- -- Name: aws_cost_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_cost_summary_service ON reporting_aws_cost_summary_by_service USING btree (usage_start, usage_account_id, product_code, product_family); -- -- Name: aws_database_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_database_summary ON reporting_aws_database_summary USING btree (usage_start, usage_account_id, product_code); -- -- Name: aws_enabled_key_index; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX aws_enabled_key_index ON reporting_awsenabledtagkeys USING btree (key, enabled); -- -- Name: aws_network_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_network_summary ON reporting_aws_network_summary USING btree (usage_start, usage_account_id, product_code); -- -- Name: aws_storage_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_storage_summary ON reporting_aws_storage_summary USING btree (usage_start, source_uuid, product_family); -- -- Name: aws_storage_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_storage_summary_account ON reporting_aws_storage_summary_by_account USING btree (usage_start, usage_account_id, product_family); -- -- Name: aws_storage_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_storage_summary_region ON reporting_aws_storage_summary_by_region USING btree (usage_start, usage_account_id, region, availability_zone, product_family); -- -- Name: aws_storage_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX aws_storage_summary_service ON reporting_aws_storage_summary_by_service USING btree (usage_start, usage_account_id, product_code, product_family); -- -- Name: aws_summ_usage_pcode_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX aws_summ_usage_pcode_ilike ON ONLY reporting_awscostentrylineitem_daily_summary USING gin (upper((product_family)::text) public.gin_trgm_ops); -- -- Name: aws_summ_usage_pfam_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX aws_summ_usage_pfam_ilike ON ONLY reporting_awscostentrylineitem_daily_summary USING gin (upper((product_family)::text) public.gin_trgm_ops); -- -- Name: aws_tags_value_key_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX aws_tags_value_key_idx ON reporting_awstags_values USING btree (key); -- -- Name: azure_compute_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_compute_summary ON reporting_azure_compute_summary USING btree (usage_start, subscription_guid, instance_type); -- -- Name: azure_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_cost_summary ON reporting_azure_cost_summary USING btree (usage_start, source_uuid); -- -- Name: azure_cost_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_cost_summary_account ON reporting_azure_cost_summary_by_account USING btree (usage_start, subscription_guid); -- -- Name: azure_cost_summary_location; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_cost_summary_location ON reporting_azure_cost_summary_by_location USING btree (usage_start, subscription_guid, resource_location); -- -- Name: azure_cost_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_cost_summary_service ON reporting_azure_cost_summary_by_service USING btree (usage_start, subscription_guid, service_name); -- -- Name: azure_database_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_database_summary ON reporting_azure_database_summary USING btree (usage_start, subscription_guid, service_name); -- -- Name: azure_network_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_network_summary ON reporting_azure_network_summary USING btree (usage_start, subscription_guid, service_name); -- -- Name: azure_storage_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX azure_storage_summary ON reporting_azure_storage_summary USING btree (usage_start, subscription_guid, service_name); -- -- Name: azure_tags_value_key_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX azure_tags_value_key_idx ON reporting_azuretags_values USING btree (key); -- -- Name: cost__proj_sum_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost__proj_sum_namespace_idx ON reporting_ocpawscostlineitem_project_daily_summary USING btree (namespace varchar_pattern_ops); -- -- Name: cost__proj_sum_namespace_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost__proj_sum_namespace_like_idx ON reporting_ocpawscostlineitem_project_daily_summary USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: cost__proj_sum_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost__proj_sum_node_like_idx ON reporting_ocpawscostlineitem_project_daily_summary USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: cost_model_map_cost_model_id_3c67db61; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_model_map_cost_model_id_3c67db61 ON cost_model_map USING btree (cost_model_id); -- -- Name: cost_proj_pod_labels_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_proj_pod_labels_idx ON reporting_ocpawscostlineitem_project_daily_summary USING gin (pod_labels); -- -- Name: cost_proj_sum_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_proj_sum_node_idx ON reporting_ocpawscostlineitem_project_daily_summary USING btree (node varchar_pattern_ops); -- -- Name: cost_proj_sum_ocp_usage_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_proj_sum_ocp_usage_idx ON reporting_ocpawscostlineitem_project_daily_summary USING btree (usage_start); -- -- Name: cost_proj_sum_resource_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_proj_sum_resource_idx ON reporting_ocpawscostlineitem_project_daily_summary USING btree (resource_id); -- -- Name: cost_summary_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_summary_namespace_idx ON reporting_ocpawscostlineitem_daily_summary USING btree (namespace); -- -- Name: cost_summary_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_summary_node_idx ON reporting_ocpawscostlineitem_daily_summary USING btree (node varchar_pattern_ops); -- -- Name: cost_summary_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_summary_node_like_idx ON reporting_ocpawscostlineitem_daily_summary USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: cost_summary_ocp_usage_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_summary_ocp_usage_idx ON reporting_ocpawscostlineitem_daily_summary USING btree (usage_start); -- -- Name: cost_summary_resource_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_summary_resource_idx ON reporting_ocpawscostlineitem_daily_summary USING btree (resource_id); -- -- Name: cost_tags_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX cost_tags_idx ON reporting_ocpawscostlineitem_daily_summary USING gin (tags); -- -- Name: gcp_compute_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_compute_summary ON reporting_gcp_compute_summary USING btree (usage_start, source_uuid, instance_type); -- -- Name: gcp_compute_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_compute_summary_account ON reporting_gcp_compute_summary_by_account USING btree (usage_start, instance_type, account_id); -- -- Name: gcp_compute_summary_project; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_compute_summary_project ON reporting_gcp_compute_summary_by_project USING btree (usage_start, instance_type, project_id, project_name, account_id); -- -- Name: gcp_compute_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_compute_summary_region ON reporting_gcp_compute_summary_by_region USING btree (usage_start, instance_type, account_id, region); -- -- Name: gcp_compute_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_compute_summary_service ON reporting_gcp_compute_summary_by_service USING btree (usage_start, instance_type, account_id, service_id, service_alias); -- -- Name: gcp_cost_entry; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX gcp_cost_entry ON reporting_gcpcostentrylineitem_daily USING gin (tags); -- -- Name: gcp_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_cost_summary ON reporting_gcp_cost_summary USING btree (usage_start, source_uuid); -- -- Name: gcp_cost_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_cost_summary_account ON reporting_gcp_cost_summary_by_account USING btree (usage_start, account_id); -- -- Name: gcp_cost_summary_project; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_cost_summary_project ON reporting_gcp_cost_summary_by_project USING btree (usage_start, project_id, project_name, account_id); -- -- Name: gcp_cost_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_cost_summary_region ON reporting_gcp_cost_summary_by_region USING btree (usage_start, account_id, region); -- -- Name: gcp_cost_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_cost_summary_service ON reporting_gcp_cost_summary_by_service USING btree (usage_start, account_id, service_id, service_alias); -- -- Name: gcp_database_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_database_summary ON reporting_gcp_database_summary USING btree (usage_start, account_id, service_id, service_alias); -- -- Name: gcp_network_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_network_summary ON reporting_gcp_network_summary USING btree (usage_start, account_id, service_id, service_alias); -- -- Name: gcp_storage_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_storage_summary ON reporting_gcp_storage_summary USING btree (usage_start, source_uuid); -- -- Name: gcp_storage_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_storage_summary_account ON reporting_gcp_storage_summary_by_account USING btree (usage_start, account_id); -- -- Name: gcp_storage_summary_project; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_storage_summary_project ON reporting_gcp_storage_summary_by_project USING btree (usage_start, project_id, project_name, account_id); -- -- Name: gcp_storage_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_storage_summary_region ON reporting_gcp_storage_summary_by_region USING btree (usage_start, account_id, region); -- -- Name: gcp_storage_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX gcp_storage_summary_service ON reporting_gcp_storage_summary_by_service USING btree (usage_start, account_id, service_id, service_alias); -- -- Name: gcp_tags_value_key_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX gcp_tags_value_key_idx ON reporting_gcptags_values USING btree (key); -- -- Name: gcp_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX gcp_usage_start_idx ON reporting_gcpcostentrylineitem_daily USING btree (usage_start); -- -- Name: interval_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX interval_start_idx ON reporting_awscostentry USING btree (interval_start); -- -- Name: ix_azure_costentrydlysumm_service_name; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ix_azure_costentrydlysumm_service_name ON ONLY reporting_azurecostentrylineitem_daily_summary USING gin (upper(service_name) public.gin_trgm_ops); -- -- Name: ix_ocp_aws_product_code_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ix_ocp_aws_product_code_ilike ON reporting_ocpawscostlineitem_daily_summary USING gin (upper((product_code)::text) public.gin_trgm_ops); -- -- Name: ix_ocp_aws_product_family_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ix_ocp_aws_product_family_ilike ON reporting_ocpawscostlineitem_daily_summary USING gin (upper((product_family)::text) public.gin_trgm_ops); -- -- Name: ix_ocpazure_service_name_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ix_ocpazure_service_name_ilike ON reporting_ocpazurecostlineitem_daily_summary USING gin (upper(service_name) public.gin_trgm_ops); -- -- Name: name_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX name_idx ON cost_model USING btree (name); -- -- Name: namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX namespace_idx ON reporting_ocpusagelineitem_daily USING btree (namespace varchar_pattern_ops); -- -- Name: node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX node_idx ON reporting_ocpusagelineitem_daily USING btree (node varchar_pattern_ops); -- -- Name: ocp_aws_instance_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_aws_instance_type_idx ON reporting_ocpawscostlineitem_daily_summary USING btree (instance_type); -- -- Name: ocp_aws_product_family_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_aws_product_family_idx ON reporting_ocpawscostlineitem_daily_summary USING btree (product_family); -- -- Name: ocp_aws_proj_inst_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_aws_proj_inst_type_idx ON reporting_ocpawscostlineitem_project_daily_summary USING btree (instance_type); -- -- Name: ocp_aws_proj_prod_fam_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_aws_proj_prod_fam_idx ON reporting_ocpawscostlineitem_project_daily_summary USING btree (product_family); -- -- Name: ocp_aws_tags_value_key_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_aws_tags_value_key_idx ON reporting_ocpawstags_values USING btree (key); -- -- Name: ocp_azure_tags_value_key_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_azure_tags_value_key_idx ON reporting_ocpazuretags_values USING btree (key); -- -- Name: ocp_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_cost_summary ON reporting_ocp_cost_summary USING btree (usage_start, cluster_id, cluster_alias, source_uuid); -- -- Name: ocp_cost_summary_by_node; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_cost_summary_by_node ON reporting_ocp_cost_summary_by_node USING btree (usage_start, cluster_id, cluster_alias, node, source_uuid); -- -- Name: ocp_cost_summary_by_project; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_cost_summary_by_project ON reporting_ocp_cost_summary_by_project USING btree (usage_start, cluster_id, cluster_alias, namespace, source_uuid); -- -- Name: ocp_interval_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_interval_start_idx ON reporting_ocpusagereport USING btree (interval_start); -- -- Name: ocp_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_namespace_idx ON reporting_ocpusagelineitem_daily USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: ocp_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_node_idx ON reporting_ocpusagelineitem_daily USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: ocp_pod_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_pod_summary ON reporting_ocp_pod_summary USING btree (usage_start, cluster_id, cluster_alias, source_uuid); -- -- Name: ocp_pod_summary_by_project; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_pod_summary_by_project ON reporting_ocp_pod_summary_by_project USING btree (usage_start, cluster_id, cluster_alias, namespace, source_uuid); -- -- Name: ocp_storage_li_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_storage_li_namespace_idx ON reporting_ocpstoragelineitem_daily USING btree (namespace varchar_pattern_ops); -- -- Name: ocp_storage_li_namespace_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_storage_li_namespace_like_idx ON reporting_ocpstoragelineitem_daily USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: ocp_storage_li_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_storage_li_node_idx ON reporting_ocpstoragelineitem_daily USING btree (node varchar_pattern_ops); -- -- Name: ocp_storage_li_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_storage_li_node_like_idx ON reporting_ocpstoragelineitem_daily USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: ocp_summary_namespace_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_summary_namespace_like_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: ocp_summary_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_summary_node_like_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: ocp_usage_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocp_usage_idx ON reporting_ocpusagelineitem_daily USING btree (usage_start); -- -- Name: ocp_volume_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_volume_summary ON reporting_ocp_volume_summary USING btree (usage_start, cluster_id, cluster_alias, source_uuid); -- -- Name: ocp_volume_summary_by_project; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocp_volume_summary_by_project ON reporting_ocp_volume_summary_by_project USING btree (usage_start, cluster_id, cluster_alias, namespace, source_uuid); -- -- Name: ocpall_compute_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_compute_summary ON reporting_ocpall_compute_summary USING btree (usage_start, cluster_id, usage_account_id, product_code, instance_type, resource_id); -- -- Name: ocpall_cost_daily_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_cost_daily_summary ON reporting_ocpallcostlineitem_daily_summary (source_type, cluster_id, node, resource_id, usage_start, usage_account_id, product_code, product_family, instance_type, region, availability_zone, tags, project_costs); -- -- Name: ocpall_cost_project_daily_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_cost_project_daily_summary ON reporting_ocpallcostlineitem_project_daily_summary USING btree (source_type, usage_start, cluster_id, data_source, namespace, node, usage_account_id, resource_id, product_code, product_family, instance_type, region, availability_zone, pod_labels); -- -- Name: ocpall_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_cost_summary ON reporting_ocpall_cost_summary USING btree (usage_start, cluster_id, source_uuid); -- -- Name: ocpall_cost_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_cost_summary_account ON reporting_ocpall_cost_summary_by_account USING btree (usage_start, cluster_id, usage_account_id); -- -- Name: ocpall_cost_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_cost_summary_region ON reporting_ocpall_cost_summary_by_region USING btree (usage_start, cluster_id, usage_account_id, region, availability_zone); -- -- Name: ocpall_cost_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_cost_summary_service ON reporting_ocpall_cost_summary_by_service USING btree (usage_start, cluster_id, usage_account_id, product_code, product_family); -- -- Name: ocpall_database_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_database_summary ON reporting_ocpall_database_summary USING btree (usage_start, cluster_id, usage_account_id, product_code); -- -- Name: ocpall_network_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_network_summary ON reporting_ocpall_network_summary USING btree (usage_start, cluster_id, usage_account_id, product_code); -- -- Name: ocpall_product_code_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpall_product_code_ilike ON reporting_ocpallcostlineitem_daily_summary USING gin (upper((product_code)::text) public.gin_trgm_ops); -- -- Name: ocpall_product_family_ilike; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpall_product_family_ilike ON reporting_ocpallcostlineitem_daily_summary USING gin (upper((product_family)::text) public.gin_trgm_ops); -- -- Name: ocpall_storage_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpall_storage_summary ON reporting_ocpall_storage_summary USING btree (usage_start, cluster_id, usage_account_id, product_family, product_code); -- -- Name: ocpallcstdlysumm_node; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstdlysumm_node ON reporting_ocpallcostlineitem_daily_summary USING btree (node text_pattern_ops); -- -- Name: ocpallcstdlysumm_node_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstdlysumm_node_like ON reporting_ocpallcostlineitem_daily_summary USING gin (node public.gin_trgm_ops); -- -- Name: ocpallcstdlysumm_nsp; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstdlysumm_nsp ON reporting_ocpallcostlineitem_daily_summary USING gin (namespace); -- -- Name: ocpallcstprjdlysumm_node; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstprjdlysumm_node ON reporting_ocpallcostlineitem_project_daily_summary USING btree (node text_pattern_ops); -- -- Name: ocpallcstprjdlysumm_node_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstprjdlysumm_node_like ON reporting_ocpallcostlineitem_project_daily_summary USING gin (node public.gin_trgm_ops); -- -- Name: ocpallcstprjdlysumm_nsp; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstprjdlysumm_nsp ON reporting_ocpallcostlineitem_project_daily_summary USING btree (namespace text_pattern_ops); -- -- Name: ocpallcstprjdlysumm_nsp_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpallcstprjdlysumm_nsp_like ON reporting_ocpallcostlineitem_project_daily_summary USING gin (namespace public.gin_trgm_ops); -- -- Name: ocpaws_compute_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_compute_summary ON reporting_ocpaws_compute_summary USING btree (usage_start, cluster_id, usage_account_id, instance_type, resource_id); -- -- Name: ocpaws_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_cost_summary ON reporting_ocpaws_cost_summary USING btree (usage_start, cluster_id); -- -- Name: ocpaws_cost_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_cost_summary_account ON reporting_ocpaws_cost_summary_by_account USING btree (usage_start, cluster_id, usage_account_id); -- -- Name: ocpaws_cost_summary_region; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_cost_summary_region ON reporting_ocpaws_cost_summary_by_region USING btree (usage_start, cluster_id, usage_account_id, region, availability_zone); -- -- Name: ocpaws_cost_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_cost_summary_service ON reporting_ocpaws_cost_summary_by_service USING btree (usage_start, cluster_id, usage_account_id, product_code, product_family); -- -- Name: ocpaws_database_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_database_summary ON reporting_ocpaws_database_summary USING btree (usage_start, cluster_id, usage_account_id, product_code); -- -- Name: ocpaws_network_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_network_summary ON reporting_ocpaws_network_summary USING btree (usage_start, cluster_id, usage_account_id, product_code); -- -- Name: ocpaws_storage_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpaws_storage_summary ON reporting_ocpaws_storage_summary USING btree (usage_start, cluster_id, usage_account_id, product_family); -- -- Name: ocpazure_compute_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_compute_summary ON reporting_ocpazure_compute_summary USING btree (usage_start, cluster_id, subscription_guid, instance_type, resource_id); -- -- Name: ocpazure_cost_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_cost_summary ON reporting_ocpazure_cost_summary USING btree (usage_start, cluster_id, cluster_alias, source_uuid); -- -- Name: ocpazure_cost_summary_account; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_cost_summary_account ON reporting_ocpazure_cost_summary_by_account USING btree (usage_start, cluster_id, subscription_guid); -- -- Name: ocpazure_cost_summary_location; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_cost_summary_location ON reporting_ocpazure_cost_summary_by_location USING btree (usage_start, cluster_id, subscription_guid, resource_location); -- -- Name: ocpazure_cost_summary_service; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_cost_summary_service ON reporting_ocpazure_cost_summary_by_service USING btree (usage_start, cluster_id, subscription_guid, service_name); -- -- Name: ocpazure_database_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_database_summary ON reporting_ocpazure_database_summary USING btree (usage_start, cluster_id, subscription_guid, service_name); -- -- Name: ocpazure_instance_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_instance_type_idx ON reporting_ocpazurecostlineitem_daily_summary USING btree (instance_type); -- -- Name: ocpazure_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_namespace_idx ON reporting_ocpazurecostlineitem_daily_summary USING btree (namespace); -- -- Name: ocpazure_network_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_network_summary ON reporting_ocpazure_network_summary USING btree (usage_start, cluster_id, subscription_guid, service_name); -- -- Name: ocpazure_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_node_idx ON reporting_ocpazurecostlineitem_daily_summary USING btree (node varchar_pattern_ops); -- -- Name: ocpazure_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_node_like_idx ON reporting_ocpazurecostlineitem_daily_summary USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: ocpazure_proj_inst_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_inst_type_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (instance_type); -- -- Name: ocpazure_proj_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_namespace_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (namespace varchar_pattern_ops); -- -- Name: ocpazure_proj_namespace_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_namespace_like_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: ocpazure_proj_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_node_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (node varchar_pattern_ops); -- -- Name: ocpazure_proj_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_node_like_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: ocpazure_proj_pod_labels_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_pod_labels_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING gin (pod_labels); -- -- Name: ocpazure_proj_resource_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_resource_id_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (resource_id); -- -- Name: ocpazure_proj_service_name_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_service_name_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (service_name); -- -- Name: ocpazure_proj_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_proj_usage_start_idx ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (usage_start); -- -- Name: ocpazure_resource_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_resource_idx ON reporting_ocpazurecostlineitem_daily_summary USING btree (resource_id); -- -- Name: ocpazure_service_name_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_service_name_idx ON reporting_ocpazurecostlineitem_daily_summary USING btree (service_name); -- -- Name: ocpazure_storage_summary; Type: INDEX; Schema: ; Owner: - -- CREATE UNIQUE INDEX ocpazure_storage_summary ON reporting_ocpazure_storage_summary USING btree (usage_start, cluster_id, subscription_guid, service_name); -- -- Name: ocpazure_tags_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_tags_idx ON reporting_ocpazurecostlineitem_daily_summary USING gin (tags); -- -- Name: ocpazure_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpazure_usage_start_idx ON reporting_ocpazurecostlineitem_daily_summary USING btree (usage_start); -- -- Name: ocpcostsum_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpcostsum_namespace_idx ON reporting_ocpcosts_summary USING btree (namespace varchar_pattern_ops); -- -- Name: ocpcostsum_namespace_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpcostsum_namespace_like_idx ON reporting_ocpcosts_summary USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: ocpcostsum_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpcostsum_node_idx ON reporting_ocpcosts_summary USING btree (node varchar_pattern_ops); -- -- Name: ocpcostsum_node_like_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpcostsum_node_like_idx ON reporting_ocpcosts_summary USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: ocpcostsum_pod_labels_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpcostsum_pod_labels_idx ON reporting_ocpcosts_summary USING gin (pod_labels); -- -- Name: ocpcostsum_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocpcostsum_usage_start_idx ON reporting_ocpcosts_summary USING btree (usage_start); -- -- Name: ocplblnitdly_node_labels; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocplblnitdly_node_labels ON reporting_ocpnodelabellineitem_daily USING gin (node_labels); -- -- Name: ocplblnitdly_usage_start; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX ocplblnitdly_usage_start ON reporting_ocpnodelabellineitem_daily USING btree (usage_start); -- -- Name: openshift_tags_value_key_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX openshift_tags_value_key_idx ON reporting_ocptags_values USING btree (key); -- -- Name: p_gcp_summary_instance_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_summary_instance_type_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (instance_type); -- -- Name: p_gcp_summary_project_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_summary_project_id_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (project_id); -- -- Name: p_gcp_summary_project_name_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_summary_project_name_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (project_name); -- -- Name: p_gcp_summary_service_alias_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_summary_service_alias_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (service_alias); -- -- Name: p_gcp_summary_service_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_summary_service_id_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (service_id); -- -- Name: p_gcp_summary_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_summary_usage_start_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (usage_start); -- -- Name: p_gcp_tags_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_gcp_tags_idx ON ONLY reporting_gcpcostentrylineitem_daily_summary USING gin (tags); -- -- Name: p_ix_azurecstentrydlysumm_start; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_ix_azurecstentrydlysumm_start ON ONLY reporting_azurecostentrylineitem_daily_summary USING btree (usage_start); -- -- Name: p_pod_labels_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_pod_labels_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING gin (pod_labels); -- -- Name: p_reporting_gcpcostentryline_cost_entry_bill_id_bf00a16b; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_reporting_gcpcostentryline_cost_entry_bill_id_bf00a16b ON ONLY reporting_gcpcostentrylineitem_daily_summary USING btree (cost_entry_bill_id); -- -- Name: p_summary_account_alias_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_account_alias_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (account_alias_id); -- -- Name: p_summary_data_source_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_data_source_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING btree (data_source); -- -- Name: p_summary_instance_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_instance_type_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (instance_type); -- -- Name: p_summary_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_namespace_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING btree (namespace varchar_pattern_ops); -- -- Name: p_summary_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_node_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING btree (node varchar_pattern_ops); -- -- Name: p_summary_ocp_usage_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_ocp_usage_idx ON ONLY reporting_ocpusagelineitem_daily_summary USING btree (usage_start); -- -- Name: p_summary_product_code_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_product_code_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (product_code); -- -- Name: p_summary_product_family_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_product_family_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (product_family); -- -- Name: p_summary_usage_account_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_usage_account_id_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (usage_account_id); -- -- Name: p_summary_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_summary_usage_start_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (usage_start); -- -- Name: p_tags_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX p_tags_idx ON ONLY reporting_awscostentrylineitem_daily_summary USING gin (tags); -- -- Name: partable_partition_parameters; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX partable_partition_parameters ON partitioned_tables USING gin (partition_parameters); -- -- Name: partable_partition_type; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX partable_partition_type ON partitioned_tables USING btree (partition_type); -- -- Name: partable_table; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX partable_table ON partitioned_tables USING btree (schema_name, table_name); -- -- Name: pod_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX pod_idx ON reporting_ocpusagelineitem_daily USING btree (pod); -- -- Name: presto_pk_delete_wrapper_log_tx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX presto_pk_delete_wrapper_log_tx ON presto_pk_delete_wrapper_log USING btree (transaction_id, table_name); -- -- Name: product_code_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX product_code_idx ON reporting_awscostentrylineitem_daily USING btree (product_code); -- -- Name: region_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX region_idx ON reporting_awscostentryproduct USING btree (region); -- -- Name: reporting_awsaccountalias_account_id_85724b8c_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awsaccountalias_account_id_85724b8c_like ON reporting_awsaccountalias USING btree (account_id varchar_pattern_ops); -- -- Name: reporting_awscostentry_bill_id_017f27a3; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentry_bill_id_017f27a3 ON reporting_awscostentry USING btree (bill_id); -- -- Name: reporting_awscostentrybill_provider_id_a08725b3; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrybill_provider_id_a08725b3 ON reporting_awscostentrybill USING btree (provider_id); -- -- Name: reporting_awscostentryline_account_alias_id_684d6c01; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_account_alias_id_684d6c01 ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (account_alias_id); -- -- Name: reporting_awscostentryline_cost_entry_bill_id_54ece653; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_cost_entry_bill_id_54ece653 ON reporting_awscostentrylineitem_daily USING btree (cost_entry_bill_id); -- -- Name: reporting_awscostentryline_cost_entry_bill_id_d7af1eb6; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_cost_entry_bill_id_d7af1eb6 ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_awscostentryline_cost_entry_pricing_id_5a6a9b38; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_cost_entry_pricing_id_5a6a9b38 ON reporting_awscostentrylineitem_daily USING btree (cost_entry_pricing_id); -- -- Name: reporting_awscostentryline_cost_entry_product_id_4d8ef2fd; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_cost_entry_product_id_4d8ef2fd ON reporting_awscostentrylineitem_daily USING btree (cost_entry_product_id); -- -- Name: reporting_awscostentryline_cost_entry_reservation_id_13b1cb08; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_cost_entry_reservation_id_13b1cb08 ON reporting_awscostentrylineitem_daily USING btree (cost_entry_reservation_id); -- -- Name: reporting_awscostentryline_cost_entry_reservation_id_9332b371; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_cost_entry_reservation_id_9332b371 ON reporting_awscostentrylineitem USING btree (cost_entry_reservation_id); -- -- Name: reporting_awscostentryline_organizational_unit_id_01926b46; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryline_organizational_unit_id_01926b46 ON ONLY reporting_awscostentrylineitem_daily_summary USING btree (organizational_unit_id); -- -- Name: reporting_awscostentrylineitem_cost_entry_bill_id_5ae74e09; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_cost_entry_bill_id_5ae74e09 ON reporting_awscostentrylineitem USING btree (cost_entry_bill_id); -- -- Name: reporting_awscostentrylineitem_cost_entry_id_4d1a7fc4; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_cost_entry_id_4d1a7fc4 ON reporting_awscostentrylineitem USING btree (cost_entry_id); -- -- Name: reporting_awscostentrylineitem_cost_entry_pricing_id_a654a7e3; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_cost_entry_pricing_id_a654a7e3 ON reporting_awscostentrylineitem USING btree (cost_entry_pricing_id); -- -- Name: reporting_awscostentrylineitem_cost_entry_product_id_29c80210; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_cost_entry_product_id_29c80210 ON reporting_awscostentrylineitem USING btree (cost_entry_product_id); -- -- Name: reporting_awscostentrylineitem_daily_organizational_unit_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_organizational_unit_id_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (organizational_unit_id); -- -- Name: reporting_awscostentrylineitem_daily_sum_cost_entry_bill_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_sum_cost_entry_bill_id_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (cost_entry_bill_id); -- -- Name: reporting_awscostentrylineitem_daily_summ_account_alias_id_idx1; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summ_account_alias_id_idx1 ON reporting_awscostentrylineitem_daily_summary_default USING btree (account_alias_id); -- -- Name: reporting_awscostentrylineitem_daily_summa_account_alias_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summa_account_alias_id_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (account_alias_id); -- -- Name: reporting_awscostentrylineitem_daily_summa_usage_account_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summa_usage_account_id_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (usage_account_id); -- -- Name: reporting_awscostentrylineitem_daily_summary__instance_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary__instance_type_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (instance_type); -- -- Name: reporting_awscostentrylineitem_daily_summary_d_product_code_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary_d_product_code_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (product_code); -- -- Name: reporting_awscostentrylineitem_daily_summary_de_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary_de_usage_start_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (usage_start); -- -- Name: reporting_awscostentrylineitem_daily_summary_default_tags_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary_default_tags_idx ON reporting_awscostentrylineitem_daily_summary_default USING gin (tags); -- -- Name: reporting_awscostentrylineitem_daily_summary_default_upper_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary_default_upper_idx ON reporting_awscostentrylineitem_daily_summary_default USING gin (upper((product_family)::text) public.gin_trgm_ops); -- -- Name: reporting_awscostentrylineitem_daily_summary_default_upper_idx1; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary_default_upper_idx1 ON reporting_awscostentrylineitem_daily_summary_default USING gin (upper((product_family)::text) public.gin_trgm_ops); -- -- Name: reporting_awscostentrylineitem_daily_summary_product_family_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentrylineitem_daily_summary_product_family_idx ON reporting_awscostentrylineitem_daily_summary_default USING btree (product_family); -- -- Name: reporting_awscostentryreservation_reservation_arn_e387aa5b_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awscostentryreservation_reservation_arn_e387aa5b_like ON reporting_awscostentryreservation USING btree (reservation_arn text_pattern_ops); -- -- Name: reporting_awsenabledtagkeys_key_8c2841c2_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awsenabledtagkeys_key_8c2841c2_like ON reporting_awsenabledtagkeys USING btree (key varchar_pattern_ops); -- -- Name: reporting_awsorganizationalunit_account_alias_id_7bd6273b; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awsorganizationalunit_account_alias_id_7bd6273b ON reporting_awsorganizationalunit USING btree (account_alias_id); -- -- Name: reporting_awsorganizationalunit_provider_id_6e91f0ae; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awsorganizationalunit_provider_id_6e91f0ae ON reporting_awsorganizationalunit USING btree (provider_id); -- -- Name: reporting_awstags_summary_account_alias_id_8a49f381; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awstags_summary_account_alias_id_8a49f381 ON reporting_awstags_summary USING btree (account_alias_id); -- -- Name: reporting_awstags_summary_cost_entry_bill_id_c9c45ad6; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_awstags_summary_cost_entry_bill_id_c9c45ad6 ON reporting_awstags_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_azurecostentrybill_provider_id_5b7738d5; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentrybill_provider_id_5b7738d5 ON reporting_azurecostentrybill USING btree (provider_id); -- -- Name: reporting_azurecostentryli_cost_entry_bill_id_7898bce4; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentryli_cost_entry_bill_id_7898bce4 ON reporting_azurecostentrylineitem_daily USING btree (cost_entry_bill_id); -- -- Name: reporting_azurecostentryli_cost_entry_bill_id_e7c3e625; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentryli_cost_entry_bill_id_e7c3e625 ON ONLY reporting_azurecostentrylineitem_daily_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_azurecostentryli_cost_entry_product_id_b84c188a; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentryli_cost_entry_product_id_b84c188a ON reporting_azurecostentrylineitem_daily USING btree (cost_entry_product_id); -- -- Name: reporting_azurecostentryli_meter_id_799dc028; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentryli_meter_id_799dc028 ON ONLY reporting_azurecostentrylineitem_daily_summary USING btree (meter_id); -- -- Name: reporting_azurecostentrylineitem_daily_meter_id_292c06f8; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentrylineitem_daily_meter_id_292c06f8 ON reporting_azurecostentrylineitem_daily USING btree (meter_id); -- -- Name: reporting_azurecostentrylineitem_daily_s_cost_entry_bill_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentrylineitem_daily_s_cost_entry_bill_id_idx ON reporting_azurecostentrylineitem_daily_summary_default USING btree (cost_entry_bill_id); -- -- Name: reporting_azurecostentrylineitem_daily_summary__usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentrylineitem_daily_summary__usage_start_idx ON reporting_azurecostentrylineitem_daily_summary_default USING btree (usage_start); -- -- Name: reporting_azurecostentrylineitem_daily_summary_def_meter_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentrylineitem_daily_summary_def_meter_id_idx ON reporting_azurecostentrylineitem_daily_summary_default USING btree (meter_id); -- -- Name: reporting_azurecostentrylineitem_daily_summary_defaul_upper_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentrylineitem_daily_summary_defaul_upper_idx ON reporting_azurecostentrylineitem_daily_summary_default USING gin (upper(service_name) public.gin_trgm_ops); -- -- Name: reporting_azurecostentryproductservice_provider_id_2072db59; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azurecostentryproductservice_provider_id_2072db59 ON reporting_azurecostentryproductservice USING btree (provider_id); -- -- Name: reporting_azureenabledtagkeys_key_a00bc136_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azureenabledtagkeys_key_a00bc136_like ON reporting_azureenabledtagkeys USING btree (key varchar_pattern_ops); -- -- Name: reporting_azuremeter_provider_id_d6bb7273; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azuremeter_provider_id_d6bb7273 ON reporting_azuremeter USING btree (provider_id); -- -- Name: reporting_azuretags_summary_cost_entry_bill_id_cb69e67a; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_azuretags_summary_cost_entry_bill_id_cb69e67a ON reporting_azuretags_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_gcpcostentrybill_provider_id_4da1742f; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrybill_provider_id_4da1742f ON reporting_gcpcostentrybill USING btree (provider_id); -- -- Name: reporting_gcpcostentryline_cost_entry_bill_id_a3272999; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentryline_cost_entry_bill_id_a3272999 ON reporting_gcpcostentrylineitem_daily USING btree (cost_entry_bill_id); -- -- Name: reporting_gcpcostentryline_cost_entry_product_id_bce5f583; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentryline_cost_entry_product_id_bce5f583 ON reporting_gcpcostentrylineitem_daily USING btree (cost_entry_product_id); -- -- Name: reporting_gcpcostentrylineitem_cost_entry_bill_id_7a8f16fd; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_cost_entry_bill_id_7a8f16fd ON reporting_gcpcostentrylineitem USING btree (cost_entry_bill_id); -- -- Name: reporting_gcpcostentrylineitem_cost_entry_product_id_cec870b8; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_cost_entry_product_id_cec870b8 ON reporting_gcpcostentrylineitem USING btree (cost_entry_product_id); -- -- Name: reporting_gcpcostentrylineitem_daily_project_id_18365d99; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_project_id_18365d99 ON reporting_gcpcostentrylineitem_daily USING btree (project_id); -- -- Name: reporting_gcpcostentrylineitem_daily_sum_cost_entry_bill_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_sum_cost_entry_bill_id_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (cost_entry_bill_id); -- -- Name: reporting_gcpcostentrylineitem_daily_summary__instance_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary__instance_type_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (instance_type); -- -- Name: reporting_gcpcostentrylineitem_daily_summary__service_alias_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary__service_alias_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (service_alias); -- -- Name: reporting_gcpcostentrylineitem_daily_summary_d_project_name_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary_d_project_name_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (project_name); -- -- Name: reporting_gcpcostentrylineitem_daily_summary_de_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary_de_usage_start_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (usage_start); -- -- Name: reporting_gcpcostentrylineitem_daily_summary_def_project_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary_def_project_id_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (project_id); -- -- Name: reporting_gcpcostentrylineitem_daily_summary_def_service_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary_def_service_id_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING btree (service_id); -- -- Name: reporting_gcpcostentrylineitem_daily_summary_default_tags_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_daily_summary_default_tags_idx ON reporting_gcpcostentrylineitem_daily_summary_default USING gin (tags); -- -- Name: reporting_gcpcostentrylineitem_project_id_bf066e6e; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpcostentrylineitem_project_id_bf066e6e ON reporting_gcpcostentrylineitem USING btree (project_id); -- -- Name: reporting_gcpenabledtagkeys_key_0e50e656_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpenabledtagkeys_key_0e50e656_like ON reporting_gcpenabledtagkeys USING btree (key varchar_pattern_ops); -- -- Name: reporting_gcpproject_project_id_77600c9d_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcpproject_project_id_77600c9d_like ON reporting_gcpproject USING btree (project_id varchar_pattern_ops); -- -- Name: reporting_gcptags_summary_cost_entry_bill_id_e442ff66; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_gcptags_summary_cost_entry_bill_id_e442ff66 ON reporting_gcptags_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpawscostlineit_account_alias_id_d12902c6; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawscostlineit_account_alias_id_d12902c6 ON reporting_ocpawscostlineitem_project_daily_summary USING btree (account_alias_id); -- -- Name: reporting_ocpawscostlineit_account_alias_id_f19d2883; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawscostlineit_account_alias_id_f19d2883 ON reporting_ocpawscostlineitem_daily_summary USING btree (account_alias_id); -- -- Name: reporting_ocpawscostlineit_cost_entry_bill_id_2740da80; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawscostlineit_cost_entry_bill_id_2740da80 ON reporting_ocpawscostlineitem_project_daily_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpawscostlineit_cost_entry_bill_id_2a473151; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawscostlineit_cost_entry_bill_id_2a473151 ON reporting_ocpawscostlineitem_daily_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpawscostlineit_report_period_id_150c5620; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawscostlineit_report_period_id_150c5620 ON reporting_ocpawscostlineitem_daily_summary USING btree (report_period_id); -- -- Name: reporting_ocpawscostlineit_report_period_id_3f8d2da5; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawscostlineit_report_period_id_3f8d2da5 ON reporting_ocpawscostlineitem_project_daily_summary USING btree (report_period_id); -- -- Name: reporting_ocpawstags_summary_account_alias_id_f3d8c2e0; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawstags_summary_account_alias_id_f3d8c2e0 ON reporting_ocpawstags_summary USING btree (account_alias_id); -- -- Name: reporting_ocpawstags_summary_cost_entry_bill_id_9fe9ad45; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawstags_summary_cost_entry_bill_id_9fe9ad45 ON reporting_ocpawstags_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpawstags_summary_report_period_id_54cc3cc4; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpawstags_summary_report_period_id_54cc3cc4 ON reporting_ocpawstags_summary USING btree (report_period_id); -- -- Name: reporting_ocpazurecostline_cost_entry_bill_id_442560ac; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpazurecostline_cost_entry_bill_id_442560ac ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpazurecostline_cost_entry_bill_id_b12d05bd; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpazurecostline_cost_entry_bill_id_b12d05bd ON reporting_ocpazurecostlineitem_daily_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpazurecostline_report_period_id_145b540e; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpazurecostline_report_period_id_145b540e ON reporting_ocpazurecostlineitem_project_daily_summary USING btree (report_period_id); -- -- Name: reporting_ocpazurecostline_report_period_id_e5bbf81f; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpazurecostline_report_period_id_e5bbf81f ON reporting_ocpazurecostlineitem_daily_summary USING btree (report_period_id); -- -- Name: reporting_ocpazuretags_summary_cost_entry_bill_id_c84d2dc3; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpazuretags_summary_cost_entry_bill_id_c84d2dc3 ON reporting_ocpazuretags_summary USING btree (cost_entry_bill_id); -- -- Name: reporting_ocpazuretags_summary_report_period_id_19a6abdb; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpazuretags_summary_report_period_id_19a6abdb ON reporting_ocpazuretags_summary USING btree (report_period_id); -- -- Name: reporting_ocpcosts_summary_report_period_id_e53cdbb2; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpcosts_summary_report_period_id_e53cdbb2 ON reporting_ocpcosts_summary USING btree (report_period_id); -- -- Name: reporting_ocpenabledtagkeys_key_c3a4025b_like; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpenabledtagkeys_key_c3a4025b_like ON reporting_ocpenabledtagkeys USING btree (key varchar_pattern_ops); -- -- Name: reporting_ocpnamespacelabellineitem_report_id_16489a95; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpnamespacelabellineitem_report_id_16489a95 ON reporting_ocpnamespacelabellineitem USING btree (report_id); -- -- Name: reporting_ocpnamespacelabellineitem_report_period_id_704a722f; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpnamespacelabellineitem_report_period_id_704a722f ON reporting_ocpnamespacelabellineitem USING btree (report_period_id); -- -- Name: reporting_ocpnodelabellineitem_daily_report_period_id_de6c8f1f; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpnodelabellineitem_daily_report_period_id_de6c8f1f ON reporting_ocpnodelabellineitem_daily USING btree (report_period_id); -- -- Name: reporting_ocpnodelabellineitem_report_id_5e2f992a; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpnodelabellineitem_report_id_5e2f992a ON reporting_ocpnodelabellineitem USING btree (report_id); -- -- Name: reporting_ocpnodelabellineitem_report_period_id_d3fcf22e; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpnodelabellineitem_report_period_id_d3fcf22e ON reporting_ocpnodelabellineitem USING btree (report_period_id); -- -- Name: reporting_ocpstoragelineitem_daily_report_period_id_ad325037; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpstoragelineitem_daily_report_period_id_ad325037 ON reporting_ocpstoragelineitem_daily USING btree (report_period_id); -- -- Name: reporting_ocpstoragelineitem_report_id_6ff71ea6; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpstoragelineitem_report_id_6ff71ea6 ON reporting_ocpstoragelineitem USING btree (report_id); -- -- Name: reporting_ocpstoragelineitem_report_period_id_6d730b12; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpstoragelineitem_report_period_id_6d730b12 ON reporting_ocpstoragelineitem USING btree (report_period_id); -- -- Name: reporting_ocpstoragevolume_report_period_id_53b5a3b8; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpstoragevolume_report_period_id_53b5a3b8 ON reporting_ocpstoragevolumelabel_summary USING btree (report_period_id); -- -- Name: reporting_ocpusagelineitem_daily_report_period_id_d5388c41; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_report_period_id_d5388c41 ON reporting_ocpusagelineitem_daily USING btree (report_period_id); -- -- Name: reporting_ocpusagelineitem_report_period_id_fc68baea; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_report_period_id_fc68baea ON ONLY reporting_ocpusagelineitem_daily_summary USING btree (report_period_id); -- -- Name: reporting_ocpusagelineitem_daily_summary_d_report_period_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_d_report_period_id_idx ON reporting_ocpusagelineitem_daily_summary_default USING btree (report_period_id); -- -- Name: reporting_ocpusagelineitem_daily_summary_defaul_data_source_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_defaul_data_source_idx ON reporting_ocpusagelineitem_daily_summary_default USING btree (data_source); -- -- Name: reporting_ocpusagelineitem_daily_summary_defaul_usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_defaul_usage_start_idx ON reporting_ocpusagelineitem_daily_summary_default USING btree (usage_start); -- -- Name: reporting_ocpusagelineitem_daily_summary_default_namespace_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_default_namespace_idx ON reporting_ocpusagelineitem_daily_summary_default USING btree (namespace varchar_pattern_ops); -- -- Name: reporting_ocpusagelineitem_daily_summary_default_node_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_default_node_idx ON reporting_ocpusagelineitem_daily_summary_default USING btree (node varchar_pattern_ops); -- -- Name: reporting_ocpusagelineitem_daily_summary_default_pod_labels_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_default_pod_labels_idx ON reporting_ocpusagelineitem_daily_summary_default USING gin (pod_labels); -- -- Name: reporting_ocpusagelineitem_daily_summary_default_upper_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_default_upper_idx ON reporting_ocpusagelineitem_daily_summary_default USING gin (upper((namespace)::text) public.gin_trgm_ops); -- -- Name: reporting_ocpusagelineitem_daily_summary_default_upper_idx1; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_daily_summary_default_upper_idx1 ON reporting_ocpusagelineitem_daily_summary_default USING gin (upper((node)::text) public.gin_trgm_ops); -- -- Name: reporting_ocpusagelineitem_report_id_32a973b0; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_report_id_32a973b0 ON reporting_ocpusagelineitem USING btree (report_id); -- -- Name: reporting_ocpusagelineitem_report_period_id_be7fa5ad; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagelineitem_report_period_id_be7fa5ad ON reporting_ocpusagelineitem USING btree (report_period_id); -- -- Name: reporting_ocpusagepodlabel_summary_report_period_id_fa250ee5; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagepodlabel_summary_report_period_id_fa250ee5 ON reporting_ocpusagepodlabel_summary USING btree (report_period_id); -- -- Name: reporting_ocpusagereport_report_period_id_477508c6; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagereport_report_period_id_477508c6 ON reporting_ocpusagereport USING btree (report_period_id); -- -- Name: reporting_ocpusagereportperiod_provider_id_7348fe66; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX reporting_ocpusagereportperiod_provider_id_7348fe66 ON reporting_ocpusagereportperiod USING btree (provider_id); -- -- Name: resource_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX resource_id_idx ON reporting_awscostentrylineitem_daily USING btree (resource_id); -- -- Name: source_type_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX source_type_idx ON cost_model USING btree (source_type); -- -- Name: updated_timestamp_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX updated_timestamp_idx ON cost_model USING btree (updated_timestamp); -- -- Name: usage_account_id_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX usage_account_id_idx ON reporting_awscostentrylineitem_daily USING btree (usage_account_id); -- -- Name: usage_start_idx; Type: INDEX; Schema: ; Owner: - -- CREATE INDEX usage_start_idx ON reporting_awscostentrylineitem_daily USING btree (usage_start); -- -- Name: reporting_awscostentrylineitem_daily_organizational_unit_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_awscostentryline_organizational_unit_id_01926b46 ATTACH PARTITION reporting_awscostentrylineitem_daily_organizational_unit_id_idx; -- -- Name: reporting_awscostentrylineitem_daily_sum_cost_entry_bill_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_awscostentryline_cost_entry_bill_id_d7af1eb6 ATTACH PARTITION reporting_awscostentrylineitem_daily_sum_cost_entry_bill_id_idx; -- -- Name: reporting_awscostentrylineitem_daily_summ_account_alias_id_idx1; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_awscostentryline_account_alias_id_684d6c01 ATTACH PARTITION reporting_awscostentrylineitem_daily_summ_account_alias_id_idx1; -- -- Name: reporting_awscostentrylineitem_daily_summa_account_alias_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_account_alias_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summa_account_alias_id_idx; -- -- Name: reporting_awscostentrylineitem_daily_summa_usage_account_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_usage_account_id_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summa_usage_account_id_idx; -- -- Name: reporting_awscostentrylineitem_daily_summary__instance_type_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_instance_type_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summary__instance_type_idx; -- -- Name: reporting_awscostentrylineitem_daily_summary_d_product_code_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_product_code_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_d_product_code_idx; -- -- Name: reporting_awscostentrylineitem_daily_summary_de_usage_start_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_usage_start_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_de_usage_start_idx; -- -- Name: reporting_awscostentrylineitem_daily_summary_default_pkey; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_awscostentrylineitem_daily_summary_pkey ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_default_pkey; -- -- Name: reporting_awscostentrylineitem_daily_summary_default_tags_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_tags_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_default_tags_idx; -- -- Name: reporting_awscostentrylineitem_daily_summary_default_upper_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX aws_summ_usage_pfam_ilike ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_default_upper_idx; -- -- Name: reporting_awscostentrylineitem_daily_summary_default_upper_idx1; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX aws_summ_usage_pcode_ilike ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_default_upper_idx1; -- -- Name: reporting_awscostentrylineitem_daily_summary_product_family_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_product_family_idx ATTACH PARTITION reporting_awscostentrylineitem_daily_summary_product_family_idx; -- -- Name: reporting_azurecostentrylineitem_daily_s_cost_entry_bill_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_azurecostentryli_cost_entry_bill_id_e7c3e625 ATTACH PARTITION reporting_azurecostentrylineitem_daily_s_cost_entry_bill_id_idx; -- -- Name: reporting_azurecostentrylineitem_daily_summary__usage_start_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_ix_azurecstentrydlysumm_start ATTACH PARTITION reporting_azurecostentrylineitem_daily_summary__usage_start_idx; -- -- Name: reporting_azurecostentrylineitem_daily_summary_def_meter_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_azurecostentryli_meter_id_799dc028 ATTACH PARTITION reporting_azurecostentrylineitem_daily_summary_def_meter_id_idx; -- -- Name: reporting_azurecostentrylineitem_daily_summary_defaul_upper_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX ix_azure_costentrydlysumm_service_name ATTACH PARTITION reporting_azurecostentrylineitem_daily_summary_defaul_upper_idx; -- -- Name: reporting_azurecostentrylineitem_daily_summary_default_pkey; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_azurecostentrylineitem_daily_summary_pkey ATTACH PARTITION reporting_azurecostentrylineitem_daily_summary_default_pkey; -- -- Name: reporting_gcpcostentrylineitem_daily_sum_cost_entry_bill_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_reporting_gcpcostentryline_cost_entry_bill_id_bf00a16b ATTACH PARTITION reporting_gcpcostentrylineitem_daily_sum_cost_entry_bill_id_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary__instance_type_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_summary_instance_type_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary__instance_type_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary__service_alias_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_summary_service_alias_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary__service_alias_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_d_project_name_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_summary_project_name_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_d_project_name_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_de_usage_start_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_summary_usage_start_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_de_usage_start_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_def_project_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_summary_project_id_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_def_project_id_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_def_service_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_summary_service_id_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_def_service_id_idx; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_default_pkey; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_reporting_gcpcostentrylineitem_daily_summary_pkey ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_default_pkey; -- -- Name: reporting_gcpcostentrylineitem_daily_summary_default_tags_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_gcp_tags_idx ATTACH PARTITION reporting_gcpcostentrylineitem_daily_summary_default_tags_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_d_report_period_id_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_ocpusagelineitem_report_period_id_fc68baea ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_d_report_period_id_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_defaul_data_source_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_data_source_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_defaul_data_source_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_defaul_usage_start_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_ocp_usage_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_defaul_usage_start_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_default_namespace_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_namespace_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default_namespace_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_default_node_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_summary_node_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default_node_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_default_pkey; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX reporting_ocpusagelineitem_daily_summary_pkey ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default_pkey; -- -- Name: reporting_ocpusagelineitem_daily_summary_default_pod_labels_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX p_pod_labels_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default_pod_labels_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_default_upper_idx; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX ocp_summary_namespace_like_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default_upper_idx; -- -- Name: reporting_ocpusagelineitem_daily_summary_default_upper_idx1; Type: INDEX ATTACH; Schema: ; Owner: - -- ALTER INDEX ocp_summary_node_like_idx ATTACH PARTITION reporting_ocpusagelineitem_daily_summary_default_upper_idx1; -- -- Name: cost_model cost_model_audit; Type: TRIGGER; Schema: ; Owner: - -- CREATE TRIGGER cost_model_audit AFTER INSERT OR DELETE OR UPDATE ON cost_model FOR EACH ROW EXECUTE FUNCTION process_cost_model_audit(); -- -- Name: partitioned_tables tr_attach_date_range_partition; Type: TRIGGER; Schema: ; Owner: - -- CREATE TRIGGER tr_attach_date_range_partition AFTER UPDATE OF active ON partitioned_tables FOR EACH ROW EXECUTE FUNCTION public.trfn_attach_date_range_partition(); -- -- Name: partitioned_tables tr_manage_date_range_partition; Type: TRIGGER; Schema: ; Owner: - -- CREATE TRIGGER tr_manage_date_range_partition AFTER INSERT OR DELETE OR UPDATE OF partition_parameters ON partitioned_tables FOR EACH ROW EXECUTE FUNCTION public.trfn_manage_date_range_partition(); -- -- Name: presto_delete_wrapper_log tr_presto_before_insert; Type: TRIGGER; Schema: ; Owner: - -- CREATE TRIGGER tr_presto_before_insert BEFORE INSERT ON presto_delete_wrapper_log FOR EACH ROW EXECUTE FUNCTION public.tr_presto_delete_wrapper_log_action(); -- -- Name: cost_model_map cost_model_map_cost_model_id_3c67db61_fk_cost_model_uuid; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY cost_model_map ADD CONSTRAINT cost_model_map_cost_model_id_3c67db61_fk_cost_model_uuid FOREIGN KEY (cost_model_id) REFERENCES cost_model(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily_summary p_reporting_awscostent_account_alias_id_684d6c01_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_awscostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_awscostent_account_alias_id_684d6c01_fk_reporting FOREIGN KEY (account_alias_id) REFERENCES reporting_awsaccountalias(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily_summary p_reporting_awscostent_cost_entry_bill_id_d7af1eb6_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_awscostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_awscostent_cost_entry_bill_id_d7af1eb6_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily_summary p_reporting_awscostent_organizational_unit__01926b46_fk_reporti; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_awscostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_awscostent_organizational_unit__01926b46_fk_reporti FOREIGN KEY (organizational_unit_id) REFERENCES reporting_awsorganizationalunit(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentrylineitem_daily_summary p_reporting_azurecoste_cost_entry_bill_id_e7c3e625_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_azurecostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_azurecoste_cost_entry_bill_id_e7c3e625_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_azurecostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentrylineitem_daily_summary p_reporting_azurecoste_meter_id_799dc028_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_azurecostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_azurecoste_meter_id_799dc028_fk_reporting FOREIGN KEY (meter_id) REFERENCES reporting_azuremeter(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem_daily_summary p_reporting_gcpcostent_cost_entry_bill_id_bf00a16b_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_gcpcostentrylineitem_daily_summary ADD CONSTRAINT p_reporting_gcpcostent_cost_entry_bill_id_bf00a16b_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_gcpcostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagelineitem_daily_summary p_reporting_ocpusageli_report_period_id_fc68baea_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE reporting_ocpusagelineitem_daily_summary ADD CONSTRAINT p_reporting_ocpusageli_report_period_id_fc68baea_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentry reporting_awscostent_bill_id_017f27a3_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentry ADD CONSTRAINT reporting_awscostent_bill_id_017f27a3_fk_reporting FOREIGN KEY (bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily reporting_awscostent_cost_entry_bill_id_54ece653_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily ADD CONSTRAINT reporting_awscostent_cost_entry_bill_id_54ece653_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem reporting_awscostent_cost_entry_bill_id_5ae74e09_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ADD CONSTRAINT reporting_awscostent_cost_entry_bill_id_5ae74e09_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem reporting_awscostent_cost_entry_id_4d1a7fc4_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ADD CONSTRAINT reporting_awscostent_cost_entry_id_4d1a7fc4_fk_reporting FOREIGN KEY (cost_entry_id) REFERENCES reporting_awscostentry(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily reporting_awscostent_cost_entry_pricing_i_5a6a9b38_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily ADD CONSTRAINT reporting_awscostent_cost_entry_pricing_i_5a6a9b38_fk_reporting FOREIGN KEY (cost_entry_pricing_id) REFERENCES reporting_awscostentrypricing(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem reporting_awscostent_cost_entry_pricing_i_a654a7e3_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ADD CONSTRAINT reporting_awscostent_cost_entry_pricing_i_a654a7e3_fk_reporting FOREIGN KEY (cost_entry_pricing_id) REFERENCES reporting_awscostentrypricing(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem reporting_awscostent_cost_entry_product_i_29c80210_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ADD CONSTRAINT reporting_awscostent_cost_entry_product_i_29c80210_fk_reporting FOREIGN KEY (cost_entry_product_id) REFERENCES reporting_awscostentryproduct(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily reporting_awscostent_cost_entry_product_i_4d8ef2fd_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily ADD CONSTRAINT reporting_awscostent_cost_entry_product_i_4d8ef2fd_fk_reporting FOREIGN KEY (cost_entry_product_id) REFERENCES reporting_awscostentryproduct(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem_daily reporting_awscostent_cost_entry_reservati_13b1cb08_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem_daily ADD CONSTRAINT reporting_awscostent_cost_entry_reservati_13b1cb08_fk_reporting FOREIGN KEY (cost_entry_reservation_id) REFERENCES reporting_awscostentryreservation(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrylineitem reporting_awscostent_cost_entry_reservati_9332b371_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrylineitem ADD CONSTRAINT reporting_awscostent_cost_entry_reservati_9332b371_fk_reporting FOREIGN KEY (cost_entry_reservation_id) REFERENCES reporting_awscostentryreservation(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awscostentrybill reporting_awscostent_provider_id_a08725b3_fk_api_provi; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awscostentrybill ADD CONSTRAINT reporting_awscostent_provider_id_a08725b3_fk_api_provi FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awsorganizationalunit reporting_awsorganiz_account_alias_id_7bd6273b_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsorganizationalunit ADD CONSTRAINT reporting_awsorganiz_account_alias_id_7bd6273b_fk_reporting FOREIGN KEY (account_alias_id) REFERENCES reporting_awsaccountalias(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awsorganizationalunit reporting_awsorganiz_provider_id_6e91f0ae_fk_api_provi; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awsorganizationalunit ADD CONSTRAINT reporting_awsorganiz_provider_id_6e91f0ae_fk_api_provi FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awstags_summary reporting_awstags_su_account_alias_id_8a49f381_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awstags_summary ADD CONSTRAINT reporting_awstags_su_account_alias_id_8a49f381_fk_reporting FOREIGN KEY (account_alias_id) REFERENCES reporting_awsaccountalias(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_awstags_summary reporting_awstags_su_cost_entry_bill_id_c9c45ad6_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_awstags_summary ADD CONSTRAINT reporting_awstags_su_cost_entry_bill_id_c9c45ad6_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentrylineitem_daily reporting_azurecoste_cost_entry_bill_id_7898bce4_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily ADD CONSTRAINT reporting_azurecoste_cost_entry_bill_id_7898bce4_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_azurecostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentrylineitem_daily reporting_azurecoste_cost_entry_product_i_b84c188a_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily ADD CONSTRAINT reporting_azurecoste_cost_entry_product_i_b84c188a_fk_reporting FOREIGN KEY (cost_entry_product_id) REFERENCES reporting_azurecostentryproductservice(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentrylineitem_daily reporting_azurecoste_meter_id_292c06f8_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrylineitem_daily ADD CONSTRAINT reporting_azurecoste_meter_id_292c06f8_fk_reporting FOREIGN KEY (meter_id) REFERENCES reporting_azuremeter(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentryproductservice reporting_azurecoste_provider_id_2072db59_fk_api_provi; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentryproductservice ADD CONSTRAINT reporting_azurecoste_provider_id_2072db59_fk_api_provi FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azurecostentrybill reporting_azurecoste_provider_id_5b7738d5_fk_api_provi; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azurecostentrybill ADD CONSTRAINT reporting_azurecoste_provider_id_5b7738d5_fk_api_provi FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azuremeter reporting_azuremeter_provider_id_d6bb7273_fk_api_provider_uuid; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuremeter ADD CONSTRAINT reporting_azuremeter_provider_id_d6bb7273_fk_api_provider_uuid FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_azuretags_summary reporting_azuretags__cost_entry_bill_id_cb69e67a_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_azuretags_summary ADD CONSTRAINT reporting_azuretags__cost_entry_bill_id_cb69e67a_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_azurecostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem reporting_gcpcostent_cost_entry_bill_id_7a8f16fd_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem ADD CONSTRAINT reporting_gcpcostent_cost_entry_bill_id_7a8f16fd_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_gcpcostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem_daily reporting_gcpcostent_cost_entry_bill_id_a3272999_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily ADD CONSTRAINT reporting_gcpcostent_cost_entry_bill_id_a3272999_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_gcpcostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem_daily reporting_gcpcostent_cost_entry_product_i_bce5f583_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily ADD CONSTRAINT reporting_gcpcostent_cost_entry_product_i_bce5f583_fk_reporting FOREIGN KEY (cost_entry_product_id) REFERENCES reporting_gcpcostentryproductservice(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem reporting_gcpcostent_cost_entry_product_i_cec870b8_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem ADD CONSTRAINT reporting_gcpcostent_cost_entry_product_i_cec870b8_fk_reporting FOREIGN KEY (cost_entry_product_id) REFERENCES reporting_gcpcostentryproductservice(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem_daily reporting_gcpcostent_project_id_18365d99_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem_daily ADD CONSTRAINT reporting_gcpcostent_project_id_18365d99_fk_reporting FOREIGN KEY (project_id) REFERENCES reporting_gcpproject(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrylineitem reporting_gcpcostent_project_id_bf066e6e_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrylineitem ADD CONSTRAINT reporting_gcpcostent_project_id_bf066e6e_fk_reporting FOREIGN KEY (project_id) REFERENCES reporting_gcpproject(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcpcostentrybill reporting_gcpcostent_provider_id_4da1742f_fk_api_provi; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcpcostentrybill ADD CONSTRAINT reporting_gcpcostent_provider_id_4da1742f_fk_api_provi FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_gcptags_summary reporting_gcptags_su_cost_entry_bill_id_e442ff66_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_gcptags_summary ADD CONSTRAINT reporting_gcptags_su_cost_entry_bill_id_e442ff66_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_gcpcostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawscostlineitem_project_daily_summary reporting_ocpawscost_account_alias_id_d12902c6_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpawscost_account_alias_id_d12902c6_fk_reporting FOREIGN KEY (account_alias_id) REFERENCES reporting_awsaccountalias(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawscostlineitem_daily_summary reporting_ocpawscost_account_alias_id_f19d2883_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_daily_summary ADD CONSTRAINT reporting_ocpawscost_account_alias_id_f19d2883_fk_reporting FOREIGN KEY (account_alias_id) REFERENCES reporting_awsaccountalias(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawscostlineitem_project_daily_summary reporting_ocpawscost_cost_entry_bill_id_2740da80_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpawscost_cost_entry_bill_id_2740da80_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawscostlineitem_daily_summary reporting_ocpawscost_cost_entry_bill_id_2a473151_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_daily_summary ADD CONSTRAINT reporting_ocpawscost_cost_entry_bill_id_2a473151_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawscostlineitem_daily_summary reporting_ocpawscost_report_period_id_150c5620_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_daily_summary ADD CONSTRAINT reporting_ocpawscost_report_period_id_150c5620_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawscostlineitem_project_daily_summary reporting_ocpawscost_report_period_id_3f8d2da5_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawscostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpawscost_report_period_id_3f8d2da5_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawstags_summary reporting_ocpawstags_account_alias_id_f3d8c2e0_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_summary ADD CONSTRAINT reporting_ocpawstags_account_alias_id_f3d8c2e0_fk_reporting FOREIGN KEY (account_alias_id) REFERENCES reporting_awsaccountalias(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawstags_summary reporting_ocpawstags_cost_entry_bill_id_9fe9ad45_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_summary ADD CONSTRAINT reporting_ocpawstags_cost_entry_bill_id_9fe9ad45_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_awscostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpawstags_summary reporting_ocpawstags_report_period_id_54cc3cc4_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpawstags_summary ADD CONSTRAINT reporting_ocpawstags_report_period_id_54cc3cc4_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpazurecostlineitem_project_daily_summary reporting_ocpazureco_cost_entry_bill_id_442560ac_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpazureco_cost_entry_bill_id_442560ac_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_azurecostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpazurecostlineitem_daily_summary reporting_ocpazureco_cost_entry_bill_id_b12d05bd_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_daily_summary ADD CONSTRAINT reporting_ocpazureco_cost_entry_bill_id_b12d05bd_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_azurecostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpazurecostlineitem_project_daily_summary reporting_ocpazureco_report_period_id_145b540e_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_project_daily_summary ADD CONSTRAINT reporting_ocpazureco_report_period_id_145b540e_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpazurecostlineitem_daily_summary reporting_ocpazureco_report_period_id_e5bbf81f_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazurecostlineitem_daily_summary ADD CONSTRAINT reporting_ocpazureco_report_period_id_e5bbf81f_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpazuretags_summary reporting_ocpazureta_cost_entry_bill_id_c84d2dc3_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazuretags_summary ADD CONSTRAINT reporting_ocpazureta_cost_entry_bill_id_c84d2dc3_fk_reporting FOREIGN KEY (cost_entry_bill_id) REFERENCES reporting_azurecostentrybill(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpazuretags_summary reporting_ocpazureta_report_period_id_19a6abdb_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpazuretags_summary ADD CONSTRAINT reporting_ocpazureta_report_period_id_19a6abdb_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpcosts_summary reporting_ocpcosts_s_report_period_id_e53cdbb2_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpcosts_summary ADD CONSTRAINT reporting_ocpcosts_s_report_period_id_e53cdbb2_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpnamespacelabellineitem reporting_ocpnamespa_report_id_16489a95_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnamespacelabellineitem ADD CONSTRAINT reporting_ocpnamespa_report_id_16489a95_fk_reporting FOREIGN KEY (report_id) REFERENCES reporting_ocpusagereport(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpnamespacelabellineitem reporting_ocpnamespa_report_period_id_704a722f_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnamespacelabellineitem ADD CONSTRAINT reporting_ocpnamespa_report_period_id_704a722f_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpnodelabellineitem reporting_ocpnodelab_report_id_5e2f992a_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem ADD CONSTRAINT reporting_ocpnodelab_report_id_5e2f992a_fk_reporting FOREIGN KEY (report_id) REFERENCES reporting_ocpusagereport(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpnodelabellineitem reporting_ocpnodelab_report_period_id_d3fcf22e_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem ADD CONSTRAINT reporting_ocpnodelab_report_period_id_d3fcf22e_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpnodelabellineitem_daily reporting_ocpnodelab_report_period_id_de6c8f1f_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpnodelabellineitem_daily ADD CONSTRAINT reporting_ocpnodelab_report_period_id_de6c8f1f_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpstoragelineitem reporting_ocpstorage_report_id_6ff71ea6_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem ADD CONSTRAINT reporting_ocpstorage_report_id_6ff71ea6_fk_reporting FOREIGN KEY (report_id) REFERENCES reporting_ocpusagereport(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpstoragevolumelabel_summary reporting_ocpstorage_report_period_id_53b5a3b8_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragevolumelabel_summary ADD CONSTRAINT reporting_ocpstorage_report_period_id_53b5a3b8_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpstoragelineitem reporting_ocpstorage_report_period_id_6d730b12_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem ADD CONSTRAINT reporting_ocpstorage_report_period_id_6d730b12_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpstoragelineitem_daily reporting_ocpstorage_report_period_id_ad325037_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpstoragelineitem_daily ADD CONSTRAINT reporting_ocpstorage_report_period_id_ad325037_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagelineitem reporting_ocpusageli_report_id_32a973b0_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem ADD CONSTRAINT reporting_ocpusageli_report_id_32a973b0_fk_reporting FOREIGN KEY (report_id) REFERENCES reporting_ocpusagereport(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagelineitem reporting_ocpusageli_report_period_id_be7fa5ad_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem ADD CONSTRAINT reporting_ocpusageli_report_period_id_be7fa5ad_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagelineitem_daily reporting_ocpusageli_report_period_id_d5388c41_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagelineitem_daily ADD CONSTRAINT reporting_ocpusageli_report_period_id_d5388c41_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagepodlabel_summary reporting_ocpusagepo_report_period_id_fa250ee5_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagepodlabel_summary ADD CONSTRAINT reporting_ocpusagepo_report_period_id_fa250ee5_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagereportperiod reporting_ocpusagere_provider_id_7348fe66_fk_api_provi; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereportperiod ADD CONSTRAINT reporting_ocpusagere_provider_id_7348fe66_fk_api_provi FOREIGN KEY (provider_id) REFERENCES public.api_provider(uuid) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_ocpusagereport reporting_ocpusagere_report_period_id_477508c6_fk_reporting; Type: FK CONSTRAINT; Schema: ; Owner: - -- ALTER TABLE ONLY reporting_ocpusagereport ADD CONSTRAINT reporting_ocpusagere_report_period_id_477508c6_fk_reporting FOREIGN KEY (report_period_id) REFERENCES reporting_ocpusagereportperiod(id) DEFERRABLE INITIALLY DEFERRED; -- -- Name: reporting_aws_compute_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_compute_summary; -- -- Name: reporting_aws_compute_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_compute_summary_by_account; -- -- Name: reporting_aws_compute_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_compute_summary_by_region; -- -- Name: reporting_aws_compute_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_compute_summary_by_service; -- -- Name: reporting_aws_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_cost_summary; -- -- Name: reporting_aws_cost_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_cost_summary_by_account; -- -- Name: reporting_aws_cost_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_cost_summary_by_region; -- -- Name: reporting_aws_cost_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_cost_summary_by_service; -- -- Name: reporting_aws_database_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_database_summary; -- -- Name: reporting_aws_network_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_network_summary; -- -- Name: reporting_aws_storage_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_storage_summary; -- -- Name: reporting_aws_storage_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_storage_summary_by_account; -- -- Name: reporting_aws_storage_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_storage_summary_by_region; -- -- Name: reporting_aws_storage_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_aws_storage_summary_by_service; -- -- Name: reporting_azure_compute_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_compute_summary; -- -- Name: reporting_azure_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_cost_summary; -- -- Name: reporting_azure_cost_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_cost_summary_by_account; -- -- Name: reporting_azure_cost_summary_by_location; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_cost_summary_by_location; -- -- Name: reporting_azure_cost_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_cost_summary_by_service; -- -- Name: reporting_azure_database_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_database_summary; -- -- Name: reporting_azure_network_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_network_summary; -- -- Name: reporting_azure_storage_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_azure_storage_summary; -- -- Name: reporting_gcp_compute_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_compute_summary; -- -- Name: reporting_gcp_compute_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_compute_summary_by_account; -- -- Name: reporting_gcp_compute_summary_by_project; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_compute_summary_by_project; -- -- Name: reporting_gcp_compute_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_compute_summary_by_region; -- -- Name: reporting_gcp_compute_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_compute_summary_by_service; -- -- Name: reporting_gcp_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_cost_summary; -- -- Name: reporting_gcp_cost_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_cost_summary_by_account; -- -- Name: reporting_gcp_cost_summary_by_project; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_cost_summary_by_project; -- -- Name: reporting_gcp_cost_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_cost_summary_by_region; -- -- Name: reporting_gcp_cost_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_cost_summary_by_service; -- -- Name: reporting_gcp_database_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_database_summary; -- -- Name: reporting_gcp_network_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_network_summary; -- -- Name: reporting_gcp_storage_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_storage_summary; -- -- Name: reporting_gcp_storage_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_storage_summary_by_account; -- -- Name: reporting_gcp_storage_summary_by_project; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_storage_summary_by_project; -- -- Name: reporting_gcp_storage_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_storage_summary_by_region; -- -- Name: reporting_gcp_storage_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_gcp_storage_summary_by_service; -- -- Name: reporting_ocp_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_cost_summary; -- -- Name: reporting_ocp_cost_summary_by_node; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_cost_summary_by_node; -- -- Name: reporting_ocp_cost_summary_by_project; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_cost_summary_by_project; -- -- Name: reporting_ocp_pod_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_pod_summary; -- -- Name: reporting_ocp_pod_summary_by_project; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_pod_summary_by_project; -- -- Name: reporting_ocp_volume_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_volume_summary; -- -- Name: reporting_ocp_volume_summary_by_project; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocp_volume_summary_by_project; -- -- Name: reporting_ocpallcostlineitem_daily_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpallcostlineitem_daily_summary; -- -- Name: reporting_ocpall_compute_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_compute_summary; -- -- Name: reporting_ocpall_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_cost_summary; -- -- Name: reporting_ocpall_cost_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_cost_summary_by_account; -- -- Name: reporting_ocpall_cost_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_cost_summary_by_region; -- -- Name: reporting_ocpall_cost_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_cost_summary_by_service; -- -- Name: reporting_ocpall_database_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_database_summary; -- -- Name: reporting_ocpall_network_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_network_summary; -- -- Name: reporting_ocpall_storage_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpall_storage_summary; -- -- Name: reporting_ocpallcostlineitem_project_daily_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpallcostlineitem_project_daily_summary; -- -- Name: reporting_ocpaws_compute_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_compute_summary; -- -- Name: reporting_ocpaws_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_cost_summary; -- -- Name: reporting_ocpaws_cost_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_cost_summary_by_account; -- -- Name: reporting_ocpaws_cost_summary_by_region; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_cost_summary_by_region; -- -- Name: reporting_ocpaws_cost_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_cost_summary_by_service; -- -- Name: reporting_ocpaws_database_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_database_summary; -- -- Name: reporting_ocpaws_network_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_network_summary; -- -- Name: reporting_ocpaws_storage_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpaws_storage_summary; -- -- Name: reporting_ocpazure_compute_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_compute_summary; -- -- Name: reporting_ocpazure_cost_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_cost_summary; -- -- Name: reporting_ocpazure_cost_summary_by_account; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_cost_summary_by_account; -- -- Name: reporting_ocpazure_cost_summary_by_location; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_cost_summary_by_location; -- -- Name: reporting_ocpazure_cost_summary_by_service; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_cost_summary_by_service; -- -- Name: reporting_ocpazure_database_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_database_summary; -- -- Name: reporting_ocpazure_network_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_network_summary; -- -- Name: reporting_ocpazure_storage_summary; Type: MATERIALIZED VIEW DATA; Schema: ; Owner: - -- REFRESH MATERIALIZED VIEW reporting_ocpazure_storage_summary;
<reponame>goldmansachs/obevo-kata CREATE FUNCTION func892() RETURNS integer LANGUAGE plpgsql AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE274);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE254);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE62);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW37);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW69);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW53);CALL FUNC724(MYVAR);CALL FUNC330(MYVAR);CALL FUNC774(MYVAR);CALL FUNC87(MYVAR);END $$; GO
INSERT INTO TEMPLATE_ITEMS ( ITEM_NO , TYPE_ID , ITEM_NAME , ITEM_TYPE , DESCRIPTION , INITIAL_VALUE , INSERT_USER , INSERT_DATETIME , UPDATE_USER , UPDATE_DATETIME , DELETE_FLAG ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? );
<filename>apgdiff.tests/src/main/resources/cz/startnet/utils/pgdiff/drop_ms_column_diff.sql ALTER TABLE [dbo].[table1] DROP COLUMN c4 GO
CREATE TABLE user_account_remember_me ( user_account_id INTEGER NOT NULL, access_key VARCHAR(255) NOT NULL, created_at timestamp without time zone NOT NULL, PRIMARY KEY(user_account_id, access_key) ); ALTER TABLE user_account_remember_me ADD CONSTRAINT user_account_remember_me_user_account_id FOREIGN KEY (user_account_id) REFERENCES user_account_information(id);
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50712 Source Host : localhost:3306 Source Database : shiro Target Server Type : MYSQL Target Server Version : 50712 File Encoding : 65001 Date: 2016-10-10 23:27:17 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `organization` -- ---------------------------- DROP TABLE IF EXISTS `organization`; CREATE TABLE `organization` ( `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键id', `name` varchar(64) NOT NULL COMMENT '组织名', `address` varchar(100) DEFAULT NULL COMMENT '地址', `code` varchar(64) NOT NULL COMMENT '编号', `icon` varchar(32) DEFAULT NULL COMMENT '图标', `pid` bigint(19) DEFAULT NULL COMMENT '父级主键', `seq` tinyint(2) NOT NULL DEFAULT '0' COMMENT '排序', `create_time` datetime NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='组织机构'; -- ---------------------------- -- Records of organization -- ---------------------------- INSERT INTO `organization` VALUES ('1', '总经办', '王家桥', '01', 'fi-social-windows', null, '0', '2014-02-19 01:00:00'); INSERT INTO `organization` VALUES ('3', '技术部', '', '02', 'fi-social-github', null, '1', '2015-10-01 13:10:42'); INSERT INTO `organization` VALUES ('5', '产品部', '', '03', 'fi-social-apple', null, '2', '2015-12-06 12:15:30'); INSERT INTO `organization` VALUES ('6', '测试组', '', '04', 'fi-social-snapchat', '3', '0', '2015-12-06 13:12:18'); -- ---------------------------- -- Table structure for `resource` -- ---------------------------- DROP TABLE IF EXISTS `resource`; CREATE TABLE `resource` ( `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(64) NOT NULL COMMENT '资源名称', `url` varchar(100) DEFAULT NULL COMMENT '资源路径', `open_mode` varchar(32) DEFAULT NULL COMMENT '打开方式 ajax,iframe', `description` varchar(255) DEFAULT NULL COMMENT '资源介绍', `icon` varchar(32) DEFAULT NULL COMMENT '资源图标', `pid` bigint(19) DEFAULT NULL COMMENT '父级资源id', `seq` tinyint(2) NOT NULL DEFAULT '0' COMMENT '排序', `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态', `opened` tinyint(2) NOT NULL DEFAULT '1' COMMENT '打开状态', `resource_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '资源类别', `create_time` datetime NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=230 DEFAULT CHARSET=utf8 COMMENT='资源'; -- ---------------------------- -- Records of resource -- ---------------------------- INSERT INTO `resource` VALUES ('1', '权限管理', '', null, '系统管理', 'fi-folder', null, '0', '0', '1', '0', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('11', '资源管理', '/resource/manager', 'ajax', '资源管理', 'fi-database', '1', '1', '0', '1', '0', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('12', '角色管理', '/role/manager', 'ajax', '角色管理', 'fi-torso-business', '1', '2', '0', '1', '0', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('13', '用户管理', '/user/manager', 'ajax', '用户管理', 'fi-torsos-all', '1', '3', '0', '1', '0', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('14', '部门管理', '/organization/manager', 'ajax', '部门管理', 'fi-results-demographics', '1', '4', '0', '1', '0', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('111', '列表', '/resource/treeGrid', 'ajax', '资源列表', 'fi-list', '11', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('112', '添加', '/resource/add', 'ajax', '资源添加', 'fi-page-add', '11', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('113', '编辑', '/resource/edit', 'ajax', '资源编辑', 'fi-page-edit', '11', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('114', '删除', '/resource/delete', 'ajax', '资源删除', 'fi-page-delete', '11', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('121', '列表', '/role/dataGrid', 'ajax', '角色列表', 'fi-list', '12', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('122', '添加', '/role/add', 'ajax', '角色添加', 'fi-page-add', '12', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('123', '编辑', '/role/edit', 'ajax', '角色编辑', 'fi-page-edit', '12', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('124', '删除', '/role/delete', 'ajax', '角色删除', 'fi-page-delete', '12', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('125', '授权', '/role/grant', 'ajax', '角色授权', 'fi-check', '12', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('131', '列表', '/user/dataGrid', 'ajax', '用户列表', 'fi-list', '13', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('132', '添加', '/user/add', 'ajax', '用户添加', 'fi-page-add', '13', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('133', '编辑', '/user/edit', 'ajax', '用户编辑', 'fi-page-edit', '13', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('134', '删除', '/user/delete', 'ajax', '用户删除', 'fi-page-delete', '13', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('141', '列表', '/organization/treeGrid', 'ajax', '用户列表', 'fi-list', '14', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('142', '添加', '/organization/add', 'ajax', '部门添加', 'fi-page-add', '14', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('143', '编辑', '/organization/edit', 'ajax', '部门编辑', 'fi-page-edit', '14', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('144', '删除', '/organization/delete', 'ajax', '部门删除', 'fi-page-delete', '14', '0', '0', '1', '1', '2014-02-19 01:00:00'); INSERT INTO `resource` VALUES ('221', '日志监控', '', null, null, 'fi-folder', null, '3', '0', '0', '0', '2015-12-01 11:44:20'); INSERT INTO `resource` VALUES ('222', '视频教程', '', null, null, 'fi-folder', null, '2', '0', '0', '0', '2015-12-06 12:40:42'); INSERT INTO `resource` VALUES ('223', '官方网站', 'https://www.dreamlu.net', 'iframe', null, 'fi-home', '222', '0', '0', '1', '0', '2015-12-06 12:42:42'); INSERT INTO `resource` VALUES ('224', 'jfinal视频', 'http://blog.dreamlu.net/blog/79', 'iframe', null, 'fi-video', '222', '1', '0', '1', '0', '2015-12-06 12:45:28'); INSERT INTO `resource` VALUES ('226', '修改密码', '/user/editPwdPage', 'ajax', null, 'fi-unlock', null, '4', '0', '1', '1', '2015-12-07 20:23:06'); INSERT INTO `resource` VALUES ('227', '登录日志', '/sysLog/manager', 'ajax', null, 'fi-info', '221', '0', '0', '1', '0', '2016-09-30 22:10:53'); INSERT INTO `resource` VALUES ('228', 'Druid监控', '/druid', 'iframe', null, 'fi-monitor', '221', '0', '0', '1', '0', '2016-09-30 22:12:50'); INSERT INTO `resource` VALUES ('229', '系统图标', '/icons.html', 'ajax', null, 'fi-photo', '221', '0', '0', '1', '0', '2016-12-24 15:53:47'); INSERT INTO `resource` VALUES ('230', '文章管理', '', 'ajax', null, 'fi-page-multiple', null, '1', '0', '0', '0', '2016-12-24 15:53:47'); INSERT INTO `resource` VALUES ('231', '新建文章', '/article/create', 'ajax', null, 'fi-page-edit', '230', '0', '0', '1', '0', '2016-12-24 15:53:47'); -- ---------------------------- -- Table structure for `role` -- ---------------------------- DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键id', `name` varchar(64) NOT NULL COMMENT '角色名', `seq` tinyint(2) NOT NULL DEFAULT '0' COMMENT '排序号', `description` varchar(255) DEFAULT NULL COMMENT '简介', `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='角色'; -- ---------------------------- -- Records of role -- ---------------------------- INSERT INTO `role` VALUES ('1', 'admin', '0', '超级管理员', '0'); INSERT INTO `role` VALUES ('2', 'de', '0', '技术部经理', '0'); INSERT INTO `role` VALUES ('7', 'pm', '0', '产品部经理', '0'); INSERT INTO `role` VALUES ('8', 'test', '0', '测试账户', '0'); -- ---------------------------- -- Table structure for `role_resource` -- ---------------------------- DROP TABLE IF EXISTS `role_resource`; CREATE TABLE `role_resource` ( `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键id', `role_id` bigint(19) NOT NULL COMMENT '角色id', `resource_id` bigint(19) NOT NULL COMMENT '资源id', PRIMARY KEY (`id`), KEY `idx_role_resource_ids` (`role_id`,`resource_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=463 DEFAULT CHARSET=utf8 COMMENT='角色资源'; -- ---------------------------- -- Records of role_resource -- ---------------------------- INSERT INTO `role_resource` VALUES ('158', '3', '1'); INSERT INTO `role_resource` VALUES ('159', '3', '11'); INSERT INTO `role_resource` VALUES ('160', '3', '111'); INSERT INTO `role_resource` VALUES ('161', '3', '112'); INSERT INTO `role_resource` VALUES ('162', '3', '113'); INSERT INTO `role_resource` VALUES ('163', '3', '114'); INSERT INTO `role_resource` VALUES ('164', '3', '12'); INSERT INTO `role_resource` VALUES ('165', '3', '121'); INSERT INTO `role_resource` VALUES ('166', '3', '122'); INSERT INTO `role_resource` VALUES ('167', '3', '123'); INSERT INTO `role_resource` VALUES ('168', '3', '124'); INSERT INTO `role_resource` VALUES ('169', '3', '125'); INSERT INTO `role_resource` VALUES ('170', '3', '13'); INSERT INTO `role_resource` VALUES ('171', '3', '131'); INSERT INTO `role_resource` VALUES ('172', '3', '132'); INSERT INTO `role_resource` VALUES ('173', '3', '133'); INSERT INTO `role_resource` VALUES ('174', '3', '134'); INSERT INTO `role_resource` VALUES ('175', '3', '14'); INSERT INTO `role_resource` VALUES ('176', '3', '141'); INSERT INTO `role_resource` VALUES ('177', '3', '142'); INSERT INTO `role_resource` VALUES ('178', '3', '143'); INSERT INTO `role_resource` VALUES ('179', '3', '144'); INSERT INTO `role_resource` VALUES ('359', '7', '1'); INSERT INTO `role_resource` VALUES ('360', '7', '14'); INSERT INTO `role_resource` VALUES ('361', '7', '141'); INSERT INTO `role_resource` VALUES ('362', '7', '142'); INSERT INTO `role_resource` VALUES ('363', '7', '143'); INSERT INTO `role_resource` VALUES ('364', '7', '222'); INSERT INTO `role_resource` VALUES ('365', '7', '223'); INSERT INTO `role_resource` VALUES ('366', '7', '224'); INSERT INTO `role_resource` VALUES ('367', '7', '221'); INSERT INTO `role_resource` VALUES ('368', '7', '226'); INSERT INTO `role_resource` VALUES ('409', '1', '1'); INSERT INTO `role_resource` VALUES ('410', '1', '11'); INSERT INTO `role_resource` VALUES ('411', '1', '111'); INSERT INTO `role_resource` VALUES ('412', '1', '112'); INSERT INTO `role_resource` VALUES ('413', '1', '113'); INSERT INTO `role_resource` VALUES ('414', '1', '114'); INSERT INTO `role_resource` VALUES ('415', '1', '12'); INSERT INTO `role_resource` VALUES ('416', '1', '121'); INSERT INTO `role_resource` VALUES ('417', '1', '122'); INSERT INTO `role_resource` VALUES ('418', '1', '123'); INSERT INTO `role_resource` VALUES ('419', '1', '124'); INSERT INTO `role_resource` VALUES ('420', '1', '125'); INSERT INTO `role_resource` VALUES ('421', '1', '13'); INSERT INTO `role_resource` VALUES ('422', '1', '131'); INSERT INTO `role_resource` VALUES ('423', '1', '132'); INSERT INTO `role_resource` VALUES ('424', '1', '133'); INSERT INTO `role_resource` VALUES ('425', '1', '134'); INSERT INTO `role_resource` VALUES ('426', '1', '14'); INSERT INTO `role_resource` VALUES ('427', '1', '141'); INSERT INTO `role_resource` VALUES ('428', '1', '142'); INSERT INTO `role_resource` VALUES ('429', '1', '143'); INSERT INTO `role_resource` VALUES ('430', '1', '144'); INSERT INTO `role_resource` VALUES ('431', '1', '222'); INSERT INTO `role_resource` VALUES ('432', '1', '223'); INSERT INTO `role_resource` VALUES ('433', '1', '224'); INSERT INTO `role_resource` VALUES ('434', '1', '221'); INSERT INTO `role_resource` VALUES ('435', '1', '227'); INSERT INTO `role_resource` VALUES ('436', '1', '228'); INSERT INTO `role_resource` VALUES ('437', '2', '1'); INSERT INTO `role_resource` VALUES ('438', '2', '13'); INSERT INTO `role_resource` VALUES ('439', '2', '131'); INSERT INTO `role_resource` VALUES ('440', '2', '132'); INSERT INTO `role_resource` VALUES ('441', '2', '133'); INSERT INTO `role_resource` VALUES ('442', '2', '222'); INSERT INTO `role_resource` VALUES ('443', '2', '223'); INSERT INTO `role_resource` VALUES ('444', '2', '224'); INSERT INTO `role_resource` VALUES ('445', '2', '221'); INSERT INTO `role_resource` VALUES ('446', '2', '227'); INSERT INTO `role_resource` VALUES ('447', '2', '228'); INSERT INTO `role_resource` VALUES ('448', '8', '1'); INSERT INTO `role_resource` VALUES ('449', '8', '11'); INSERT INTO `role_resource` VALUES ('450', '8', '111'); INSERT INTO `role_resource` VALUES ('451', '8', '12'); INSERT INTO `role_resource` VALUES ('452', '8', '121'); INSERT INTO `role_resource` VALUES ('453', '8', '13'); INSERT INTO `role_resource` VALUES ('454', '8', '131'); INSERT INTO `role_resource` VALUES ('455', '8', '14'); INSERT INTO `role_resource` VALUES ('456', '8', '141'); INSERT INTO `role_resource` VALUES ('457', '8', '222'); INSERT INTO `role_resource` VALUES ('458', '8', '223'); INSERT INTO `role_resource` VALUES ('459', '8', '224'); INSERT INTO `role_resource` VALUES ('460', '8', '221'); INSERT INTO `role_resource` VALUES ('461', '8', '227'); INSERT INTO `role_resource` VALUES ('462', '8', '228'); INSERT INTO `role_resource` VALUES ('478', '8', '229'); INSERT INTO `role_resource` VALUES ('479', '8', '230'); INSERT INTO `role_resource` VALUES ('480', '8', '231'); -- ---------------------------- -- Table structure for `sys_log` -- ---------------------------- DROP TABLE IF EXISTS `sys_log`; CREATE TABLE `sys_log` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', `login_name` varchar(255) DEFAULT NULL COMMENT '登陆名', `role_name` varchar(255) DEFAULT NULL COMMENT '角色名', `opt_content` varchar(1024) DEFAULT NULL COMMENT '内容', `client_ip` varchar(255) DEFAULT NULL COMMENT '客户端ip', `create_time` datetime NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=391 DEFAULT CHARSET=utf8 COMMENT='系统日志'; -- ---------------------------- -- Table structure for `user` -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键id', `login_name` varchar(64) NOT NULL COMMENT '登陆名', `name` varchar(64) NOT NULL COMMENT '用户名', `password` varchar(64) NOT NULL COMMENT '密码', `salt` varchar(36) DEFAULT NULL COMMENT '密码加密盐', `sex` tinyint(2) NOT NULL DEFAULT '0' COMMENT '性别', `age` tinyint(2) DEFAULT '0' COMMENT '年龄', `phone` varchar(20) DEFAULT NULL COMMENT '手机号', `user_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '用户类别', `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '用户状态', `organization_id` int(11) NOT NULL DEFAULT '0' COMMENT '所属机构', `create_time` datetime NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`), UNIQUE KEY `IDx_user_login_name` (`login_name`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='用户'; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('1', 'admin', 'admin', '05a671c66aefea124cc08b76ea6d30bb', 'test', '0', '25', '18707173376', '0', '0', '1', '2015-12-06 13:14:05'); INSERT INTO `user` VALUES ('13', 'snoopy', 'snoopy', '05a671c66aefea124cc08b76ea6d30bb', 'test', '0', '25', '18707173376', '1', '0', '3', '2015-10-01 13:12:07'); INSERT INTO `user` VALUES ('14', 'dreamlu', 'dreamlu', '05a671c66aefea124cc08b76ea6d30bb', 'test', '0', '25', '18707173376', '1', '0', '5', '2015-10-11 23:12:58'); INSERT INTO `user` VALUES ('15', 'test', 'test', '05a671c66aefea124cc08b76ea6d30bb', 'test', '0', '25', '18707173376', '1', '0', '6', '2015-12-06 13:13:03'); -- ---------------------------- -- Table structure for `user_role` -- ---------------------------- DROP TABLE IF EXISTS `user_role`; CREATE TABLE `user_role` ( `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键id', `user_id` bigint(19) NOT NULL COMMENT '用户id', `role_id` bigint(19) NOT NULL COMMENT '角色id', PRIMARY KEY (`id`), KEY `idx_user_role_ids` (`user_id`,`role_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8 COMMENT='用户角色'; -- ---------------------------- -- Records of user_role -- ---------------------------- INSERT INTO `user_role` VALUES ('53', '15', '8'); INSERT INTO `user_role` VALUES ('60', '1', '1'); INSERT INTO `user_role` VALUES ('61', '1', '2'); INSERT INTO `user_role` VALUES ('62', '1', '7'); INSERT INTO `user_role` VALUES ('63', '13', '2'); INSERT INTO `user_role` VALUES ('64', '14', '7'); INSERT INTO `user_role` VALUES ('65', '1', '8');
<filename>papelaria.sql DROP DATABASE IF EXISTS PAPELARIA; CREATE DATABASE PAPELARIA; USE PAPELARIA; ----------------------------------------------------------- -- ENTIDADES E RELACIONAMENTOS -- ----------------------------------------------------------- DROP TABLE IF EXISTS CARRINHO; -- relacionamentos DROP TABLE IF EXISTS COMPRAS; -- entidade DROP TABLE IF EXISTS CLIENTE_ADDRESS; -- entidade DROP TABLE IF EXISTS CLIENTES; -- entidade DROP TABLE IF EXISTS ATENDENTE; -- entidade DROP TABLE IF EXISTS ENTREGADOR; -- entidade DROP TABLE IF EXISTS FUNCIONARIO_ADDRESS; -- entidade DROP TABLE IF EXISTS FUNCIONARIO; -- entidade DROP TABLE IF EXISTS FORNECEDORES_ADDRESS; -- entidade DROP TABLE IF EXISTS FORNECEDORES; -- entidade DROP TABLE IF EXISTS PRODUTOS; -- entidade DROP TABLE IF EXISTS CATEGORIA; -- entidade DROP TABLE IF EXISTS ENTREGA; -- relacionamentos DROP TABLE IF EXISTS GET_PRODUTO; -- relacionamentos ----------------------------------------------------------- -- TABELAS -- ----------------------------------------------------------- CREATE TABLE FUNCIONARIO( id INTEGER PRIMARY KEY, cpf CHAR(11), nome VARCHAR(50), telefone1 CHAR(11), telefone2 CHAR(11) ); CREATE TABLE FUNCIONARIO_ADDRESS( CEP CHAR(8), logradouro VARCHAR(50), nro INTEGER, UF CHAR(2), cidade VARCHAR(50), bairro VARCHAR(50), pais VARCHAR(50), complemento VARCHAR(50), id_funcionario INTEGER, FOREIGN KEY(id_funcionario) REFERENCES FUNCIONARIO(id) ON DELETE CASCADE, PRIMARY KEY(CEP, logradouro, nro, id_funcionario) ); CREATE TABLE ATENDENTE( id_funcionario INTEGER, FOREIGN KEY(id_funcionario) REFERENCES FUNCIONARIO(id), PRIMARY KEY(id_funcionario) ); CREATE TABLE ENTREGADOR( id_funcionario INTEGER, FOREIGN KEY(id_funcionario) REFERENCES FUNCIONARIO(id), PRIMARY KEY(id_funcionario) ); CREATE TABLE CLIENTES( id INTEGER PRIMARY KEY, cpf CHAR(11), nome VARCHAR(50), telefone1 CHAR(11), telefone2 CHAR(11), id_atendente INTEGER, FOREIGN KEY(id_atendente) REFERENCES ATENDENTE(id_funcionario) ); CREATE TABLE CLIENTE_ADDRESS( CEP CHAR(8), logradouro VARCHAR(50), nro INTEGER, UF CHAR(2), cidade VARCHAR(50), bairro VARCHAR(50), pais VARCHAR(50), complemento VARCHAR(50), id_cliente INTEGER, FOREIGN KEY(id_cliente) REFERENCES CLIENTES(id) ON DELETE CASCADE, PRIMARY KEY(CEP, logradouro, nro, id_cliente) ); CREATE TABLE CATEGORIA( id INTEGER NOT NULL AUTO_INCREMENT, nome VARCHAR(50), descricao VARCHAR(500), CONSTRAINT PRIMARY KEY(id) ); CREATE TABLE PRODUTOS( codigo INTEGER PRIMARY KEY AUTO_INCREMENT, nome VARCHAR(50), descricao VARCHAR(500), qtde INTEGER, secao VARCHAR(50), id_categoria INTEGER NOT NULL, CONSTRAINT FOREIGN KEY(id_categoria) REFERENCES CATEGORIA(id) ON DELETE CASCADE ); CREATE TABLE COMPRAS( id_compra INTEGER PRIMARY KEY, data_de_compra DATE, modalidade VARCHAR(20), preco FLOAT, id_cliente INTEGER, FOREIGN KEY(id_cliente) REFERENCES CLIENTES(id) ); CREATE TABLE CARRINHO( -- compras N..N produtos id_compra INTEGER, id_produto INTEGER, item VARCHAR(50), qtde INTEGER, preco FLOAT, data_de_compra DATE, FOREIGN KEY(id_compra) REFERENCES COMPRAS(id_compra), FOREIGN KEY(id_produto) REFERENCES PRODUTOS(codigo), PRIMARY KEY(id_compra, id_produto) ); CREATE TABLE FORNECEDORES( id INTEGER PRIMARY KEY, cnpj CHAR(14), nome VARCHAR(50), telefone1 CHAR(10), telefone2 char(11) ); CREATE TABLE FORNECEDORES_ADDRESS( CEP CHAR(8), logradouro VARCHAR(50), nro INTEGER, UF CHAR(2), cidade VARCHAR(50), bairro VARCHAR(50), pais VARCHAR(50), complemento VARCHAR(50), id_fornecedores INTEGER, FOREIGN KEY(id_fornecedores) REFERENCES FORNECEDORES(id) ON DELETE CASCADE, PRIMARY KEY(CEP, logradouro, nro, id_fornecedores) ); CREATE TABLE ENTREGA( -- cliente N..N entregador id_cliente INTEGER, id_funcionario INTEGER, data_de_entrega DATE, FOREIGN KEY(id_cliente) REFERENCES CLIENTES(id), FOREIGN KEY(id_funcionario) REFERENCES ENTREGADOR(id_funcionario), PRIMARY KEY(id_cliente, id_funcionario) ); CREATE TABLE GET_PRODUTO( -- produtos N..N fornecedores id_fornecedores INTEGER, id_produto INTEGER, FOREIGN KEY(id_fornecedores) REFERENCES FORNECEDORES(id), FOREIGN KEY(id_produto) REFERENCES PRODUTOS(codigo), PRIMARY KEY(id_fornecedores, id_produto) ); insert into CATEGORIA(nome, descricao) values('Livros', 'novo 1'), ('Escritório', 'novo 2'), ('Papelaria', 'novo 3'); insert into PRODUTOS(nome, descricao, qtde, secao, id_categoria) values('Livros', 'bla bla bla', '3', 'qualquer', 1);
<reponame>YordanGeorgiev/isg-pub<filename>sfw/sql/mysql/product/07.create-Requirement-table.sql DROP TABLE IF EXISTS `Requirement`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Requirement` ( `RequirementId` bigint NOT NULL UNIQUE , `SeqId` bigint NOT NULL , `Level` smallint NOT NULL , `LeftRank` bigint NOT NULL , `RightRank` bigint NOT NULL , `Prio` smallint NOT NULL , `Name` varchar(200) NOT NULL , `DeadLine` datetime DEFAULT NULL , `Description` varchar(4000) NOT NULL , `Weight` smallint DEFAULT NULL , `UpdateTime` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- now check that the table exists SELECT 'if the name is shown bellow the table has been created' ; SHOW TABLES LIKE 'Requirement'; -- now check that the table exists SHOW TABLES LIKE 'Requirement'; SELECT FOUND_ROWS() AS 'FOUND' ; -- NOW CHECK THE COLUMNS SELECT CONCAT ( TABLE_NAME , '.' , COLUMN_NAME ) AS 'TABLE.COLUMNS' from information_schema.COLUMNS WHERE 1=1 AND TABLE_SCHEMA=DATABASE() AND TABLE_NAME='Requirement' ;
CREATE SEQUENCE sq_user_id START 1; CREATE TABLE t_user( id BIGINT PRIMARY KEY DEFAULT NEXTVAL('sq_user_id'), first_name VARCHAR(50), last_name VARCHAR(50), CONSTRAINT user_id_unique UNIQUE(id) ); CREATE INDEX ON t_user (id);
USE [PmisDb] GO /****** Object: Table [dbo].[Hard_MaterialItem] Script Date: 2018/9/25 0:22:24 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Hard_MaterialItem]( [SerialNo] [nvarchar](50) NOT NULL, [ItemNo] [nvarchar](50) NULL, [ItemName] [nvarchar](50) NULL, [SubItemNo] [nvarchar](50) NULL, [SubItemType] [nvarchar](50) NULL, [MatTypeNo] [nvarchar](50) NOT NULL, [Brand] [nvarchar](100) NULL, [ItemSpecs] [nvarchar](500) NULL, [ItemModel] [nvarchar](500) NULL, [ItemUnit] [nvarchar](30) NULL, [ItemDesc] [nvarchar](100) NULL, [ItemMemo] [nvarchar](200) NULL, [WarrantyPeriod] [int] NULL, [warrantyType] [nvarchar](50) NULL, [WarrantyCost] [decimal](18, 2) NULL, [Taxrate] [int] NULL, [DeliveryDay] [int] NULL, [MinPurchase] [int] NULL, [MainSupplier] [nvarchar](100) NULL, [ConfigDesc] [nvarchar](500) NULL, [CostPrice] [decimal](18, 2) NULL, [PurchasePrice] [decimal](18, 2) NULL, [Offer] [decimal](18, 2) NULL, [SpecificUse] [nvarchar](500) NULL, [AttachFiles] [nvarchar](500) NULL, [IsEnergy] [int] NOT NULL, [IsDel] [int] NULL, [IsStop] [int] NOT NULL, [ItemQtySafety] [int] NULL, [CreateUser] [int] NOT NULL, [CreateTime] [datetime] NOT NULL, [LastUser] [int] NULL, [LastTime] [datetime] NULL, CONSTRAINT [PK_Hard_MaterialItem] PRIMARY KEY CLUSTERED ( [SerialNo] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO
<reponame>ps-shpak/stocktakingapp CREATE TABLE "owner" ( "id" UUID PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "email" VARCHAR(255) NOT NULL, "created" TIMESTAMPTZ DEFAULT NOW(), "may_login" BOOLEAN DEFAULT 'false' );
<filename>dockerfiles/mysql/files/epcis_schema.sql -- Copyright (C) 2007 ETH Zurich -- -- This file is part of Fosstrak (www.fosstrak.org). -- -- Fosstrak is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License version 2.1, as published by the Free Software Foundation. -- -- Fosstrak is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with Fosstrak; if not, write to the Free -- Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- Boston, MA 02110-1301 USA -- This is the EPCIS database schema file for the creation of the -- tables in MySQL. Note: this schema is MySQL specific! BEGIN; SET storage_engine=INNODB; -- --------------------------------------------- -- Vocabularies -- --------------------------------------------- CREATE TABLE `voc_BizLoc` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizLoc_attr` ( `id` bigint NOT NULL REFERENCES `voc_BizLoc`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizStep` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizStep_attr` ( `id` bigint NOT NULL REFERENCES `voc_BizStep`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizTransType` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizTransType_attr` ( `id` bigint NOT NULL REFERENCES `voc_BizTransType`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizTrans` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_BizTrans_attr` ( `id` bigint NOT NULL REFERENCES `voc_BizTrans`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); CREATE TABLE `voc_Disposition` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_Disposition_attr` ( `id` bigint NOT NULL REFERENCES `voc_Disposition`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); CREATE TABLE `voc_ReadPoint` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_ReadPoint_attr` ( `id` bigint NOT NULL REFERENCES `voc_ReadPoint`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); CREATE TABLE `voc_EPCClass` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL ); CREATE TABLE `voc_EPCClass_attr` ( `id` bigint NOT NULL REFERENCES `voc_EPCClass`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); -- --------------------------------------------- -- Non-Standard Masterdata Vocabularies -- --------------------------------------------- CREATE TABLE `voc_Any` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `uri` varchar(1023) NOT NULL, `vtype` varchar(1023) NOT NULL ); CREATE TABLE `voc_Any_attr` ( `id` bigint NOT NULL REFERENCES `voc_Any`(`id`), `attribute` varchar(1023) NOT NULL, `value` varchar(1023) NOT NULL ); -- --------------------------------------------- -- Business Transactions -- --------------------------------------------- CREATE TABLE `BizTransaction` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `bizTrans` bigint NOT NULL REFERENCES `voc_BizTrans` (`id`), `type` bigint REFERENCES `voc_BizTransType` (`id`) ); -- --------------------------------------------- -- Aggregation Events -- --------------------------------------------- CREATE TABLE `event_AggregationEvent` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `eventTime` timestamp NOT NULL, `eventTimeMs` bigint(20) NOT NULL, `recordTime` timestamp NOT NULL, `recordTimeMs` bigint(20) NOT NULL, `eventTimeZoneOffset` varchar(8) NOT NULL, `parentID` varchar(1023) DEFAULT NULL, -- varchar(1023) good choice? `action` varchar(8) NOT NULL CHECK (`action` IN ('ADD','OBSERVE','DELETE')), `bizStep` bigint DEFAULT NULL REFERENCES `voc_BizStep` (`id`), `disposition` bigint DEFAULT NULL REFERENCES `voc_Disposition`(`id`), `readPoint` bigint DEFAULT NULL REFERENCES `voc_ReadPoint`(`id`), `bizLocation` bigint DEFAULT NULL REFERENCES `voc_BizLoc`(`id`) -- `bizTransaction` bigint DEFAULT NULL REFERENCES `voc_BizTrans`(`id`) ); CREATE TABLE `event_AggregationEvent_EPCs` ( -- This EPC list is called childEPCs (or childEPCList) in the standard, -- for uniform access `child` has been ommitted from the table name. `event_id` bigint NOT NULL REFERENCES `event_AggregationEvent`, `epc` varchar(1023) NOT NULL, `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_AggregationEvent_bizTrans` ( -- bizTrans 0..* associated with event `event_id` bigint NOT NULL REFERENCES `event_AggregationEvent` (`id`), `bizTrans_id` bigint NOT NULL REFERENCES `BizTransaction` (`id`), `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_AggregationEvent_extensions` ( `id` bigint PRIMARY KEY auto_increment, `event_id` bigint NOT NULL REFERENCES `event_AggregationEvent` (`id`), `fieldname` varchar(128) NOT NULL, `prefix` varchar(32) NOT NULL, `intValue` integer, `floatValue` float, `dateValue` timestamp NULL DEFAULT NULL, `strValue` varchar(1024), INDEX (event_id) ); -- --------------------------------------------- -- Object Events -- --------------------------------------------- CREATE TABLE `event_ObjectEvent` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment -> cross platform sequence??? `eventTime` timestamp NOT NULL, `eventTimeMs` bigint(20) NOT NULL, `recordTime` timestamp NOT NULL, `recordTimeMs` bigint(20) NOT NULL, `eventTimeZoneOffset` varchar(8) NOT NULL, `action` varchar(8) NOT NULL CHECK (`action` IN ('ADD','OBSERVE','DELETE')), `bizStep` bigint DEFAULT NULL REFERENCES `voc_BizStep` (`id`), `disposition` bigint DEFAULT NULL REFERENCES `voc_Disposition` (`id`), `readPoint` bigint DEFAULT NULL REFERENCES `voc_ReadPoint` (`id`), `bizLocation` bigint DEFAULT NULL REFERENCES `voc_BizLoc` (`id`) -- `bizTransaction` bigint DEFAULT NULL REFERENCES `voc_BizTrans` (`id`) ); CREATE TABLE `event_ObjectEvent_EPCs` ( `event_id` bigint NOT NULL REFERENCES `event_ObjectEvent`, `epc` varchar(1023) NOT NULL, `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_ObjectEvent_bizTrans` ( -- bizTrans 0..* associated with event `event_id` bigint NOT NULL REFERENCES `event_ObjectEvent` (`id`), `bizTrans_id` bigint NOT NULL REFERENCES `BizTransaction` (`id`), `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_ObjectEvent_extensions` ( `id` bigint PRIMARY KEY auto_increment, `event_id` bigint NOT NULL REFERENCES `event_ObjectEvent` (`id`), `fieldname` varchar(128) NOT NULL, `prefix` varchar(32) NOT NULL, `intValue` integer, `floatValue` float, `dateValue` timestamp NULL DEFAULT NULL, `strValue` varchar(1024), INDEX (event_id) ); -- --------------------------------------------- -- Quantity Events -- --------------------------------------------- CREATE TABLE `event_QuantityEvent` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `eventTime` timestamp NOT NULL, `eventTimeMs` bigint(20) NOT NULL, `recordTime` timestamp NOT NULL, `recordTimeMs` bigint(20) NOT NULL, `eventTimeZoneOffset` varchar(8) NOT NULL, `epcClass` bigint NOT NULL REFERENCES `voc_EPCClass` (`id`), `quantity` bigint NOT NULL, `bizStep` bigint DEFAULT NULL REFERENCES `voc_BizStep` (`id`), `disposition` bigint DEFAULT NULL REFERENCES `voc_Disposition` (`id`), `readPoint` bigint DEFAULT NULL REFERENCES `voc_ReadPoint` (`id`), `bizLocation` bigint DEFAULT NULL REFERENCES `voc_BizLoc` (`id`) ); CREATE TABLE `event_QuantityEvent_bizTrans` ( -- bizTrans 0..* associated with event `event_id` bigint NOT NULL REFERENCES `event_QuantityEvent` (`id`), `bizTrans_id` bigint NOT NULL REFERENCES `BizTransaction` (`id`), `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_QuantityEvent_extensions` ( `id` bigint PRIMARY KEY auto_increment, `event_id` bigint NOT NULL REFERENCES `event_QuantityEvent` (`id`), `fieldname` varchar(128) NOT NULL, `prefix` varchar(32) NOT NULL, `intValue` integer, `floatValue` float, `dateValue` timestamp NULL DEFAULT NULL, `strValue` varchar(1024), INDEX (event_id) ); -- --------------------------------------------- -- Transaction Events -- --------------------------------------------- CREATE TABLE `event_TransactionEvent` ( `id` bigint PRIMARY KEY auto_increment, -- id auto_increment `eventTime` timestamp NOT NULL, `eventTimeMs` bigint(20) NOT NULL, `recordTime` timestamp NOT NULL, `recordTimeMs` bigint(20) NOT NULL, `eventTimeZoneOffset` varchar(8) NOT NULL, `parentID` varchar(1023) DEFAULT NULL, `action` varchar(8) NOT NULL CHECK (`action` IN ('ADD','OBSERVE','DELETE')), `bizStep` bigint DEFAULT NULL REFERENCES `voc_BizStep` (`id`), `disposition` bigint DEFAULT NULL REFERENCES `voc_Disposition` (`id`), `readPoint` bigint DEFAULT NULL REFERENCES `voc_ReadPoint` (`id`), `bizLocation` bigint DEFAULT NULL REFERENCES `voc_BizLoc` (`id`) -- `bizTransaction` bigint DEFAULT NULL REFERENCES `voc_BizTrans` (`id`) ); CREATE TABLE `event_TransactionEvent_EPCs` ( `event_id` bigint NOT NULL REFERENCES `event_TransactionEvent`, `epc` varchar(1023) NOT NULL, `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_TransactionEvent_bizTrans` ( -- bizTrans 1..* associated with event, at least one not yet enforced in DB `event_id` bigint NOT NULL REFERENCES `event_TransactionEvent` (`id`), `bizTrans_id` bigint NOT NULL REFERENCES `BizTransaction` (`id`), `idx` int NOT NULL, INDEX (event_id) ); CREATE TABLE `event_TransactionEvent_extensions` ( `id` bigint PRIMARY KEY auto_increment, `event_id` bigint NOT NULL REFERENCES `event_TransactionEvent` (`id`), `fieldname` varchar(128) NOT NULL, `prefix` varchar(32) NOT NULL, `intValue` integer, `floatValue` float, `dateValue` timestamp NULL DEFAULT NULL, `strValue` varchar(1024), INDEX (event_id) ); -- --------------------------------------------- -- Subscriptions -- --------------------------------------------- CREATE TABLE subscription ( subscriptionid varchar(767) NOT NULL PRIMARY KEY, params blob, dest varchar(1023), sched blob, trigg varchar(1023), initialrecordingtime timestamp, exportifempty boolean, queryname varchar(1023), lastexecuted timestamp ); COMMIT;
<filename>sql/channels_sql_db_mysql.sql CREATE TABLE App ( AppID character varying(150) NOT NULL, Name character varying(255) ); CREATE TABLE Channel ( ID bigint NOT NULL AUTO_INCREMENT, ChannelID character varying(100) NOT NULL, AppID character varying(150), Name character varying(150), Created_At bigint, IsClosed boolean, Extra text, Persistent boolean, Private boolean, Presence boolean, Push boolean, primary key (ID) ); CREATE TABLE Channel_Client ( clientID character varying(100) NOT NULL, channelID bigint NOT NULL ); CREATE TABLE Channel_Event ( ID bigint NOT NULL AUTO_INCREMENT, SenderID character varying(100) NOT NULL, EventType character varying(50) NOT NULL, TimeStamp bigint NOT NULL, Payload text NOT NULL, ChannelID bigint NOT NULL, primary key (ID) ); CREATE TABLE Client ( ID character varying(100) NOT NULL, Username character varying(100), AppID character varying(155) NOT NULL, Extra text ); CREATE TABLE Device ( ID character varying(50) NOT NULL, Token character varying(350) NOT NULL, ClientID character varying(100) NOT NULL ); ALTER TABLE App ADD CONSTRAINT App_pkey PRIMARY KEY (AppID); ALTER TABLE Client ADD CONSTRAINT Client_pkey PRIMARY KEY (ID); ALTER TABLE Device ADD CONSTRAINT Device_pkey PRIMARY KEY (ID); ALTER TABLE Channel_Client ADD CONSTRAINT client_channelID_unique UNIQUE (clientID, channelID); ALTER TABLE Channel ADD CONSTRAINT unique_app_channel UNIQUE (AppID, ChannelID); CREATE INDEX appID_channelID_indexx ON Channel (ChannelID, AppID); CREATE INDEX channelID_TimeStamp_Indexx ON Channel_Event (ChannelID, TimeStamp); ALTER TABLE Channel_Event ADD CONSTRAINT channelID_fk FOREIGN KEY (ChannelID) REFERENCES Channel(ID); ALTER TABLE Channel_Client ADD CONSTRAINT channel_client_channel_fk FOREIGN KEY (channelID) REFERENCES Channel(ID); ALTER TABLE Channel_Client ADD CONSTRAINT client_channel_fk FOREIGN KEY (clientID) REFERENCES Client(ID); ALTER TABLE Channel ADD CONSTRAINT fk_channel_app FOREIGN KEY (AppID) REFERENCES App(AppID); ALTER TABLE Client ADD CONSTRAINT fk_client_app FOREIGN KEY (AppID) REFERENCES App(AppID); ALTER TABLE Device ADD CONSTRAINT fk_device_client FOREIGN KEY (ClientID) REFERENCES Client(ID);
<gh_stars>100-1000 -- randexpr1.test -- -- db eval {SELECT (abs(13)/abs((select min(case when case when exists(select 1 from t1 where not exists(select 1 from t1 where (select count(distinct (t1.e)) from t1)+t1.f>t1.e) and t1.a>=13 or f in (select t1.e from t1 union select t1.e from t1)) then b when f not in (13,13,13) then coalesce((select max(d*f) from t1 where t1.e in (t1.d,t1.e,(e))),t1.e) else a end>=t1.f then b when t1.c in (e,f,t1.e) then b else t1.c end)*abs(count(*))-abs(~count(*)-min(e))-cast(avg(17) AS integer) from t1))) FROM t1 WHERE NOT (t1.b not in (a*17-17-case when -17-t1.f in (select coalesce((select t1.a from t1 where (d)=t1.a),d) from t1 union select 19 from t1) or 13 not between 17 and 13 and (19 between (t1.e) and t1.f) or ( -t1.e)>=17 then b when t1.d not in (19,f,t1.f) then a else case when t1.a=t1.d then e when 17 in (t1.e,t1.b,t1.d) then t1.a else a end end,e,11))} SELECT (abs(13)/abs((select min(case when case when exists(select 1 from t1 where not exists(select 1 from t1 where (select count(distinct (t1.e)) from t1)+t1.f>t1.e) and t1.a>=13 or f in (select t1.e from t1 union select t1.e from t1)) then b when f not in (13,13,13) then coalesce((select max(d*f) from t1 where t1.e in (t1.d,t1.e,(e))),t1.e) else a end>=t1.f then b when t1.c in (e,f,t1.e) then b else t1.c end)*abs(count(*))-abs(~count(*)-min(e))-cast(avg(17) AS integer) from t1))) FROM t1 WHERE NOT (t1.b not in (a*17-17-case when -17-t1.f in (select coalesce((select t1.a from t1 where (d)=t1.a),d) from t1 union select 19 from t1) or 13 not between 17 and 13 and (19 between (t1.e) and t1.f) or ( -t1.e)>=17 then b when t1.d not in (19,f,t1.f) then a else case when t1.a=t1.d then e when 17 in (t1.e,t1.b,t1.d) then t1.a else a end end,e,11))
ALTER TABLE "meals" DROP COLUMN "ate_at"; alter table meals drop constraint meals_name_key; DROP TABLE meal_photo; DROP TABLE gphotos_photos; DROP TABLE gphotos_albums;
<reponame>3etechinns/midpoint ALTER TABLE m_audit_delta ALTER COLUMN delta TYPE BLOB; ALTER TABLE m_audit_delta ALTER COLUMN fullResult TYPE BLOB;
<reponame>elyor0529/timescaledb -- This file and its contents are licensed under the Apache License 2.0. -- Please see the included NOTICE for copyright information and -- LICENSE-APACHE for a copy of the license. -- print chunks ordered by time to ensure ordering we want SELECT ht.table_name AS hypertable, c.table_name AS chunk, ds.range_start FROM _timescaledb_catalog.chunk c INNER JOIN LATERAL(SELECT * FROM _timescaledb_catalog.chunk_constraint cc WHERE c.id = cc.chunk_id ORDER BY cc.dimension_slice_id LIMIT 1) cc ON true INNER JOIN _timescaledb_catalog.dimension_slice ds ON ds.id=cc.dimension_slice_id INNER JOIN _timescaledb_catalog.dimension d ON ds.dimension_id = d.id INNER JOIN _timescaledb_catalog.hypertable ht ON d.hypertable_id = ht.id ORDER BY ht.table_name, range_start, chunk; -- test ASC for ordered chunks :PREFIX SELECT time, device_id, value FROM ordered_append ORDER BY time ASC LIMIT 1; -- test DESC for ordered chunks :PREFIX SELECT time, device_id, value FROM ordered_append ORDER BY time DESC LIMIT 1; -- test ASC for reverse ordered chunks :PREFIX SELECT time, device_id, value FROM ordered_append_reverse ORDER BY time ASC LIMIT 1; -- test DESC for reverse ordered chunks :PREFIX SELECT time, device_id, value FROM ordered_append_reverse ORDER BY time DESC LIMIT 1; -- test query with ORDER BY column not in targetlist :PREFIX SELECT device_id, value FROM ordered_append ORDER BY time ASC LIMIT 1; -- ORDER BY may include other columns after time column :PREFIX SELECT time, device_id, value FROM ordered_append ORDER BY time DESC, device_id LIMIT 1; -- test RECORD in targetlist :PREFIX SELECT (time, device_id, value) FROM ordered_append ORDER BY time DESC, device_id LIMIT 1; -- queries with ORDER BY non-time column shouldn't use ordered append :PREFIX SELECT time, device_id, value FROM ordered_append ORDER BY device_id LIMIT 1; -- time column must be primary sort order :PREFIX SELECT time, device_id, value FROM ordered_append ORDER BY device_id, time LIMIT 1; -- queries without LIMIT shouldnt use ordered append :PREFIX SELECT time, device_id, value FROM ordered_append ORDER BY time ASC; -- queries without ORDER BY shouldnt use ordered append (still uses append though) :PREFIX SELECT time, device_id, value FROM ordered_append LIMIT 1; -- test interaction with constraint exclusion :PREFIX SELECT time, device_id, value FROM ordered_append WHERE time > '2000-01-07' ORDER BY time ASC LIMIT 1; :PREFIX SELECT time, device_id, value FROM ordered_append WHERE time > '2000-01-07' ORDER BY time DESC LIMIT 1; -- test interaction with constraint aware append :PREFIX SELECT time, device_id, value FROM ordered_append WHERE time > now_s() ORDER BY time ASC LIMIT 1; :PREFIX SELECT time, device_id, value FROM ordered_append WHERE time < now_s() ORDER BY time ASC LIMIT 1; -- test constraint exclusion :PREFIX SELECT time, device_id, value FROM ordered_append WHERE time > now_s() AND time < '2000-01-10' ORDER BY time ASC LIMIT 1; :PREFIX SELECT time, device_id, value FROM ordered_append WHERE time < now_s() AND time > '2000-01-07' ORDER BY time ASC LIMIT 1; -- min/max queries :PREFIX SELECT max(time) FROM ordered_append; :PREFIX SELECT min(time) FROM ordered_append; -- test first/last (doesn't use ordered append yet) :PREFIX SELECT first(time, time) FROM ordered_append; :PREFIX SELECT last(time, time) FROM ordered_append; -- test query with time_bucket :PREFIX SELECT time_bucket('1d',time), device_id, value FROM ordered_append ORDER BY time ASC LIMIT 1; -- test query with order by time_bucket (should not use ordered append) :PREFIX SELECT time_bucket('1d',time), device_id, value FROM ordered_append ORDER BY 1 LIMIT 1; -- test query with order by time_bucket (should not use ordered append) :PREFIX SELECT time_bucket('1d',time), device_id, value FROM ordered_append ORDER BY time_bucket('1d',time) LIMIT 1; -- test query with now() should result in ordered append with constraint aware append :PREFIX SELECT * FROM ordered_append WHERE time < now() + '1 month' ORDER BY time DESC limit 1; -- test CTE :PREFIX WITH i AS (SELECT * FROM ordered_append WHERE time < now() ORDER BY time DESC limit 100) SELECT * FROM i; -- test LATERAL with ordered append in the outer query :PREFIX SELECT * FROM ordered_append, LATERAL(SELECT * FROM (VALUES (1),(2)) v) l ORDER BY time DESC limit 2; -- test LATERAL with ordered append in the lateral query :PREFIX SELECT * FROM (VALUES (1),(2)) v, LATERAL(SELECT * FROM ordered_append ORDER BY time DESC limit 2) l; -- test plan with best index is chosen -- this should use device_id, time index :PREFIX SELECT * FROM ordered_append WHERE device_id = 1 ORDER BY time DESC LIMIT 1; -- test plan with best index is chosen -- this should use time index :PREFIX SELECT * FROM ordered_append ORDER BY time DESC LIMIT 1; -- test with table with only dimension column :PREFIX SELECT * FROM dimension_only ORDER BY time DESC LIMIT 1; -- test LEFT JOIN against hypertable :PREFIX_NO_ANALYZE SELECT * FROM dimension_last LEFT JOIN dimension_only USING (time) ORDER BY dimension_last.time DESC LIMIT 2; -- test INNER JOIN against non-hypertable :PREFIX_NO_ANALYZE SELECT * FROM dimension_last INNER JOIN dimension_only USING (time) ORDER BY dimension_last.time DESC LIMIT 2; -- test join against non-hypertable :PREFIX SELECT * FROM dimension_last INNER JOIN devices USING(device_id) ORDER BY dimension_last.time DESC LIMIT 2; -- test hypertable with index missing on one chunk :PREFIX SELECT time, device_id, value FROM ht_missing_indexes ORDER BY time ASC LIMIT 1; -- test hypertable with index missing on one chunk -- and no data :PREFIX SELECT time, device_id, value FROM ht_missing_indexes WHERE device_id = 2 ORDER BY time DESC LIMIT 1; -- test hypertable with index missing on one chunk -- and no data :PREFIX SELECT time, device_id, value FROM ht_missing_indexes WHERE time > '2000-01-07' ORDER BY time LIMIT 10; -- test hypertable with dropped columns :PREFIX SELECT time, device_id, value FROM ht_dropped_columns ORDER BY time ASC LIMIT 1; -- test hypertable with dropped columns :PREFIX SELECT time, device_id, value FROM ht_dropped_columns WHERE device_id = 1 ORDER BY time DESC; -- test hypertable with space partitioning :PREFIX SELECT time, device_id, value FROM space ORDER BY time; -- test hypertable with space partitioning and reverse order :PREFIX SELECT time, device_id, value FROM space ORDER BY time DESC; -- test hypertable with space partitioning ORDER BY multiple columns -- does not use ordered append :PREFIX SELECT time, device_id, value FROM space ORDER BY time, device_id LIMIT 1; -- test hypertable with space partitioning ORDER BY non-time column -- does not use ordered append :PREFIX SELECT time, device_id, value FROM space ORDER BY device_id, time LIMIT 1; -- test hypertable with 2 space dimensions -- does not use ordered append :PREFIX SELECT time, device_id, value FROM space2 ORDER BY time DESC; -- test LATERAL with correlated query -- only last chunk should be executed :PREFIX SELECT * FROM generate_series('2000-01-01'::timestamptz,'2000-01-03','1d') AS g(time) LEFT OUTER JOIN LATERAL( SELECT * FROM ordered_append o WHERE o.time >= g.time AND o.time < g.time + '1d'::interval ORDER BY time DESC LIMIT 1 ) l ON true; -- test LATERAL with correlated query -- only 2nd chunk should be executed :PREFIX SELECT * FROM generate_series('2000-01-10'::timestamptz,'2000-01-11','1d') AS g(time) LEFT OUTER JOIN LATERAL( SELECT * FROM ordered_append o WHERE o.time >= g.time AND o.time < g.time + '1d'::interval ORDER BY time LIMIT 1 ) l ON true; -- test startup and runtime exclusion together :PREFIX SELECT * FROM generate_series('2000-01-01'::timestamptz,'2000-01-03','1d') AS g(time) LEFT OUTER JOIN LATERAL( SELECT * FROM ordered_append o WHERE o.time >= g.time AND o.time < g.time + '1d'::interval AND o.time < now() ORDER BY time DESC LIMIT 1 ) l ON true; -- test startup and runtime exclusion together -- all chunks should be filtered :PREFIX SELECT * FROM generate_series('2000-01-01'::timestamptz,'2000-01-03','1d') AS g(time) LEFT OUTER JOIN LATERAL( SELECT * FROM ordered_append o WHERE o.time >= g.time AND o.time < g.time + '1d'::interval AND o.time > now() ORDER BY time DESC LIMIT 1 ) l ON true; -- test CTE -- no chunk exclusion for CTE because cte query is not pulled up :PREFIX WITH cte AS (SELECT * FROM ordered_append ORDER BY time) SELECT * FROM cte WHERE time < '2000-02-01'::timestamptz; -- test JOIN -- no exclusion on joined table because its not ChunkAppend node :PREFIX SELECT * FROM ordered_append o1 INNER JOIN ordered_append o2 ON o1.time = o2.time WHERE o1.time < '2000-02-01' ORDER BY o1.time; -- test JOIN -- last chunk of o2 should not be executed :PREFIX SELECT * FROM ordered_append o1 INNER JOIN (SELECT * FROM ordered_append o2 ORDER BY time) o2 ON o1.time = o2.time WHERE o1.time < '2000-01-08' ORDER BY o1.time; -- test subquery -- not ChunkAppend so no chunk exclusion :PREFIX SELECT * FROM ordered_append WHERE time = (SELECT max(time) FROM ordered_append) ORDER BY time; -- test join against max query -- not ChunkAppend so no chunk exclusion :PREFIX SELECT * FROM ordered_append o1 INNER JOIN (SELECT max(time) AS max_time FROM ordered_append) o2 ON o1.time = o2.max_time ORDER BY time; -- test ordered append with limit expression :PREFIX SELECT * FROM ordered_append ORDER BY time LIMIT (SELECT length('four')); -- test with ordered guc disabled SET timescaledb.enable_ordered_append TO off; :PREFIX SELECT * FROM ordered_append ORDER BY time LIMIT 3; RESET timescaledb.enable_ordered_append; :PREFIX SELECT * FROM ordered_append ORDER BY time LIMIT 3; -- test with chunk append disabled SET timescaledb.enable_chunk_append TO off; :PREFIX SELECT * FROM ordered_append ORDER BY time LIMIT 3; RESET timescaledb.enable_chunk_append; :PREFIX SELECT * FROM ordered_append ORDER BY time LIMIT 3; -- test space partitioning with startup exclusion :PREFIX SELECT * FROM space WHERE time < now() ORDER BY time; -- test runtime exclusion together with space partitioning :PREFIX SELECT * FROM generate_series('2000-01-01'::timestamptz,'2000-01-03','1d') AS g(time) LEFT OUTER JOIN LATERAL( SELECT * FROM space o WHERE o.time >= g.time AND o.time < g.time + '1d'::interval ORDER BY time DESC LIMIT 1 ) l ON true; -- test startup and runtime exclusion together with space partitioning :PREFIX SELECT * FROM generate_series('2000-01-01'::timestamptz,'2000-01-03','1d') AS g(time) LEFT OUTER JOIN LATERAL( SELECT * FROM space o WHERE o.time >= g.time AND o.time < g.time + '1d'::interval AND o.time < now() ORDER BY time DESC LIMIT 1 ) l ON true;
<reponame>isabella232/propagator<gh_stars>10-100 alter table propagate_script_instance_deployment add column manual_approved tinyint unsigned default 0; alter table database_role add column has_schema tinyint unsigned default 1; CREATE TABLE `database_role_known_deploy_schema` ( `database_role_id` varchar(32) CHARACTER SET ascii NOT NULL, `known_deploy_schema_id` int(10) unsigned NOT NULL, `is_default` tinyint(3) unsigned DEFAULT '0', PRIMARY KEY (`database_role_id`,`known_deploy_schema_id`), KEY `schema_idx` (`known_deploy_schema_id`), CONSTRAINT `role_schema_known_deploy_schema_id_fk` FOREIGN KEY (`known_deploy_schema_id`) REFERENCES `known_deploy_schema` (`known_deploy_schema_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `role_schema_database_role_id_fk` FOREIGN KEY (`database_role_id`) REFERENCES `database_role` (`database_role_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
SELECT tab0.v1 AS v1 , tab7.v0 AS v0 , tab6.v7 AS v7 , tab4.v5 AS v5 , tab5.v6 AS v6 , tab3.v4 AS v4 , tab2.v3 AS v3 , tab1.v2 AS v2 FROM (SELECT sub AS v0 FROM wsdbm__hasGenre$$8$$ WHERE obj = 'wsdbm:SubGenre73' ) tab7 JOIN (SELECT obj AS v1 , sub AS v0 FROM foaf__homepage$$1$$ ) tab0 ON(tab7.v0=tab0.v0) JOIN (SELECT sub AS v0 , obj AS v4 FROM sorg__caption$$4$$ ) tab3 ON(tab0.v0=tab3.v0) JOIN (SELECT sub AS v0 , obj AS v5 FROM sorg__description$$5$$ ) tab4 ON(tab3.v0=tab4.v0) JOIN (SELECT sub AS v0 , obj AS v2 FROM og__title$$2$$ ) tab1 ON(tab4.v0=tab1.v0) JOIN (SELECT sub AS v0 , obj AS v3 FROM rdf__type$$3$$ ) tab2 ON(tab1.v0=tab2.v0) JOIN (SELECT sub AS v1 , obj AS v6 FROM sorg__url$$6$$ ) tab5 ON(tab0.v1=tab5.v1) JOIN (SELECT sub AS v1 , obj AS v7 FROM wsdbm__hits$$7$$ ) tab6 ON(tab5.v1=tab6.v1) ++++++Tables Statistic sorg__url$$6$$ 1 SO sorg__url/foaf__homepage VP <sorg__url> 500000 SO <sorg__url><foaf__homepage> 497821 1.0 SS <sorg__url><wsdbm__hits> 500000 1.0 ------ sorg__description$$5$$ 4 SS sorg__description/sorg__caption VP <sorg__description> 1502748 SS <sorg__description><foaf__homepage> 376154 0.25 SS <sorg__description><og__title> 1502748 1.0 SS <sorg__description><rdf__type> 1502748 1.0 SS <sorg__description><sorg__caption> 149706 0.1 SS <sorg__description><wsdbm__hasGenre> 1502748 1.0 ------ wsdbm__hasGenre$$8$$ 4 SS wsdbm__hasGenre/sorg__caption VP <wsdbm__hasGenre> 5936571 SS <wsdbm__hasGenre><foaf__homepage> 1486716 0.25 SS <wsdbm__hasGenre><og__title> 5936571 1.0 SS <wsdbm__hasGenre><rdf__type> 5936571 1.0 SS <wsdbm__hasGenre><sorg__caption> 593980 0.1 SS <wsdbm__hasGenre><sorg__description> 3567731 0.6 ------ rdf__type$$3$$ 3 SS rdf__type/sorg__caption VP <rdf__type> 14800449 SS <rdf__type><foaf__homepage> 1231731 0.08 SS <rdf__type><og__title> 2500000 0.17 SS <rdf__type><sorg__caption> 250207 0.02 SS <rdf__type><sorg__description> 1502748 0.1 SS <rdf__type><wsdbm__hasGenre> 2500000 0.17 ------ wsdbm__hits$$7$$ 1 SO wsdbm__hits/foaf__homepage VP <wsdbm__hits> 500000 SO <wsdbm__hits><foaf__homepage> 497821 1.0 SS <wsdbm__hits><sorg__url> 500000 1.0 ------ sorg__caption$$4$$ 1 SS sorg__caption/foaf__homepage VP <sorg__caption> 250207 SS <sorg__caption><foaf__homepage> 62657 0.25 SS <sorg__caption><og__title> 250207 1.0 SS <sorg__caption><rdf__type> 250207 1.0 SS <sorg__caption><sorg__description> 149706 0.6 SS <sorg__caption><wsdbm__hasGenre> 250207 1.0 ------ og__title$$2$$ 3 SS og__title/sorg__caption VP <og__title> 2500000 SS <og__title><foaf__homepage> 626158 0.25 SS <og__title><rdf__type> 2500000 1.0 SS <og__title><sorg__caption> 250207 0.1 SS <og__title><sorg__description> 1502748 0.6 SS <og__title><wsdbm__hasGenre> 2500000 1.0 ------ foaf__homepage$$1$$ 3 SS foaf__homepage/sorg__caption VP <foaf__homepage> 1118496 SS <foaf__homepage><og__title> 626158 0.56 SS <foaf__homepage><rdf__type> 1118496 1.0 SS <foaf__homepage><sorg__caption> 62657 0.06 SS <foaf__homepage><sorg__description> 376154 0.34 OS <foaf__homepage><sorg__url> 1118496 1.0 OS <foaf__homepage><wsdbm__hits> 1118496 1.0 SS <foaf__homepage><wsdbm__hasGenre> 626158 0.56 ------
-- Name: GetPopupDefinition -- Schema: posda_queries -- Columns: ['command_line', 'input_line_format', 'operation_name', 'operation_type', 'tags'] -- Args: ['operation_name'] -- Tags: ['NotInteractive', 'used_in_process_popup'] -- Description: N -- o -- n -- e select command_line, input_line_format, operation_name, operation_type, tags from spreadsheet_operation where operation_name = ?
<gh_stars>10-100 select title, region, tenant_id from oci.oci_logging_log where name = '{{ output.display_name.value }}';
<filename>tests/libs/hdf5/test-h5-wrappers/1_8/C/H5T/testfiles/h5ex_t_cpxcmpdatt.ddl HDF5 "h5ex_t_cpxcmpdatt.h5" { FILE_CONTENTS { group / group /Air_Vehicles dataset /Ambient_Temperature dataset /DS1 group /Land_Vehicles } }
-- this is a db script for init CREATE DATABASE `manager`; use `manager`; CREATE TABLE `routes` ( `id` varchar(64) NOT NULL unique, `name` varchar(200) NOT NULL unique, -- not support yet `description` varchar(200) DEFAULT NULL, `hosts` text, `uris` text, `upstream_nodes` text, `upstream_id` varchar(64) , -- fk `priority` int NOT NULL DEFAULT 0, `state` int NOT NULL DEFAULT 1, -- 1-normal 0-disable `content` text, `script` text, `content_admin_api` text, `create_time` bigint(20), `update_time` bigint(20), `route_group_id` varchar(64) NOT NULL, `route_group_name` varchar(64) NOT NULL, PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; CREATE TABLE `ssls` ( `id` char(36) NOT NULL DEFAULT '', `public_key` text NOT NULL, `snis` text NOT NULL, `validity_start` bigint(20) unsigned NOT NULL, `validity_end` bigint(20) unsigned NOT NULL, `status` tinyint(1) unsigned NOT NULL DEFAULT '1', `create_time` bigint(20) unsigned NOT NULL, `update_time` bigint(20) unsigned NOT NULL, `public_key_hash` varchar(64) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `uni_public_key_hash` (`public_key_hash`) ) DEFAULT CHARSET=utf8; -- upstream CREATE TABLE `upstreams` ( `id` varchar(64) NOT NULL unique, `name` varchar(200) NOT NULL unique, -- not support `description` varchar(200) DEFAULT NULL, `nodes` text, `content` text, `content_admin_api` text, `create_time` bigint(20), `update_time` bigint(20), PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; CREATE TABLE `consumers` ( `id` char(36) NOT NULL DEFAULT '', `username` varchar(100) DEFAULT '', `plugins` text, `desc` varchar(200) DEFAULT '', `create_time` int(10) unsigned NOT NULL, `update_time` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uni_username` (`username`) ) DEFAULT CHARSET=utf8; -- route_group CREATE TABLE `route_group` ( `id` varchar(64) NOT NULL unique, `name` varchar(200) NOT NULL unique, `description` varchar(200) DEFAULT NULL, `create_time` bigint(20), `update_time` bigint(20), PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8;
-- ====================== -- -- Apply User Privileges -- ====================== -- GRANT ALL PRIVILEGES ON flyboy.* TO flyfAdmin@'%'; GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,SHOW VIEW, LOCK TABLES ON flyboy.* TO flyfApp@'%'; GRANT SELECT,SHOW VIEW,EXECUTE ON flyboy.* TO flyfRead@'%'; GRANT DROP ON flyboy.__Flystocks_Stock_Staging TO flyfApp@'%';
set system parameters 'allow_truncated_string=yes'; ---------- CREATE TABLE ... DEFAULT ... ---------- INSERT INTO ... VALUES ... -- precision > value : OK drop table if exists t1; create table t1 (col1 int, col2 varchar(5) default 'abc'); show columns from t1; insert into t1 (col1) values (1), (2); select * from t1 order by 1; -- precision = value : OK drop table if exists t1; create table t1 (col1 int, col2 varchar(5) default 'abcde'); show columns from t1; insert into t1 (col1) values (1), (2); select * from t1 order by 1; -- precision < value :data overflow drop table if exists t1; create table t1 (col1 int, col2 varchar(5) default 'abcde12'); show columns from t1; insert into t1 (col1) values (1), (2); select * from t1 order by 1; drop table t1; set system parameters 'allow_truncated_string=no';
CREATE TABLE `blip` ( `id` TEXT NOT NULL UNIQUE, `name` TEXT NOT NULL UNIQUE, `description` TEXT NOT NULL, `creator` TEXT NOT NULL, `angle` TEXT NOT NULL, `offset` NUMERIC NOT NULL, `timestamp` NUMERIC NOT NULL, `quadrant` TEXT NOT NULL, PRIMARY KEY(`id`) ); CREATE TABLE `vote` ( `id` TEXT NOT NULL, `user` TEXT NOT NULL, `isUpVote` INTEGER NOT NULL );
DROP FUNCTION IF EXISTS read_hive_inspection_group; CREATE FUNCTION read_hive_inspection_group ( IN user_id INT , IN id INT ) RETURNS SETOF hive_inspection_groups AS $body$ BEGIN IF permission_check_hive_inspection_group(set_user_id(read_hive_inspection_group.user_id), read_hive_inspection_group.id) THEN RETURN QUERY SELECT hig.id , hig.farm_id , hig.notes , hig.created_date , hig.modified_date FROM hive_inspection_groups AS hig WHERE hig.id = read_hive_inspection_group.id; END IF; END $body$ LANGUAGE plpgsql;
<gh_stars>0 /* SQLyog Ultimate v12.5.1 (64 bit) MySQL - 5.5.62 : Database - db_ultimate246 ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*Table structure for table `footer_details` */ DROP TABLE IF EXISTS `footer_details`; CREATE TABLE `footer_details` ( `id` int(191) NOT NULL AUTO_INCREMENT, `shop_id` int(11) NOT NULL, `title` varchar(55) DEFAULT NULL, `content` varchar(191) DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '1', `link` varchar(191) DEFAULT NULL, `picture` varchar(191) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*Data for the table `footer_details` */ insert into `footer_details`(`id`,`shop_id`,`title`,`content`,`status`,`link`,`picture`,`created_at`,`updated_at`) values (2,2,NULL,'aaa',1,'http://tst',NULL,'2019-09-06 02:04:16','2019-09-06 02:14:52'), (3,2,NULL,'qwer qerqwer qwer',1,'http://tstww',NULL,'2019-09-06 02:16:35','2019-09-06 02:16:35'); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
use herytoavina_covid; create table type( IDType int auto_increment, nom varchar(50), primary key (IDType) ); create table info ( IDInfo int auto_increment, IDtype int, nombre int, dateInfo datetime, primary key (IDInfo), foreign key (IDtype) references type(IDType) ); insert into type (nom) values ('Nouveaux cas'); insert into type (nom) values ('Gueris'); insert into type (nom) values ('Deces'); insert into type (nom) values ('En traitement'); insert into type (nom) values ('Formes graves'); insert into type (nom) values ('Test');
<filename>src/models/prisma/migrations/20210413023543_create_email_pass/migration.sql -- RedefineTables PRAGMA foreign_keys=OFF; CREATE TABLE "new_profile" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "email" TEXT NOT NULL DEFAULT 'null', "password" TEXT NOT NULL DEFAULT '<PASSWORD>', "name" TEXT, "avatar" TEXT, "monthly_budget" INTEGER, "days_per_week" INTEGER, "hours_per_day" INTEGER, "vacation_per_year" INTEGER, "value_hour" REAL ); INSERT INTO "new_profile" ("id", "name", "avatar", "monthly_budget", "days_per_week", "hours_per_day", "vacation_per_year", "value_hour") SELECT "id", "name", "avatar", "monthly_budget", "days_per_week", "hours_per_day", "vacation_per_year", "value_hour" FROM "profile"; DROP TABLE "profile"; ALTER TABLE "new_profile" RENAME TO "profile"; CREATE UNIQUE INDEX "profile.email_unique" ON "profile"("email"); PRAGMA foreign_key_check; PRAGMA foreign_keys=ON;
CREATE TABLE measurement ( measurement_id INTEGER NOT NULL , person_id INTEGER NOT NULL , measurement_concept_id INTEGER NOT NULL , measurement_date DATE NOT NULL , measurement_datetime DATETIME2 NULL , measurement_type_concept_id INTEGER NOT NULL , operator_concept_id INTEGER NULL , value_as_number FLOAT NULL , value_as_concept_id INTEGER NULL , unit_concept_id INTEGER NULL , range_low FLOAT NULL , range_high FLOAT NULL , provider_id INTEGER NULL , visit_occurrence_id INTEGER NULL , measurement_source_value VARCHAR(50) NULL , measurement_source_concept_id INTEGER NULL , unit_source_value VARCHAR(50) NULL , value_source_value VARCHAR(50) NULL ) ;
INSERT INTO [dbo].[AccrualTypes] VALUES (N'd739e49d-6219-46e1-968d-498e80a5681c', N'Аренда'), (N'0bbb6a2e-edb4-463b-8abd-4b027655bf7f', N'Капремонт'), (N'ebd24155-b44f-4f61-a521-ba39e883fa4b', N'Техобслуживание'), (N'5b100473-d044-41a7-91f7-4488a24b6ff4', N'Электроэнергия'), (N'8f6a3257-a12a-4abf-9b41-0e4c2ccc0969', N'Вода'), (N'6779f931-82ca-4895-8f36-0f099537940a', N'Мусор'), (N'd68ad9ef-e483-4a3b-ad48-c06b9f59a28c', N'Тепло');
create table "postgres".test_normalization."conflict_stream_name___conflict_stream_name__dbt_tmp" as ( with __dbt__cte__conflict_stream_name___conflict_stream_name_ab1 as ( -- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema -- depends_on: "postgres".test_normalization."conflict_stream_name_conflict_stream_name" select _airbyte_conflict_stream_name_2_hashid, jsonb_extract_path_text(conflict_stream_name, 'groups') as groups, _airbyte_ab_id, _airbyte_emitted_at, now() as _airbyte_normalized_at from "postgres".test_normalization."conflict_stream_name_conflict_stream_name" as table_alias -- conflict_stream_name at conflict_stream_name/conflict_stream_name/conflict_stream_name where 1 = 1 and conflict_stream_name is not null ), __dbt__cte__conflict_stream_name___conflict_stream_name_ab2 as ( -- SQL model to cast each column to its adequate SQL type converted from the JSON schema type -- depends_on: __dbt__cte__conflict_stream_name___conflict_stream_name_ab1 select _airbyte_conflict_stream_name_2_hashid, cast(groups as text) as groups, _airbyte_ab_id, _airbyte_emitted_at, now() as _airbyte_normalized_at from __dbt__cte__conflict_stream_name___conflict_stream_name_ab1 -- conflict_stream_name at conflict_stream_name/conflict_stream_name/conflict_stream_name where 1 = 1 ), __dbt__cte__conflict_stream_name___conflict_stream_name_ab3 as ( -- SQL model to build a hash column based on the values of this record -- depends_on: __dbt__cte__conflict_stream_name___conflict_stream_name_ab2 select md5(cast(coalesce(cast(_airbyte_conflict_stream_name_2_hashid as text), '') || '-' || coalesce(cast(groups as text), '') as text)) as _airbyte_conflict_stream_name_3_hashid, tmp.* from __dbt__cte__conflict_stream_name___conflict_stream_name_ab2 tmp -- conflict_stream_name at conflict_stream_name/conflict_stream_name/conflict_stream_name where 1 = 1 )-- Final base SQL model -- depends_on: __dbt__cte__conflict_stream_name___conflict_stream_name_ab3 select _airbyte_conflict_stream_name_2_hashid, groups, _airbyte_ab_id, _airbyte_emitted_at, now() as _airbyte_normalized_at, _airbyte_conflict_stream_name_3_hashid from __dbt__cte__conflict_stream_name___conflict_stream_name_ab3 -- conflict_stream_name at conflict_stream_name/conflict_stream_name/conflict_stream_name from "postgres".test_normalization."conflict_stream_name_conflict_stream_name" where 1 = 1 );
<filename>scripts/perf/save_profile.sql<gh_stars>1-10 Use the CREATE_STGTAB_SQLPROF procedure to create a staging table where the SQL profiles will be exported. The following example creates my_staging_table in the DBA1 schema: BEGIN DBMS_SQLTUNE.create_stgtab_sqlprof( table_name => 'my_staging_table', schema_name => 'DBA1' ); END; / Use the PACK_STGTAB_SQLPROF procedure to export SQL profiles into the staging table. The following example populates dba1.my_staging_table with the SQL profile my_profile: BEGIN DBMS_SQLTUNE.pack_stgtab_sqlprof( profile_name => 'my_profile', staging_table_name => 'my_staging_table', staging_schema_owner => 'dba1' ); END; / Move the staging table to the database where the SQL profiles will be imported using the mechanism of choice (such as Oracle Data Pump or database link). On the database where the SQL profiles will be imported, use the UNPACK_STGTAB_SQLPROF procedure to import SQL profiles from the staging table. The following example shows how to import SQL profiles contained in the staging table: BEGIN DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF( replace => TRUE, staging_table_name => 'my_staging_table'); END; / select * from dba_sql_profiles where name = 'SYS_SQLPROF_013c4e0be23a0000'; exec dbms_sqltune.create_stgtab_sqlprof(table_name => 'SQL_PROFILES', schema_name => 'TESTER'); exec dbms_sqltune.pack_stgtab_sqlprof(profile_name => 'SYS_SQLPROF_013c4e0be23a0000', staging_table_name => 'SQL_PROFILES', staging_schema_owner => 'TESTER'); --Annotation: exec dbms_sqltune.create_stgtab_sqlprof(table_name => 'SQL_PROFILES', schema_name => 'GG_EDITORIAL'); exec dbms_sqltune.unpack_stgtab_sqlprof(replace => TRUE, staging_table_name => 'SQL_PROFILES', staging_schema_owner => 'GG_EDITORIAL'); execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_135584', task_owner => 'SYSTEM', replace => TRUE);
<filename>workloadsyndemo/dbo/Tables/FactSalesQuota.sql<gh_stars>1-10 CREATE TABLE [dbo].[FactSalesQuota] ( [SalesQuotaKey] INT NULL, [EmployeeKey] INT NULL, [DateKey] INT NULL, [CalendarYear] INT NULL, [CalendarQuarter] INT NULL, [SalesAmountQuota] DECIMAL (38, 18) NULL, [Date] DATETIME2 (7) NULL ) WITH (CLUSTERED COLUMNSTORE INDEX, DISTRIBUTION = ROUND_ROBIN);
<filename>doc/reports/biorepository_breast_cases_abstracted_v3.sql<gh_stars>1-10 -- "has_cancer_site" -- "has_cancer_site_laterality" -- "has_cancer_histology" -- "has_cancer_recurrence_status" -- "has_cancer_pathologic_sbr_grade" -- -- "has_surgery_date" -- -- "has_metastatic_cancer_histology" -- "has_metastatic_cancer_primary_site" -- -- "pathological_tumor_staging_category" -- "pathological_nodes_staging_category" -- "pathological_metastasis_staging_category" -- "has_tumor_size" -- -- select * -- from cancer_diagnosis_abstractions DROP TABLE IF EXISTS cancer_diagnosis_abstractions; CREATE TEMPORARY TABLE cancer_diagnosis_abstractions ( person_source_value varchar(50) NULL, id BIGINT NOT NULL, note_id BIGINT NOT NULL, stable_identifier_path varchar(255) NULL, stable_identifier_value varchar(255) NULL, subject_id BIGINT NOT NULL, procedure_occurrence_stable_identifier_path varchar(255) NULL, procedure_occurrence_stable_identifier_value varchar(255) NULL, procedure_date date NULL, note_text text NULL, has_cancer_histology varchar(255) NULL, has_cancer_histology_suggestions text NULL, has_cancer_site varchar(255) NULL, has_cancer_site_suggestions text NULL, has_cancer_site_laterality varchar(255) NULL, has_cancer_pathologic_sbr_grade varchar(255) NULL, has_cancer_recurrence_status varchar(255) NULL, has_metastatic_cancer_histology varchar(255) NULL, has_metastatic_cancer_site varchar(255) NULL, has_metastatic_cancer_primary_site varchar(255) NULL, has_metastatic_cancer_site_laterality varchar(255) NULL, has_metastatic_cancer_recurrence_status varchar(255) NULL ); INSERT INTO cancer_diagnosis_abstractions ( person_source_value , id , note_id , stable_identifier_path , stable_identifier_value , subject_id , procedure_occurrence_stable_identifier_path , procedure_occurrence_stable_identifier_value , procedure_date , note_text , has_cancer_histology , has_cancer_histology_suggestions , has_cancer_site , has_cancer_site_suggestions , has_cancer_site_laterality , has_cancer_pathologic_sbr_grade , has_cancer_recurrence_status , has_metastatic_cancer_histology , has_metastatic_cancer_site , has_metastatic_cancer_primary_site , has_metastatic_cancer_site_laterality , has_metastatic_cancer_recurrence_status ) SELECT person_source_value , id , note_id , stable_identifier_path , stable_identifier_value , subject_id , procedure_occurrence_stable_identifier_path , procedure_occurrence_stable_identifier_value , procedure_date , note_text , has_cancer_histology , has_cancer_histology_suggestions , has_cancer_site , has_cancer_site_suggestions , has_cancer_site_laterality , has_cancer_pathologic_sbr_grade , has_cancer_recurrence_status , has_metastatic_cancer_histology , has_metastatic_cancer_site , has_metastatic_cancer_primary_site , has_metastatic_cancer_site_laterality , has_metastatic_cancer_recurrence_status FROM( SELECT person.person_source_value , note_stable_identifier.id , note_stable_identifier.note_id , note_stable_identifier.stable_identifier_path , note_stable_identifier.stable_identifier_value , primary_pivoted_abstractions.subject_id , procedure_occurrence_stable_identifier.stable_identifier_path AS procedure_occurrence_stable_identifier_path , procedure_occurrence_stable_identifier.stable_identifier_value_1 AS procedure_occurrence_stable_identifier_value , procedure_occurrence.procedure_date , note.note_text , primary_pivoted_abstractions.has_cancer_histology , CASE WHEN primary_pivoted_abstractions.has_cancer_histology IS NULL THEN array_to_string(array( SELECT asg2.suggested_value FROM abstractor_abstractions aa2 JOIN abstractor_suggestions asg2 on aa2.id = asg2.abstractor_abstraction_id JOIN abstractor_subjects asb2 ON aa2.abstractor_subject_id = asb2.id JOIN abstractor_abstraction_schemas aas2 ON asb2.abstractor_abstraction_schema_id = aas2.id JOIN abstractor_abstraction_group_members aagm ON aa2.id = aagm.abstractor_abstraction_id JOIN abstractor_abstraction_groups aag ON aagm.abstractor_abstraction_group_id = aag.id JOIN abstractor_subject_groups asg ON aag.abstractor_subject_group_id = asg.id WHERE aa2.about_id = primary_pivoted_abstractions.about_id AND aas2.predicate = 'has_cancer_histology' AND asg2.suggested_value IS NOT NULL AND asg.name = 'Primary Cancer' ), ', ') ELSE NULL END AS has_cancer_histology_suggestions , primary_pivoted_abstractions.has_cancer_site , CASE WHEN primary_pivoted_abstractions.has_cancer_site IS NULL THEN array_to_string(array( SELECT asg2.suggested_value FROM abstractor_abstractions aa2 JOIN abstractor_suggestions asg2 on aa2.id = asg2.abstractor_abstraction_id JOIN abstractor_subjects asb2 ON aa2.abstractor_subject_id = asb2.id JOIN abstractor_abstraction_schemas aas2 ON asb2.abstractor_abstraction_schema_id = aas2.id JOIN abstractor_abstraction_group_members aagm ON aa2.id = aagm.abstractor_abstraction_id JOIN abstractor_abstraction_groups aag ON aagm.abstractor_abstraction_group_id = aag.id JOIN abstractor_subject_groups asg ON aag.abstractor_subject_group_id = asg.id WHERE aa2.about_id = primary_pivoted_abstractions.about_id AND aas2.predicate = 'has_cancer_site' AND asg2.suggested_value IS NOT NULL AND asg.name = 'Primary Cancer' ), ', ') ELSE NULL END AS has_cancer_site_suggestions , primary_pivoted_abstractions.has_cancer_site_laterality , primary_pivoted_abstractions.has_cancer_pathologic_sbr_grade , primary_pivoted_abstractions.has_cancer_recurrence_status , metastatic_pivoted_abstractions.has_metastatic_cancer_histology , CASE WHEN metastatic_pivoted_abstractions.has_metastatic_cancer_histology IS NULL THEN array_to_string(array( SELECT asg2.suggested_value FROM abstractor_abstractions aa2 JOIN abstractor_suggestions asg2 on aa2.id = asg2.abstractor_abstraction_id JOIN abstractor_subjects asb2 ON aa2.abstractor_subject_id = asb2.id JOIN abstractor_abstraction_schemas aas2 ON asb2.abstractor_abstraction_schema_id = aas2.id WHERE aa2.about_id = metastatic_pivoted_abstractions.about_id AND aas2.predicate = 'has_metastatic_cancer_histology' AND asg2.suggested_value IS NOT NULL ), ', ') ELSE NULL END AS has_metastatic_cancer_histology_suggestions , metastatic_pivoted_abstractions.has_metastatic_cancer_site , CASE WHEN metastatic_pivoted_abstractions.has_metastatic_cancer_site IS NULL THEN array_to_string(array( SELECT asg2.suggested_value FROM abstractor_abstractions aa2 JOIN abstractor_suggestions asg2 on aa2.id = asg2.abstractor_abstraction_id JOIN abstractor_subjects asb2 ON aa2.abstractor_subject_id = asb2.id JOIN abstractor_abstraction_schemas aas2 ON asb2.abstractor_abstraction_schema_id = aas2.id JOIN abstractor_abstraction_group_members aagm ON aa2.id = aagm.abstractor_abstraction_id JOIN abstractor_abstraction_groups aag ON aagm.abstractor_abstraction_group_id = aag.id JOIN abstractor_subject_groups asg ON aag.abstractor_subject_group_id = asg.id WHERE aa2.about_id = metastatic_pivoted_abstractions.about_id AND aas2.predicate = 'has_cancer_site' AND asg2.suggested_value IS NOT NULL AND asg.name = 'Metastatic Cancer' ), ', ') ELSE NULL END AS has_metastatic_cancer_site_suggestions , metastatic_pivoted_abstractions.has_metastatic_cancer_primary_site , metastatic_pivoted_abstractions.has_metastatic_cancer_site_laterality , metastatic_pivoted_abstractions.has_metastatic_cancer_recurrence_status FROM note_stable_identifier JOIN ( SELECT note_stable_identifier.id AS subject_id, Max(CASE WHEN data_primary.predicate = 'has_cancer_histology' THEN data_primary.value ELSE NULL END) AS has_cancer_histology, Max(CASE WHEN data_primary.predicate = 'has_cancer_site' THEN data_primary.value ELSE NULL END) AS has_cancer_site, Max(CASE WHEN data_primary.predicate = 'has_cancer_site_laterality' THEN data_primary.value ELSE NULL END) AS has_cancer_site_laterality, Max(CASE WHEN data_primary.predicate = 'has_cancer_pathologic_sbr_grade' THEN data_primary.value ELSE NULL END) AS has_cancer_pathologic_sbr_grade, Max(CASE WHEN data_primary.predicate = 'has_cancer_recurrence_status' THEN data_primary.value ELSE NULL END) AS has_cancer_recurrence_status, abstractor_subject_group_id, about_id FROM (SELECT aas.predicate, aas.id AS abstraction_schema_id, asb.subject_type, aa.about_id, CASE WHEN aa.value IS NOT NULL AND aa.value != '' THEN aa.value WHEN aa.unknown = true THEN 'unknown' WHEN aa.not_applicable = true THEN 'not applicable' END AS value, aag.id AS abstractor_abstraction_group_id, abstractor_subject_group_id FROM abstractor_abstractions aa JOIN abstractor_subjects asb ON aa.abstractor_subject_id = asb.id JOIN abstractor_abstraction_schemas aas ON asb.abstractor_abstraction_schema_id = aas.id JOIN abstractor_abstraction_group_members aagm ON aa.id = aagm.abstractor_abstraction_id JOIN abstractor_abstraction_groups aag ON aagm.abstractor_abstraction_group_id = aag.id JOIN abstractor_subject_groups asg ON aag.abstractor_subject_group_id = asg.id WHERE asb.subject_type = 'NoteStableIdentifier' AND asb.namespace_type = 'Abstractor::AbstractorNamespace' AND asb.namespace_id = (SELECT id FROM abstractor_namespaces WHERE name = 'Surgical Pathology' ) AND asg.name = 'Primary Cancer' /*AND aag.abstractor_subject_group_id = 1*/) data_primary JOIN note_stable_identifier ON data_primary.about_id = note_stable_identifier.id GROUP BY note_stable_identifier.id, abstractor_abstraction_group_id, abstractor_subject_group_id, data_primary.about_id) primary_pivoted_abstractions ON primary_pivoted_abstractions.subject_id = note_stable_identifier.id JOIN ( SELECT note_stable_identifier.id AS subject_id, Max(CASE WHEN data.predicate = 'has_metastatic_cancer_histology' THEN data.value ELSE NULL END) AS has_metastatic_cancer_histology, Max(CASE WHEN data.predicate = 'has_cancer_site' THEN data.value ELSE NULL END) AS has_metastatic_cancer_site, Max(CASE WHEN data.predicate = 'has_metastatic_cancer_primary_site' THEN data.value ELSE NULL END) AS has_metastatic_cancer_primary_site, Max(CASE WHEN data.predicate = 'has_cancer_site_laterality' THEN data.value ELSE NULL END) AS has_metastatic_cancer_site_laterality, Max(CASE WHEN data.predicate = 'has_cancer_recurrence_status' THEN data.value ELSE NULL END) AS has_metastatic_cancer_recurrence_status, abstractor_subject_group_id, about_id FROM (SELECT aas.predicate, aas.id AS abstraction_schema_id, asb.subject_type, aa.about_id, CASE WHEN aa.value IS NOT NULL AND aa.value != '' THEN aa.value WHEN aa.unknown = true THEN 'unknown' WHEN aa.not_applicable = true THEN 'not applicable' END AS value, aag.id AS abstractor_abstraction_group_id, abstractor_subject_group_id FROM abstractor_abstractions aa JOIN abstractor_subjects asb ON aa.abstractor_subject_id = asb.id JOIN abstractor_abstraction_schemas aas ON asb.abstractor_abstraction_schema_id = aas.id JOIN abstractor_abstraction_group_members aagm ON aa.id = aagm.abstractor_abstraction_id JOIN abstractor_abstraction_groups aag ON aagm.abstractor_abstraction_group_id = aag.id JOIN abstractor_subject_groups asg ON aag.abstractor_subject_group_id = asg.id WHERE asb.subject_type = 'NoteStableIdentifier' AND asb.namespace_type = 'Abstractor::AbstractorNamespace' AND asb.namespace_id = (SELECT id FROM abstractor_namespaces WHERE name = 'Surgical Pathology' ) AND asg.name = 'Metastatic Cancer' /*AND aag.abstractor_subject_group_id = 1*/) data JOIN note_stable_identifier ON data.about_id = note_stable_identifier.id GROUP BY note_stable_identifier.id, abstractor_abstraction_group_id, abstractor_subject_group_id, about_id) metastatic_pivoted_abstractions ON metastatic_pivoted_abstractions.subject_id = note_stable_identifier.id JOIN note_stable_identifier_full ON note_stable_identifier.stable_identifier_path = note_stable_identifier_full.stable_identifier_path AND note_stable_identifier.stable_identifier_value = note_stable_identifier_full.stable_identifier_value JOIN note ON note_stable_identifier_full.note_id = note.note_id JOIN concept AS note_type ON note.note_type_concept_id = note_type.concept_id JOIN person ON note.person_id = person.person_id LEFT JOIN pii_name ON person.person_id = pii_name.person_id JOIN fact_relationship ON fact_relationship.domain_concept_id_1 = 5085 AND fact_relationship.fact_id_1 = note.note_id AND fact_relationship.relationship_concept_id = 44818790 JOIN procedure_occurrence ON fact_relationship.domain_concept_id_2 = 10 AND fact_relationship.fact_id_2 = procedure_occurrence.procedure_occurrence_id JOIN procedure_occurrence_stable_identifier ON procedure_occurrence.procedure_occurrence_id = procedure_occurrence_stable_identifier.procedure_occurrence_id ) cases -- WHERE cases.person_source_value = '?' -- WHERE -- ( -- has_cancer_histology IS NULL -- OR -- has_cancer_histology = 'not applicable' -- ) -- WHERE -- ( -- has_cancer_histology IS NOT NULL -- AND -- has_cancer_histology != 'not applicable' -- ) WHERE ( has_cancer_histology IS NULL OR has_cancer_histology != 'not applicable' ) ORDER BY cases.has_cancer_histology ; DROP TABLE IF EXISTS cancer_abstractions; CREATE TEMPORARY TABLE cancer_abstractions ( id BIGINT NOT NULL, note_id BIGINT NOT NULL, stable_identifier_path varchar(255) NULL, stable_identifier_value varchar(255) NULL, subject_id BIGINT NOT NULL , has_surgery_date varchar(255) NULL, pathological_tumor_staging_category varchar(255) NULL, pathological_nodes_staging_category varchar(255) NULL, pathological_metastasis_staging_category varchar(255) NULL, has_tumor_size varchar(255) NULL ); INSERT INTO cancer_abstractions ( id , note_id , stable_identifier_path , stable_identifier_value , subject_id , has_surgery_date , pathological_tumor_staging_category , pathological_nodes_staging_category , pathological_metastasis_staging_category , has_tumor_size ) SELECT note_stable_identifier.id , note_stable_identifier.note_id , note_stable_identifier.stable_identifier_path , note_stable_identifier.stable_identifier_value , pivoted_abstractions.subject_id , pivoted_abstractions.has_surgery_date , pivoted_abstractions.pathological_tumor_staging_category , pivoted_abstractions.pathological_nodes_staging_category , pivoted_abstractions.pathological_metastasis_staging_category , pivoted_abstractions.has_tumor_size FROM note_stable_identifier LEFT JOIN (SELECT note_stable_identifier.id AS subject_id, Max(CASE WHEN data.predicate = 'has_surgery_date' THEN data.value ELSE NULL END) AS has_surgery_date, Max(CASE WHEN data.predicate = 'pathological_tumor_staging_category' THEN data.value ELSE NULL END) AS pathological_tumor_staging_category, Max(CASE WHEN data.predicate = 'pathological_nodes_staging_category' THEN data.value ELSE NULL END) AS pathological_nodes_staging_category, Max(CASE WHEN data.predicate = 'pathological_metastasis_staging_category' THEN data.value ELSE NULL END) AS pathological_metastasis_staging_category, Max(CASE WHEN data.predicate = 'has_tumor_size' THEN data.value ELSE NULL END) AS has_tumor_size FROM (SELECT aas.predicate, aas.id AS abstractor_abstraction_schema_id, asb.subject_type, aa.about_id, CASE WHEN aa.value IS NOT NULL AND aa.value != '' THEN aa.value WHEN aa.unknown = true THEN 'unknown' WHEN aa.not_applicable = true THEN 'not applicable' END AS value FROM abstractor_abstractions aa JOIN abstractor_subjects asb ON aa.abstractor_subject_id = asb.id JOIN abstractor_abstraction_schemas aas ON asb.abstractor_abstraction_schema_id = aas.id WHERE asb.subject_type = 'NoteStableIdentifier' AND asb.namespace_type = 'Abstractor::AbstractorNamespace' AND asb.namespace_id = (SELECT id FROM abstractor_namespaces WHERE name = 'Surgical Pathology' ) AND NOT EXISTS (SELECT 1 FROM abstractor_abstraction_group_members aagm WHERE aa.id = aagm.abstractor_abstraction_id)) data JOIN note_stable_identifier ON data.about_id = note_stable_identifier.id GROUP BY note_stable_identifier.id) pivoted_abstractions ON pivoted_abstractions.subject_id = note_stable_identifier.id WHERE pivoted_abstractions.subject_id IS NOT NULL -- WHERE ( EXISTS (SELECT 1 -- FROM abstractor_abstractions aa -- JOIN abstractor_subjects sub -- ON aa.abstractor_subject_id = sub.id -- AND sub.namespace_type = -- 'Abstractor::AbstractorNamespace' -- AND sub.namespace_id = (SELECT id FROM abstractor_namespaces WHERE name = 'Surgical Pathology' ) -- WHERE aa.deleted_at IS NULL -- AND aa.about_type = 'NoteStableIdentifier' -- AND note_stable_identifier.id = aa.about_id) -- AND NOT EXISTS (SELECT 1 -- FROM abstractor_abstractions aa -- JOIN abstractor_subjects sub -- ON aa.abstractor_subject_id = sub.id -- AND sub.namespace_type = -- 'Abstractor::AbstractorNamespace' -- AND sub.namespace_id = (SELECT id FROM abstractor_namespaces WHERE name = 'Surgical Pathology' ) -- WHERE aa.deleted_at IS NULL -- AND aa.about_type = 'NoteStableIdentifier' -- AND note_stable_identifier.id = aa.about_id -- AND COALESCE(aa.value, '') = '' -- AND COALESCE(aa.unknown, false) != true -- AND COALESCE(aa.not_applicable, false) != true) -- ); --end moomin ; SELECT cancer_diagnosis_abstractions.person_source_value , cancer_diagnosis_abstractions.id , cancer_diagnosis_abstractions.note_id , cancer_diagnosis_abstractions.stable_identifier_path , cancer_diagnosis_abstractions.stable_identifier_value , cancer_diagnosis_abstractions.subject_id , cancer_diagnosis_abstractions.procedure_occurrence_stable_identifier_path , cancer_diagnosis_abstractions.procedure_occurrence_stable_identifier_value , cancer_diagnosis_abstractions.procedure_date , cancer_diagnosis_abstractions.note_text , cancer_diagnosis_abstractions.has_cancer_histology , cancer_diagnosis_abstractions.has_cancer_histology_suggestions , cancer_diagnosis_abstractions.has_cancer_site , cancer_diagnosis_abstractions.has_cancer_site_suggestions , cancer_diagnosis_abstractions.has_cancer_site_laterality , cancer_diagnosis_abstractions.has_cancer_pathologic_sbr_grade , cancer_diagnosis_abstractions.has_cancer_recurrence_status , cancer_diagnosis_abstractions.has_metastatic_cancer_histology , cancer_diagnosis_abstractions.has_metastatic_cancer_site , cancer_diagnosis_abstractions.has_metastatic_cancer_primary_site , cancer_diagnosis_abstractions.has_metastatic_cancer_site_laterality , cancer_diagnosis_abstractions.has_metastatic_cancer_recurrence_status , cancer_abstractions.has_surgery_date , cancer_abstractions.pathological_tumor_staging_category , cancer_abstractions.pathological_nodes_staging_category , cancer_abstractions.pathological_metastasis_staging_category , cancer_abstractions.has_tumor_size FROM cancer_diagnosis_abstractions JOIN cancer_abstractions ON cancer_diagnosis_abstractions.note_id = cancer_abstractions.note_id -- WHERE cancer_diagnosis_abstractions.person_source_value = '?' WHERE ( cancer_diagnosis_abstractions.has_cancer_histology IS NOT NULL AND cancer_diagnosis_abstractions.has_cancer_histology != 'not applicable' ) OR ( cancer_abstractions.pathological_tumor_staging_category IS NOT NULL AND cancer_abstractions.pathological_tumor_staging_category != 'not applicable' ) ORDER BY cancer_diagnosis_abstractions.procedure_date, cancer_diagnosis_abstractions.procedure_occurrence_stable_identifier_value
<reponame>UWIT-IAM/uw-redcap-client -- Revert seattleflu/schema:receiving/redcap-det/indexes/document-as-jsonb from pg -- requires: receiving/redcap-det begin; drop index receiving.redcap_det_document_as_jsonb_idx; commit;
BEGIN; ALTER TABLE xplan_gml.so_plan ALTER COLUMN planaufstellendegemeinde TYPE xplan_gml.xp_gemeinde[] USING planaufstellendegemeinde::xplan_gml.xp_gemeinde[]; COMMIT;
<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/current/5.2.0/dml/KC_DML_01_KRACOEUS-6754_B000.sql UPDATE IACUC_PROTOCOL_CORRESP_TYPE SET MODULE_ID = 'Y' WHERE PROTO_CORRESP_TYPE_CODE IN ('1','11','12','13','14','15','16','17','18','19','20','21','22','25','26','27','28','29','6','7','8','9') / UPDATE PROTO_CORRESP_TYPE SET MODULE_ID = 'P' WHERE PROTO_CORRESP_TYPE_CODE IN ('13','14') / UPDATE PROTO_CORRESP_TYPE SET MODULE_ID = 'C' WHERE PROTO_CORRESP_TYPE_CODE = '15' / UPDATE PROTO_CORRESP_TYPE SET MODULE_ID = 'S' WHERE PROTO_CORRESP_TYPE_CODE IN ('11','12') /
/** * Add a column for the number of status checks and the last check time * for each scheduled_notification message */ ALTER TABLE "water"."scheduled_notification" ADD COLUMN if not exists status_checks BIGINT; ALTER TABLE "water"."scheduled_notification" ADD COLUMN if not exists next_status_check timestamp(0);
<reponame>thnilsen1/server-status CREATE TABLE `settings` ( `setting` varchar(255) NOT NULL UNIQUE, `value` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE `services` ( `id` int(11) NOT NULL, `name` varchar(50) COLLATE utf8_czech_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE `services_status` ( `id` int(11) NOT NULL, `service_id` int(11) NOT NULL, `status_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE `status` ( `id` int(11) NOT NULL, `type` int(11) NOT NULL, `title` varchar(50) COLLATE utf8_czech_ci NOT NULL, `text` text COLLATE utf8_czech_ci NOT NULL, `time` int(11) NOT NULL, `end_time` int(11) NOT NULL, `user_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE `tokens` ( `token` varchar(64) COLLATE utf8_czech_ci NOT NULL, `user` int(11) NOT NULL, `expire` int(11) NOT NULL, `data` varchar(80) COLLATE utf8_czech_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE `users` ( `id` int(11) NOT NULL, `email` varchar(60) COLLATE utf8_czech_ci NOT NULL, `username` varchar(50) COLLATE utf8_czech_ci NOT NULL, `name` varchar(50) COLLATE utf8_czech_ci NOT NULL, `surname` varchar(50) COLLATE utf8_czech_ci NOT NULL, `password_hash` char(64) COLLATE utf8_czech_ci NOT NULL, `password_salt` char(64) COLLATE utf8_czech_ci NOT NULL, `permission` int(11) NOT NULL DEFAULT '0', `active` tinyint(1) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE `subscribers` ( `subscriberID` int(11) NOT NULL, `telegramID` int(50) NOT NULL, `firstname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `lastname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE `services_subscriber` ( `comboID` int(11) NOT NULL, `subscriberIDFK` int(11) NOT NULL, `serviceIDFK` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE queue_notify ( id int(11) NOT NULL AUTO_INCREMENT, task_id int(11) NOT NULL, status tinyint(1) NOT NULL, subscriber_id int(11) NOT NULL, retries tinyint(1) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; CREATE TABLE queue_task ( id int(11) NOT NULL AUTO_INCREMENT, type_id int(11) NOT NULL, status tinyint(1) NOT NULL, template_data1 text COLLATE utf8_czech_ci, template_data2 text COLLATE utf8_czech_ci, created_time int(11) NOT NULL, completed_time int(11) DEFAULT NULL, num_errors int(11) DEFAULT NULL, user_id int(11) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; ALTER TABLE `services` ADD PRIMARY KEY (`id`); ALTER TABLE `services_status` ADD PRIMARY KEY (`id`), ADD KEY `service_id` (`service_id`), ADD KEY `status_id` (`status_id`); ALTER TABLE `status` ADD PRIMARY KEY (`id`), ADD KEY `user_id` (`user_id`); ALTER TABLE `tokens` ADD PRIMARY KEY (`token`), ADD KEY `user` (`user`); ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `username` (`username`); ALTER TABLE `services` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `services_status` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `status` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `services_subscriber` ADD PRIMARY KEY (`comboID`), ADD UNIQUE KEY `unique_subscription` (`subscriberIDFK`,`serviceIDFK`), ADD KEY `serviceIDFK` (`serviceIDFK`); ALTER TABLE `subscribers` ADD PRIMARY KEY (`subscriberID`), ADD UNIQUE KEY `telegramID` (`telegramID`); ALTER TABLE `services_subscriber` MODIFY `comboID` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `subscribers` MODIFY `subscriberID` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `services_status` ADD CONSTRAINT `service_id` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`), ADD CONSTRAINT `status_id` FOREIGN KEY (`status_id`) REFERENCES `status` (`id`); ALTER TABLE `status` ADD CONSTRAINT `user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); ALTER TABLE `tokens` ADD CONSTRAINT `user` FOREIGN KEY (`user`) REFERENCES `users` (`id`); ALTER TABLE `services_subscriber` ADD CONSTRAINT `services_subscriber_ibfk_1` FOREIGN KEY (`subscriberIDFK`) REFERENCES `subscribers` (`subscriberID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `services_subscriber_ibfk_2` FOREIGN KEY (`serviceIDFK`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; ALTER TABLE `subscribers` CHANGE COLUMN lastname lastname varchar(255) DEFAULT NULL; # was varchar(255) NOT NULL ALTER TABLE `subscribers` CHANGE COLUMN firstname firstname varchar(255) DEFAULT NULL; # was varchar(255) NOT NULL ALTER TABLE `subscribers` CHANGE COLUMN telegramID userID varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL; ALTER TABLE `subscribers` ADD COLUMN typeID tinyint(1) NOT NULL AFTER subscriberID; ALTER TABLE `subscribers` ADD COLUMN token varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER lastname; ALTER TABLE `subscribers` ADD COLUMN expires int(11) DEFAULT NULL; ALTER TABLE `subscribers` ADD COLUMN active tinyint(1) DEFAULT NULL; ALTER TABLE `subscribers` ADD COLUMN create_time int(11) DEFAULT NULL; ALTER TABLE `subscribers` ADD COLUMN update_time int(11) DEFAULT NULL; ALTER TABLE `subscribers` DROP INDEX telegramID; # was UNIQUE (telegramID) ALTER TABLE `subscribers` ADD UNIQUE userID (userID); COMMIT;
<gh_stars>1-10 select name, title, akas, labels, tags from gcp.gcp_storage_bucket where akas::text = '["{{ output.resource_aka.value }}"]'
<filename>migrate/migrations/20180803110859-drop-twilio-egress-voice-status.sql -- +migrate Up DROP TABLE twilio_egress_voice_status; DROP TYPE enum_twilio_voice_status; -- +migrate Down CREATE TYPE enum_twilio_voice_status AS ENUM ( 'unknown', -- in case twilio insists it doesn't exist when we ask 'initiated', 'queued', 'ringing', 'in-progress', 'completed', 'busy', 'failed', 'no-answer', 'canceled' ); CREATE TABLE twilio_egress_voice_status ( twilio_sid TEXT PRIMARY KEY, last_status enum_twilio_voice_status NOT NULL, sent_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), last_update TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), dest_number TEXT NOT NULL, last_sequence_number INT );
<reponame>mlakkadshaw/synapse<filename>synapse/storage/schema/main/delta/63/01create_registration_tokens.sql /* Copyright 2021 <NAME> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CREATE TABLE IF NOT EXISTS registration_tokens( token TEXT NOT NULL, -- The token that can be used for authentication. uses_allowed INT, -- The total number of times this token can be used. NULL if no limit. pending INT NOT NULL, -- The number of in progress registrations using this token. completed INT NOT NULL, -- The number of times this token has been used to complete a registration. expiry_time BIGINT, -- The latest time this token will be valid (epoch time in milliseconds). NULL if token doesn't expire. UNIQUE (token) );
<reponame>ghermain2009/rb<gh_stars>0 -- Adminer 4.1.0 MySQL dump SET NAMES utf8; SET time_zone = '+00:00'; CREATE DATABASE `bookersnap` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `bookersnap`; DROP TABLE IF EXISTS `menu`; CREATE TABLE `menu` ( `id` int(11) NOT NULL, `module` varchar(100) NOT NULL, `controller` varchar(100) NOT NULL, `action` varchar(100) NOT NULL, `label` varchar(150) NOT NULL, `parent` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `privilege`; CREATE TABLE `privilege` ( `id` int(11) NOT NULL AUTO_INCREMENT, `role_id` int(11) NOT NULL, `menu_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(300) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(40) CHARACTER SET utf8 DEFAULT NULL, `password` varchar(40) DEFAULT NULL, `full_name` varchar(300) CHARACTER SET utf8 DEFAULT NULL, `email` varchar(300) CHARACTER SET utf8 DEFAULT NULL, `role_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- 2014-08-31 22:03:19
<filename>sql/synradar.sql -- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 26, 2022 at 07:26 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `synradar` -- -- -------------------------------------------------------- -- -- Table structure for table `countries` -- CREATE TABLE `countries` ( `id` int(11) NOT NULL, `name` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `countries` -- INSERT INTO `countries` (`id`, `name`) VALUES (1, 'india'), (2, 'India'), (3, 'india'), (4, 'pak'), (5, 'sri'), (6, 'america'), (7, 'japan'); -- -------------------------------------------------------- -- -- Table structure for table `department` -- CREATE TABLE `department` ( `id` int(11) NOT NULL, `dept_name` varchar(100) NOT NULL, `dept_details` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `department` -- INSERT INTO `department` (`id`, `dept_name`, `dept_details`) VALUES (1, 'IT', 'Information Technology'), (2, 'Support', ''), (3, 'HR', 'Human Resource'), (4, 'Test', 'Cyber Testing'), (5, 'department', 'details'); -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE `employee` ( `id` int(11) NOT NULL, `emp_name` varchar(100) NOT NULL, `emp_details` varchar(200) DEFAULT NULL, `fk_dept_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`id`, `emp_name`, `emp_details`, `fk_dept_id`) VALUES (1, 'Raju', '', 1), (2, 'Mohan', '', 4), (3, 'Ganesh', '', 2), (4, 'Ram', '', 2), (5, 'Shilpi', '', 1), (6, 'Priya', 'HR Manager', 3); -- -------------------------------------------------------- -- -- Table structure for table `project` -- CREATE TABLE `project` ( `id` int(11) NOT NULL, `pro_name` varchar(100) NOT NULL, `pro_type` enum('One Time','Monthly') DEFAULT 'One Time' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `project` -- INSERT INTO `project` (`id`, `pro_name`, `pro_type`) VALUES (1, 'HP project', 'One Time'), (2, 'SBI project', 'Monthly'), (3, 'ICICI project', 'Monthly'), (4, 'Mumbai Police', 'One Time'); -- -------------------------------------------------------- -- -- Table structure for table `project_emp` -- CREATE TABLE `project_emp` ( `id` int(11) NOT NULL, `fk_pro_id` int(11) NOT NULL, `fk_emp_id` int(11) NOT NULL, `role` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `project_emp` -- INSERT INTO `project_emp` (`id`, `fk_pro_id`, `fk_emp_id`, `role`) VALUES (1, 1, 1, ''), (2, 2, 1, 'Main'), (3, 2, 3, 'Support'), (4, 3, 3, ''), (5, 3, 4, ''), (6, 3, 5, 'Support'), (7, 4, 4, 'Developer'), (8, 4, 5, ''); -- -------------------------------------------------------- -- -- Table structure for table `report` -- CREATE TABLE `report` ( `id` int(11) NOT NULL, `rep_title` varchar(200) NOT NULL, `fk_pro_id` int(11) DEFAULT NULL, `fk_emp_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `report` -- INSERT INTO `report` (`id`, `rep_title`, `fk_pro_id`, `fk_emp_id`) VALUES (1, 'Report 1', 1, 1), (2, 'Report 2', 1, 1), (3, 'Report 3', 2, 3), (4, 'Report 4', 4, 4), (5, 'Report 5', 2, 1), (6, 'Report 6', 3, 3), (7, 'Report 7', 3, 4), (8, 'Report 8', 4, 5), (9, 'Report 9', 4, 5), (10, 'Report 10', 4, 5); -- -------------------------------------------------------- -- -- Table structure for table `rep_task` -- CREATE TABLE `rep_task` ( `id` int(11) NOT NULL, `fk_rep_id` int(11) NOT NULL, `fk_task_id` int(11) NOT NULL, `fk_emp_id` int(11) NOT NULL, `repeated` enum('Yes','No') DEFAULT 'No' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `rep_task` -- INSERT INTO `rep_task` (`id`, `fk_rep_id`, `fk_task_id`, `fk_emp_id`, `repeated`) VALUES (1, 1, 3, 1, 'No'), (2, 1, 7, 1, 'No'), (3, 2, 3, 1, 'No'), (4, 2, 6, 1, 'No'), (5, 3, 2, 3, 'Yes'), (6, 3, 4, 1, 'Yes'), (7, 4, 1, 5, 'No'), (8, 5, 5, 1, 'Yes'), (9, 5, 7, 3, 'No'), (10, 7, 2, 5, 'Yes'), (11, 7, 5, 5, 'Yes'), (12, 9, 1, 4, 'No'), (13, 10, 5, 5, 'Yes'), (14, 6, 3, 4, 'No'), (15, 6, 4, 3, 'No'), (16, 6, 4, 3, 'No'), (17, 6, 4, 3, 'No'), (18, 5, 1, 5, 'No'), (19, 10, 3, 1, 'No'), (20, 10, 3, 1, 'No'), (21, 6, 4, 4, 'No'); -- -------------------------------------------------------- -- -- Table structure for table `task` -- CREATE TABLE `task` ( `id` int(11) NOT NULL, `task_name` varchar(100) NOT NULL, `task_details` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `task` -- INSERT INTO `task` (`id`, `task_name`, `task_details`) VALUES (1, 'Task 1', 'Task 1'), (2, 'Task 2', ''), (3, 'Task 3', ''), (4, 'Task 4', ''), (5, 'Task 5', 'Task 5'), (6, 'Task 6', ''), (7, 'Task 7', ''); -- -- Indexes for dumped tables -- -- -- Indexes for table `countries` -- ALTER TABLE `countries` ADD PRIMARY KEY (`id`); -- -- Indexes for table `department` -- ALTER TABLE `department` ADD PRIMARY KEY (`id`); -- -- Indexes for table `employee` -- ALTER TABLE `employee` ADD PRIMARY KEY (`id`), ADD KEY `fk_dept_id` (`fk_dept_id`); -- -- Indexes for table `project` -- ALTER TABLE `project` ADD PRIMARY KEY (`id`); -- -- Indexes for table `project_emp` -- ALTER TABLE `project_emp` ADD PRIMARY KEY (`id`), ADD KEY `fk_pro_id` (`fk_pro_id`), ADD KEY `fk_emp_id` (`fk_emp_id`); -- -- Indexes for table `report` -- ALTER TABLE `report` ADD PRIMARY KEY (`id`), ADD KEY `fk_emp_id` (`fk_emp_id`), ADD KEY `fk_pro_id` (`fk_pro_id`); -- -- Indexes for table `rep_task` -- ALTER TABLE `rep_task` ADD PRIMARY KEY (`id`), ADD KEY `fk_emp_id` (`fk_emp_id`), ADD KEY `rep_task_ibfk_2` (`fk_task_id`), ADD KEY `rep_task_ibfk_3` (`fk_rep_id`); -- -- Indexes for table `task` -- ALTER TABLE `task` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `countries` -- ALTER TABLE `countries` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `department` -- ALTER TABLE `department` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `project` -- ALTER TABLE `project` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `project_emp` -- ALTER TABLE `project_emp` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `report` -- ALTER TABLE `report` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `rep_task` -- ALTER TABLE `rep_task` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `task` -- ALTER TABLE `task` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- Constraints for dumped tables -- -- -- Constraints for table `employee` -- ALTER TABLE `employee` ADD CONSTRAINT `employee_ibfk_1` FOREIGN KEY (`fk_dept_id`) REFERENCES `department` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `project_emp` -- ALTER TABLE `project_emp` ADD CONSTRAINT `project_emp_ibfk_1` FOREIGN KEY (`fk_pro_id`) REFERENCES `project` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `project_emp_ibfk_2` FOREIGN KEY (`fk_emp_id`) REFERENCES `employee` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `report` -- ALTER TABLE `report` ADD CONSTRAINT `report_ibfk_1` FOREIGN KEY (`fk_emp_id`) REFERENCES `employee` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `report_ibfk_2` FOREIGN KEY (`fk_pro_id`) REFERENCES `project` (`id`); -- -- Constraints for table `rep_task` -- ALTER TABLE `rep_task` ADD CONSTRAINT `rep_task_ibfk_1` FOREIGN KEY (`fk_emp_id`) REFERENCES `employee` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `rep_task_ibfk_2` FOREIGN KEY (`fk_task_id`) REFERENCES `task` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `rep_task_ibfk_3` FOREIGN KEY (`fk_rep_id`) REFERENCES `report` (`id`) ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<filename>docs/deployment/old_stuff/sql_server_csm3.2_scripts/AuthSchemaSQLServer.sql /*L Copyright SAIC, Ellumen and RSNA (CTP) Distributed under the OSI-approved BSD 3-Clause License. See http://ncip.github.com/national-biomedical-image-archive/LICENSE.txt for details. L*/ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_CSM_GROUP_CSM_APPLICATION') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_GROUP DROP CONSTRAINT FK_CSM_GROUP_CSM_APPLICATION ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_PG_PE_PE') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_PG_PE DROP CONSTRAINT FK_PG_PE_PE ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_PG_PE_PG') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_PG_PE DROP CONSTRAINT FK_PG_PE_PG ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_PE_APPLICATION') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_PROTECTION_ELEMENT DROP CONSTRAINT FK_PE_APPLICATION ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_PG_APPLICATION') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_PROTECTION_GROUP DROP CONSTRAINT FK_PG_APPLICATION ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_PG_PG') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_PROTECTION_GROUP DROP CONSTRAINT FK_PG_PG ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_ROLE_APPLICATION') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_ROLE DROP CONSTRAINT FK_ROLE_APPLICATION ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_ROLE_PRIVILEGE_PRIVILEGE') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_ROLE_PRIVILEGE DROP CONSTRAINT FK_ROLE_PRIVILEGE_PRIVILEGE ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_ROLE_PRIVILEGE_ROLE') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_ROLE_PRIVILEGE DROP CONSTRAINT FK_ROLE_PRIVILEGE_ROLE ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_GROUP_GROUP') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_GROUP DROP CONSTRAINT FK_USER_GROUP_GROUP ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_GROUP_USER') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_GROUP DROP CONSTRAINT FK_USER_GROUP_USER ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_GROUP_ROLE_PG_GROUP') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_GROUP_ROLE_PG DROP CONSTRAINT FK_USER_GROUP_ROLE_PG_GROUP ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_GROUP_ROLE_PG_PG') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_GROUP_ROLE_PG DROP CONSTRAINT FK_USER_GROUP_ROLE_PG_PG ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_GROUP_ROLE_PG_ROLE') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_GROUP_ROLE_PG DROP CONSTRAINT FK_USER_GROUP_ROLE_PG_ROLE ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_GROUP_ROLE_PG_USER') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_GROUP_ROLE_PG DROP CONSTRAINT FK_USER_GROUP_ROLE_PG_USER ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_PE_USER') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_PE DROP CONSTRAINT FK_USER_PE_USER ; IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('FK_USER_PE_PE') AND OBJECTPROPERTY(id, 'IsForeignKey') = 1) ALTER TABLE CSM_USER_PE DROP CONSTRAINT FK_USER_PE_PE ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_APPLICATION') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_APPLICATION ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_GROUP') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_GROUP ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_PG_PE') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_PG_PE ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_PRIVILEGE') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_PRIVILEGE ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_PROTECTION_ELEMENT') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_PROTECTION_ELEMENT ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_PROTECTION_GROUP') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_PROTECTION_GROUP ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_ROLE') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_ROLE ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_ROLE_PRIVILEGE') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_ROLE_PRIVILEGE ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_USER') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_USER ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_USER_GROUP') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_USER_GROUP ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_USER_GROUP_ROLE_PG') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_USER_GROUP_ROLE_PG ; IF EXISTS (SELECT * FROM dbo.SYSOBJECTS WHERE id = object_id('CSM_USER_PE') AND OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE CSM_USER_PE ; CREATE TABLE CSM_APPLICATION ( APPLICATION_ID int identity(1,1) NOT NULL, APPLICATION_NAME varchar(255) NOT NULL, APPLICATION_DESCRIPTION varchar(200) NOT NULL, DECLARATIVE_FLAG int, ACTIVE_FLAG int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT Getdate(), DATABASE_URL VARCHAR(100), DATABASE_USER_NAME VARCHAR(100), DATABASE_PASSWORD VARCHAR(100), DATABASE_DIALECT VARCHAR(100), DATABASE_DRIVER VARCHAR(100) ) ; CREATE TABLE CSM_GROUP ( GROUP_ID int identity(1,1) NOT NULL, GROUP_NAME varchar(255) NOT NULL, GROUP_DESC varchar(200), UPDATE_DATE datetime NOT NULL DEFAULT GetDate(), APPLICATION_ID int NOT NULL ) ; CREATE TABLE CSM_PG_PE ( PG_PE_ID int identity(1,1) NOT NULL, PROTECTION_GROUP_ID int NOT NULL, PROTECTION_ELEMENT_ID int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_PRIVILEGE ( PRIVILEGE_ID int identity(1,1) NOT NULL, PRIVILEGE_NAME varchar(100) NOT NULL, PRIVILEGE_DESCRIPTION varchar(200), UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_PROTECTION_ELEMENT ( PROTECTION_ELEMENT_ID int identity(1,1) NOT NULL, PROTECTION_ELEMENT_NAME varchar(100) NOT NULL, PROTECTION_ELEMENT_DESCRIPTION varchar(200), OBJECT_ID varchar(100) NOT NULL, ATTRIBUTE varchar(100), PROTECTION_ELEMENT_TYPE varchar(100), APPLICATION_ID int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_PROTECTION_GROUP ( PROTECTION_GROUP_ID int identity(1,1) NOT NULL, PROTECTION_GROUP_NAME varchar(100) NOT NULL, PROTECTION_GROUP_DESCRIPTION varchar(200), APPLICATION_ID int NOT NULL, LARGE_ELEMENT_COUNT_FLAG int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate(), PARENT_PROTECTION_GROUP_ID int ) ; CREATE TABLE CSM_ROLE ( ROLE_ID int identity(1,1) NOT NULL, ROLE_NAME varchar(100) NOT NULL, ROLE_DESCRIPTION varchar(200), APPLICATION_ID int NOT NULL, ACTIVE_FLAG int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_ROLE_PRIVILEGE ( ROLE_PRIVILEGE_ID int identity(1,1) NOT NULL, ROLE_ID int NOT NULL, PRIVILEGE_ID int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_USER ( USER_ID int identity(1,1) NOT NULL, LOGIN_NAME varchar(100) NOT NULL, FIRST_NAME varchar(100) NOT NULL, LAST_NAME varchar(100) NOT NULL, ORGANIZATION varchar(100), DEPARTMENT varchar(100), TITLE varchar(100), PHONE_NUMBER varchar(15), PASSWORD varchar(100), EMAIL_ID varchar(100), START_DATE datetime, END_DATE datetime, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_USER_GROUP ( USER_GROUP_ID int identity(1,1) NOT NULL, USER_ID int NOT NULL, GROUP_ID int NOT NULL ) ; CREATE TABLE CSM_USER_GROUP_ROLE_PG ( USER_GROUP_ROLE_PG_ID int identity(1,1) NOT NULL, USER_ID int, GROUP_ID int, ROLE_ID int NOT NULL, PROTECTION_GROUP_ID int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; CREATE TABLE CSM_USER_PE ( USER_PROTECTION_ELEMENT_ID int identity(1,1) NOT NULL, PROTECTION_ELEMENT_ID int NOT NULL, USER_ID int NOT NULL, UPDATE_DATE datetime NOT NULL DEFAULT GetDate() ) ; ALTER TABLE CSM_APPLICATION ADD CONSTRAINT PK_APPLICATION PRIMARY KEY (APPLICATION_ID) ; ALTER TABLE CSM_GROUP ADD CONSTRAINT PK_GROUP PRIMARY KEY (GROUP_ID) ; ALTER TABLE CSM_PG_PE ADD CONSTRAINT PK_PG_PE PRIMARY KEY (PG_PE_ID) ; ALTER TABLE CSM_PRIVILEGE ADD CONSTRAINT PK_PRIVILEGE PRIMARY KEY (PRIVILEGE_ID) ; ALTER TABLE CSM_PROTECTION_ELEMENT ADD CONSTRAINT PK_PROTECTION_ELEMENT PRIMARY KEY (PROTECTION_ELEMENT_ID) ; ALTER TABLE CSM_PROTECTION_GROUP ADD CONSTRAINT PK_PROTECTION_GROUP PRIMARY KEY (PROTECTION_GROUP_ID) ; ALTER TABLE CSM_ROLE ADD CONSTRAINT PK_ROLE PRIMARY KEY (ROLE_ID) ; ALTER TABLE CSM_ROLE_PRIVILEGE ADD CONSTRAINT PK_ROLE_PRIVILEGE PRIMARY KEY (ROLE_PRIVILEGE_ID) ; ALTER TABLE CSM_USER ADD CONSTRAINT PK_USER PRIMARY KEY (USER_ID) ; ALTER TABLE CSM_USER_GROUP ADD CONSTRAINT PK_USER_GROUP PRIMARY KEY (USER_GROUP_ID) ; ALTER TABLE CSM_USER_GROUP_ROLE_PG ADD CONSTRAINT PK_USER_GROUP_ROLE_PG PRIMARY KEY (USER_GROUP_ROLE_PG_ID) ; ALTER TABLE CSM_USER_PE ADD CONSTRAINT PK_USER_PROTECTION_ELEMENT PRIMARY KEY (USER_PROTECTION_ELEMENT_ID) ; ALTER TABLE CSM_APPLICATION ADD CONSTRAINT UQ_APPLICATION_NAME UNIQUE (APPLICATION_NAME) ; ALTER TABLE CSM_GROUP ADD CONSTRAINT UQ_GROUP_GROUP_NAME UNIQUE (APPLICATION_ID, GROUP_NAME) ; ALTER TABLE CSM_PG_PE ADD CONSTRAINT UQ_PG_PE_PG_PE_ID UNIQUE (PROTECTION_ELEMENT_ID, PROTECTION_GROUP_ID) ; ALTER TABLE CSM_PRIVILEGE ADD CONSTRAINT UQ_PRIVILEGE_NAME UNIQUE (PRIVILEGE_NAME) ; ALTER TABLE CSM_PROTECTION_ELEMENT ADD CONSTRAINT UQ_PE_OBJ_ATT_APP_ID UNIQUE (OBJECT_ID, ATTRIBUTE, APPLICATION_ID) ; ALTER TABLE CSM_PROTECTION_GROUP ADD CONSTRAINT UQ_PG_PG_NAME UNIQUE (APPLICATION_ID, PROTECTION_GROUP_NAME) ; ALTER TABLE CSM_ROLE ADD CONSTRAINT UQ_ROLE_ROLE_NAME UNIQUE (APPLICATION_ID, ROLE_NAME) ; ALTER TABLE CSM_ROLE_PRIVILEGE ADD CONSTRAINT UQ_ROLE_ID_PRIVILEGE_ID UNIQUE (PRIVILEGE_ID, ROLE_ID) ; ALTER TABLE CSM_USER ADD CONSTRAINT UQ_LOGIN_NAME UNIQUE (LOGIN_NAME) ; ALTER TABLE CSM_USER_PE ADD CONSTRAINT UQ_USER_PE_PE_ID UNIQUE (USER_ID, PROTECTION_ELEMENT_ID) ; ALTER TABLE CSM_GROUP ADD CONSTRAINT FK_CSM_GROUP_CSM_APPLICATION FOREIGN KEY (APPLICATION_ID) REFERENCES CSM_APPLICATION (APPLICATION_ID) ON DELETE CASCADE ; ALTER TABLE CSM_PG_PE ADD CONSTRAINT FK_PG_PE_PE FOREIGN KEY (PROTECTION_ELEMENT_ID) REFERENCES CSM_PROTECTION_ELEMENT (PROTECTION_ELEMENT_ID) ON DELETE CASCADE ; ALTER TABLE CSM_PG_PE ADD CONSTRAINT FK_PG_PE_PG FOREIGN KEY (PROTECTION_GROUP_ID) REFERENCES CSM_PROTECTION_GROUP (PROTECTION_GROUP_ID) ON DELETE CASCADE ; ALTER TABLE CSM_PROTECTION_ELEMENT ADD CONSTRAINT FK_PE_APPLICATION FOREIGN KEY (APPLICATION_ID) REFERENCES CSM_APPLICATION (APPLICATION_ID) ON DELETE CASCADE ; ALTER TABLE CSM_PROTECTION_GROUP ADD CONSTRAINT FK_PG_APPLICATION FOREIGN KEY (APPLICATION_ID) REFERENCES CSM_APPLICATION (APPLICATION_ID) ON DELETE NO ACTION ; ALTER TABLE CSM_PROTECTION_GROUP ADD CONSTRAINT FK_PG_PG FOREIGN KEY (PARENT_PROTECTION_GROUP_ID) REFERENCES CSM_PROTECTION_GROUP (PROTECTION_GROUP_ID) ; ALTER TABLE CSM_ROLE ADD CONSTRAINT FK_ROLE_APPLICATION FOREIGN KEY (APPLICATION_ID) REFERENCES CSM_APPLICATION (APPLICATION_ID) ON DELETE CASCADE ; ALTER TABLE CSM_ROLE_PRIVILEGE ADD CONSTRAINT FK_ROLE_PRIVILEGE_PRIVILEGE FOREIGN KEY (PRIVILEGE_ID) REFERENCES CSM_PRIVILEGE (PRIVILEGE_ID) ON DELETE CASCADE ; ALTER TABLE CSM_ROLE_PRIVILEGE ADD CONSTRAINT FK_ROLE_PRIVILEGE_ROLE FOREIGN KEY (ROLE_ID) REFERENCES CSM_ROLE (ROLE_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_GROUP ADD CONSTRAINT FK_USER_GROUP_GROUP FOREIGN KEY (GROUP_ID) REFERENCES CSM_GROUP (GROUP_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_GROUP ADD CONSTRAINT FK_USER_GROUP_USER FOREIGN KEY (USER_ID) REFERENCES CSM_USER (USER_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_GROUP_ROLE_PG ADD CONSTRAINT FK_USER_GROUP_ROLE_PG_GROUP FOREIGN KEY (GROUP_ID) REFERENCES CSM_GROUP (GROUP_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_GROUP_ROLE_PG ADD CONSTRAINT FK_USER_GROUP_ROLE_PG_PG FOREIGN KEY (PROTECTION_GROUP_ID) REFERENCES CSM_PROTECTION_GROUP (PROTECTION_GROUP_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_GROUP_ROLE_PG ADD CONSTRAINT FK_USER_GROUP_ROLE_PG_ROLE FOREIGN KEY (ROLE_ID) REFERENCES CSM_ROLE (ROLE_ID) ON DELETE NO ACTION ; ALTER TABLE CSM_USER_GROUP_ROLE_PG ADD CONSTRAINT FK_USER_GROUP_ROLE_PG_USER FOREIGN KEY (USER_ID) REFERENCES CSM_USER (USER_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_PE ADD CONSTRAINT FK_USER_PE_USER FOREIGN KEY (USER_ID) REFERENCES CSM_USER (USER_ID) ON DELETE CASCADE ; ALTER TABLE CSM_USER_PE ADD CONSTRAINT FK_USER_PE_PE FOREIGN KEY (PROTECTION_ELEMENT_ID) REFERENCES CSM_PROTECTION_ELEMENT (PROTECTION_ELEMENT_ID) ON DELETE CASCADE ; EXEC sp_addextendedproperty 'MS_Description', 'The application entity describes the name of the application. The authorization context is derived from application name or application context.', 'User', dbo, 'table', CSM_APPLICATION ; EXEC sp_addextendedproperty 'MS_Description', 'Group is a logical grouping of the users.', 'User', dbo, 'table', CSM_GROUP ; EXEC sp_addextendedproperty 'MS_Description', 'Establishes the relationship between protection groups and protection elements. Using this one can find out the protection elements belonging to a protection group or vice versa.', 'User', dbo, 'table', CSM_PG_PE ; EXEC sp_addextendedproperty 'MS_Description', 'This table stores the privileges. e.g. CRUD', 'User', dbo, 'table', CSM_PRIVILEGE ; EXEC sp_addextendedproperty 'MS_Description', 'Protection element is a any resource that is to be secured within an application based on roles of the user in a particular protection group context. e.g. Any object, Resource etc.', 'User', dbo, 'table', CSM_PROTECTION_ELEMENT ; EXEC sp_addextendedproperty 'MS_Description', 'Protection group is a collection of protection elements.', 'User', dbo, 'table', CSM_PROTECTION_GROUP ; EXEC sp_addextendedproperty 'MS_Description', 'This entity defines the roles associated with an application.', 'User', dbo, 'table', CSM_ROLE ; EXEC sp_addextendedproperty 'MS_Description', 'This table stores the relationship between roles and privileges. Using this table one can find out the associated privileges with any role.', 'User', dbo, 'table', CSM_ROLE_PRIVILEGE ; EXEC sp_addextendedproperty 'MS_Description', 'Stores the users of the application.', 'User', dbo, 'table', CSM_USER ; EXEC sp_addextendedproperty 'MS_Description', 'Establishes the relationship between users and group. Using this table one can find out the users for a group or groups for a user.', 'User', dbo, 'table', CSM_USER_GROUP ; EXEC sp_addextendedproperty 'MS_Description', 'This table establishes the relation between protection group, user, role and group. A user is assigned a role for a particular protection group. Or A a group is assigned a role for a particular protection group. This way a context of the protection group is set here for a role assumed by a user or a group.', 'User', dbo, 'table', CSM_USER_GROUP_ROLE_PG ; EXEC sp_addextendedproperty 'MS_Description', 'This table established the relationship between users and protection elements stating them as owner of that protection element.', 'User', dbo, 'table', CSM_USER_PE ;
<gh_stars>100-1000 create table company(name varchar(100), loc varchar(100), no integer); insert into company values ('macrosoft', 'usa', 001); insert into company values ('oracle', 'usa', 002); insert into company values ('backberry', 'canada', 003); insert into company values ('sumsung', 'south korea', 004); insert into company values ('tencent', 'china', 005); insert into company values ('ibm', 'usa', 006); insert into company values ('nokia', 'finland', 007); insert into company values ('apple', 'usa', 008); insert into company values ('sony', 'japan', 009); insert into company values ('baidu', 'china', 010); insert into company values ('kingsoft', 'china', 011); --test explicit cursor without args create or replace procedure test_cursor_1 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c1_all is --cursor without args select name, loc, no from company order by 1, 2, 3; begin if not c1_all%isopen then open c1_all; end if; loop fetch c1_all into company_name, company_loc, company_no; exit when c1_all%notfound; end loop; if c1_all%isopen then close c1_all; end if; end; / call test_cursor_1(); drop procedure test_cursor_1; --test explicit cursor with args create or replace procedure test_cursor_2 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c2_no_range(no_1 integer, no_2 integer) is --cursor with args select name, loc, no from company where no >=no_1 and no <= no_2 order by 1, 2, 3; begin if not c2_no_range%isopen then open c2_no_range(5,10); end if; loop fetch c2_no_range into company_name, company_loc, company_no; exit when c2_no_range%notfound; end loop; if c2_no_range%isopen then close c2_no_range; dbms_output.put_line('c2_no_range closed'); end if; end; / call test_cursor_2(); drop procedure test_cursor_2; --test explicit cursor attributes create or replace procedure test_cursor_3 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c1_all is --cursor without args select name, loc, no from company order by 1, 2, 3; begin if not c1_all%isopen then open c1_all; end if; loop fetch c1_all into company_name, company_loc, company_no; if c1_all%notfound then exit; end if; if c1_all%found then end if; end loop; if c1_all%isopen then close c1_all; end if; end; / call test_cursor_3(); drop procedure test_cursor_3; --test implicit cursor attributes: (sql%)%found,%notfound,%isopen,%rowcount create or replace procedure test_cursor_4 as begin delete from company where loc='china'; if sql%isopen then --sql%isopen always false, as closed after the execution of sql. end if; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; end; / call test_cursor_4(); drop procedure test_cursor_4; --test dynamic cursor: (weak type)without return create or replace procedure test_cursor_5() as company_name varchar(100); company_loc varchar(100); company_no integer; type ref_cur_type is ref cursor; --declare cursor type my_cur ref_cur_type; --declare cursor var sqlstr varchar(100); begin sqlstr := 'select name,loc,no from company where loc=:1 order by 1, 2, 3'; open my_cur for 'select name,loc,no from company order by 1, 2, 3'; fetch my_cur into company_name,company_loc,company_no; while my_cur%found loop fetch my_cur into company_name,company_loc,company_no; end loop; close my_cur; end; / call test_cursor_5(); drop procedure test_cursor_5; ----test more than one cursors access create or replace procedure test_cursor_6 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c1_all is --cursor without args select name, loc, no from company order by 1, 2, 3; cursor c2_no_range(no_1 integer, no_2 integer) is --cursor with args select name, loc, no from company where no >=no_1 and no <= no_2 order by 1, 2, 3; begin open c1_all; open c2_no_range(50,100); --result null fetch c1_all into company_name, company_loc, company_no; fetch c2_no_range into company_name, company_loc, company_no; if c1_all%found then end if; if c1_all%notfound then end if; if c2_no_range%found then end if; if c2_no_range%notfound then end if; end; / call test_cursor_6(); drop procedure test_cursor_6; drop table company; create table tbl (id int); insert into tbl values (1); insert into tbl values (2); insert into tbl values (3); insert into tbl values (4); create or replace procedure sp_testsp as temp1 integer; temp2 integer; sql_str varchar2(200); begin declare type crs_recode_type is ref cursor; c1 crs_recode_type; begin temp1 := 4; temp2 := 0; sql_str := 'select id from tbl where id < :a and id > :b order by 1'; open c1 for sql_str using in temp1, in temp2; loop fetch c1 into temp1; exit when c1%notfound; end loop; close c1; --test implicit cursor rowcount attribute select id into temp1 from tbl where id=2 order by 1; update tbl set id=100 where id<3; insert into tbl select * from tbl; delete from tbl; end; end; / call sp_testsp(); drop procedure sp_testsp; drop table tbl; ------------------------------------------------------------------------------ -----test implicit cursor attributes for DML: select,insert,update,delete----- ------------------------------------------------------------------------------ create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp as v int:=0; begin --select select v1 into v from t1 where v1=1; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; --insert insert into t1 values (4,'abc4'); if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; --update update t1 set v1=v1+100 where v1>1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; dbms_output.put_line('test update: sql%rowcount=' || sql%rowcount); update t1 set v1=v1+100 where v1<1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; --delete delete from t1 where v1>1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; delete from t1 where v1<1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; end; / call sp_testsp(); drop procedure sp_testsp; drop table t1; ------------------------------------------------------------------------------ -----support A db's cursor in or out params--------------------------------- ------------------------------------------------------------------------------ CREATE TABLE TBL(VALUE INT); INSERT INTO TBL VALUES (1); INSERT INTO TBL VALUES (2); INSERT INTO TBL VALUES (3); INSERT INTO TBL VALUES (4); CREATE OR REPLACE PROCEDURE TEST_SP IS CURSOR C1(NO IN VARCHAR2) IS SELECT * FROM TBL WHERE VALUE < NO ORDER BY 1; CURSOR C2(NO OUT VARCHAR2) IS SELECT * FROM TBL WHERE VALUE < 10 ORDER BY 1; V INT; RESULT INT; BEGIN OPEN C1(10); OPEN C2(RESULT); LOOP FETCH C1 INTO V; IF C1%FOUND THEN ELSE EXIT; END IF; END LOOP; CLOSE C1; LOOP FETCH C2 INTO V; IF C2%FOUND THEN ELSE EXIT; END IF; END LOOP; CLOSE C2; END; / CALL TEST_SP(); DROP TABLE TBL; DROP PROCEDURE TEST_SP; --------------------------------------------------------------------------------- ----- test the mixed use of implicit and explicit cursor attributes ------------- ----- test the effect of the implicit cursor use to explicit cursor attributes -- --------------------------------------------------------------------------------- drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_select as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --select select v1 into v from t1 where v1=1; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_select(); drop procedure sp_testsp_select; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_insert as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --insert insert into t1 values (4,'abc4'); if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_insert(); drop procedure sp_testsp_insert; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_update as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --update update t1 set v1=v1+100 where v1>1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; dbms_output.put_line('test update: cur%rowcount=' || cur%rowcount); update t1 set v1=v1+100 where v1<1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_update(); drop procedure sp_testsp_update; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_delete as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --delete delete from t1 where v1>1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; delete from t1 where v1<1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_delete(); drop procedure sp_testsp_delete; drop table t1; --------------------------------------------------------------------------------- ----- test the mixed use of implicit and explicit cursor attributes ------------- ----- test the effect of the explicit cursor use to implicit cursor attributes -- --------------------------------------------------------------------------------- create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_select as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --select select v1 into v from t1 where v1=1; fetch cur into v; fetch cur into v; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_select(); drop procedure sp_testsp_select; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_insert as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --insert insert into t1 values (4,'abc4'); fetch cur into v; fetch cur into v; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_insert(); drop procedure sp_testsp_insert; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_update as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --update update t1 set v1=v1+100 where v1>1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; dbms_output.put_line('test update: sql%rowcount=' || sql%rowcount); update t1 set v1=v1+100 where v1<1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_update(); drop procedure sp_testsp_update; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_delete as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --delete delete from t1 where v1>1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; delete from t1 where v1<1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_delete(); drop procedure sp_testsp_delete; drop table t1; -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- CREATE TABLE TBL(V1 INTEGER); INSERT INTO TBL VALUES(1); INSERT INTO TBL VALUES(2); CREATE OR REPLACE PROCEDURE SP_TEST AS CURSOR CUR IS SELECT * FROM TBL; BEGIN --EXPLICIT CURSOR ATTRIBUTES INITIAL STATUS IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; OPEN CUR; IF CUR%FOUND THEN ELSIF NOT CUR%FOUND THEN ELSE END IF; IF CUR%NOTFOUND THEN ELSIF NOT CUR%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('CUR%ROWCOUNT INITIAL STATUS : ' || NVL(TO_CHAR(CUR%ROWCOUNT),'NULL')); CLOSE CUR; IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; --IMPLICIT CURSOR ATTRIBUTES INITIAL STATUS IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('SQL%ROWCOUNT INITIAL STATUS : ' || NVL(TO_CHAR(SQL%ROWCOUNT),'NULL')); END; / CALL SP_TEST(); DROP TABLE TBL; DROP PROCEDURE SP_TEST; -- GAUSSDBV100R001C00-754 CREATE TABLE TBL_H248LNK_INFO(ULBSGMODULENO INTEGER); INSERT INTO TBL_H248LNK_INFO VALUES(123); INSERT INTO TBL_H248LNK_INFO VALUES(456); INSERT INTO TBL_H248LNK_INFO VALUES(789); CREATE TABLE TBL (I_MODULENO INTEGER); CREATE OR REPLACE PROCEDURE TEST_CURSOR AS TYPE CUR_TYPE IS REF CURSOR; CUR CUR_TYPE; PSV_SQL VARCHAR2(1000); PI_MODULENO INTEGER; TBL_STR VARCHAR2(1000) := 'TBL'; BEGIN OPEN CUR FOR SELECT DISTINCT ULBSGMODULENO FROM TBL_H248LNK_INFO; LOOP FETCH CUR INTO PI_MODULENO; EXIT WHEN CUR%NOTFOUND; PSV_SQL := 'BEGIN INSERT INTO TBL (I_MODULENO) VALUES('||PI_MODULENO||');END;'; EXECUTE IMMEDIATE PSV_SQL; -- check cursor attris status IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; IF CUR%FOUND THEN ELSIF NOT CUR%FOUND THEN ELSE END IF; IF CUR%NOTFOUND THEN ELSIF NOT CUR%NOTFOUND THEN ELSE END IF; IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; END LOOP; -- check cursor attris status IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; IF CUR%FOUND THEN ELSIF NOT CUR%FOUND THEN ELSE END IF; IF CUR%NOTFOUND THEN ELSIF NOT CUR%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('CUR%ROWCOUNT : ' || NVL(TO_CHAR(CUR%ROWCOUNT),'NULL')); IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; END; / CALL TEST_CURSOR(); DROP PROCEDURE TEST_CURSOR; DROP TABLE TBL_H248LNK_INFO; DROP TABLE TBL; CREATE TABLE TBL_RCWSCFG ( IWSNO INTEGER, USCDBMID SMALLINT, USWSBOARDMID SMALLINT, UCWSTYPE8100 SMALLINT, UCWSTYPE6600 SMALLINT, UCLOGINTYPE SMALLINT, UCTTSCAPABILITY SMALLINT, UCASRCAPABILITY SMALLINT, UCRESCAPABILITY CHARACTER VARYING(8) ); INSERT INTO TBL_RCWSCFG VALUES (0, 184, 472, 0, 1, 0, NULL, NULL, '11011000'); CREATE TABLE TBL_TEMP_MODULE_312 ( I_MODULENO INTEGER ); CREATE OR REPLACE PROCEDURE TEST_TEMP AS BEGIN END; / CREATE OR REPLACE PROCEDURE TEST_CRS_RPT_EMPTYSOR(FLAG INTEGER) AS TYPE T_PSTMT_CRS_RPT_EMPTY IS REF CURSOR; CRS_RPT_EMPTY T_PSTMT_CRS_RPT_EMPTY; PI_MODULENO INTEGER; PSV_MODULETBLNAME VARCHAR2(128) := 'TBL_TEMP_MODULE_312'; PSV_SQL VARCHAR2(128); V_TEMP INTEGER := 0; PI_NN INTEGER := NULL; BEGIN OPEN CRS_RPT_EMPTY FOR SELECT DISTINCT USCDBMID FROM TBL_RCWSCFG WHERE IWSNO >=0 AND IWSNO <= 0; LOOP FETCH CRS_RPT_EMPTY INTO PI_MODULENO; EXIT WHEN CRS_RPT_EMPTY%NOTFOUND; IF (FLAG = 0) THEN -- INSERT INTO TBL_TEMP_MODULE_312, INSERT TRIGGER FUNCTION CALLED PSV_SQL := 'BEGIN INSERT INTO '||PSV_MODULETBLNAME||' (I_MODULENO) VALUES('||PI_MODULENO||');END;'; EXECUTE IMMEDIATE PSV_SQL; ELSE TEST_TEMP(); END IF; END LOOP; -- check cursor attris status IF CRS_RPT_EMPTY%ISOPEN THEN ELSIF NOT CRS_RPT_EMPTY%ISOPEN THEN ELSE END IF; IF CRS_RPT_EMPTY%FOUND THEN ELSIF NOT CRS_RPT_EMPTY%FOUND THEN ELSE END IF; IF CRS_RPT_EMPTY%NOTFOUND THEN ELSIF NOT CRS_RPT_EMPTY%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('CRS_RPT_EMPTY%ROWCOUNT : ' || NVL(TO_CHAR(CRS_RPT_EMPTY%ROWCOUNT),'NULL')); IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; END; / CALL TEST_CRS_RPT_EMPTYSOR(0); CALL TEST_CRS_RPT_EMPTYSOR(1); DROP PROCEDURE TEST_TEMP; DROP PROCEDURE TEST_CRS_RPT_EMPTYSOR; DROP TABLE TBL_RCWSCFG; drop table TBL_TEMP_MODULE_312; CREATE TABLE TEST_TB(ID INTEGER); INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(125); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP END LOOP; END; / --2 TEST FOR DISPLAY CURSOR IN (SELECT ,INSERT ,UPDATE ,DELETE); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP -- FOR SELECT SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; -- FOR INSERT INSERT INTO TEST_TB VALUES (125); IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; --UPDATE UPDATE TEST_TB SET ID=ID+1 WHERE ID=124; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; --DELETE DELETE FROM TEST_TB WHERE ID=125; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; END LOOP; END; / DROP TABLE IF EXISTS TEST_TB; --3 TEST FOR IMPLICIT CURSOR IN (SELECT ,INSERT ,UPDATE ,DELETE) CREATE TABLE TEST_TB (ID INT); INSERT INTO TEST_TB VALUES (123); INSERT INTO TEST_TB VALUES (124); INSERT INTO TEST_TB VALUES (125); DECLARE TEMP INTEGER = 0; BEGIN -- FOR SELECT SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; -- FOR INSERT INSERT INTO TEST_TB VALUES (125); IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; --UPDATE UPDATE TEST_TB SET ID=ID+1 WHERE ID<124; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; --DELETE DELETE FROM TEST_TB WHERE ID<125; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; END; / DROP TABLE IF EXISTS TEST_TB; --4 TEST FOR IMPLICIT CURSOR; CREATE TABLE TEST_TB (ID INT); INSERT INTO TEST_TB VALUES (123); INSERT INTO TEST_TB VALUES (124); INSERT INTO TEST_TB VALUES (125); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; DBMS_OUTPUT.PUT_LINE('TEST SELECT: SQL%ROWCOUNT=' || SQL%ROWCOUNT); END LOOP; END; / DROP TABLE IF EXISTS TEST_TB; CREATE TABLE TEST_TB(ID INTEGER); INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(125); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP END LOOP; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; END; / DROP TABLE IF EXISTS TEST_TB; --TEST FOR CURSOR SYS_REFCURSOR IN PROCEDURE AND EMPTY TABLE; --IF THE RESULT IS 0 ,THAT'S OK,ELSE IS ERROR; DROP TABLE IF EXISTS TEST_TBL; CREATE TABLE TEST_TBL(ID INTEGER); CREATE OR REPLACE PROCEDURE T1(O OUT SYS_REFCURSOR) IS C1 SYS_REFCURSOR; BEGIN OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID; O := C1; END; / DECLARE C1 SYS_REFCURSOR; TEMP INTEGER; BEGIN T1(C1); LOOP FETCH C1 INTO TEMP; EXIT WHEN C1%NOTFOUND; END LOOP; END; / DROP TABLE IF EXISTS TEST_TBL; DROP PROCEDURE T1; --TEST FOR CURSOR REFCURSOR IN PROCEDURE AND EMPTY TABLE; --IF THE RESULT IS 0 ,THAT'S OK,ELSE IS ERROR; DROP TABLE IF EXISTS TEST_TBL; CREATE TABLE TEST_TBL(ID INTEGER); CREATE OR REPLACE PROCEDURE T2(O OUT REFCURSOR) IS C1 SYS_REFCURSOR; BEGIN OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID; O := C1; END; / DECLARE C1 REFCURSOR; TEMP INTEGER; BEGIN T2(C1); LOOP FETCH C1 INTO TEMP; EXIT WHEN C1%NOTFOUND; END LOOP; END; / DROP TABLE IF EXISTS TEST_TBL; DROP PROCEDURE T2; --TEST CURSOR IN Anonymous block DROP TABLE IF EXISTS TEST_TBL; CREATE TABLE TEST_TBL(ID INTEGER); DECLARE C1 REFCURSOR; TEMP INTEGER; BEGIN OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID; LOOP FETCH C1 INTO TEMP; EXIT WHEN C1%NOTFOUND; END LOOP; END; / DROP TABLE IF EXISTS TEST_TBL; DROP PROCEDURE TEST_TEMP; DROP PROCEDURE TEST_CRS_RPT_EMPTYSOR; DROP TABLE TBL_RCWSCFG; drop table TBL_TEMP_MODULE_312; CREATE TABLE TBL_RCWSCFG ( IWSNO INTEGER, USCDBMID SMALLINT ); INSERT INTO TBL_RCWSCFG VALUES (0, 184); CREATE TABLE TBL_TEMP_MODULE_312 ( I_MODULENO INTEGER ); CREATE OR REPLACE PROCEDURE TEST_TEMP AS BEGIN END; / CREATE OR REPLACE PROCEDURE TEST_CRS_RPT_EMPTYSOR(FLAG INTEGER) AS TYPE T_PSTMT_CRS_RPT_EMPTY IS REF CURSOR; CRS_RPT_EMPTY T_PSTMT_CRS_RPT_EMPTY; PI_MODULENO INTEGER; PSV_MODULETBLNAME VARCHAR2(128) := 'TBL_TEMP_MODULE_312'; PSV_SQL VARCHAR2(128); PI_NN INTEGER := NULL; BEGIN OPEN CRS_RPT_EMPTY FOR SELECT DISTINCT USCDBMID FROM TBL_RCWSCFG; LOOP FETCH CRS_RPT_EMPTY INTO PI_MODULENO; EXIT WHEN CRS_RPT_EMPTY%NOTFOUND; IF (FLAG = 0) THEN -- INSERT INTO TBL_TEMP_MODULE_312, INSERT TRIGGER FUNCTION CALLED PSV_SQL := 'BEGIN INSERT INTO '||PSV_MODULETBLNAME||' (I_MODULENO) VALUES('||PI_MODULENO||');END;'; EXECUTE IMMEDIATE PSV_SQL; ELSE TEST_TEMP(); END IF; END LOOP; -- check cursor attris status DBMS_OUTPUT.PUT_LINE('CRS_RPT_EMPTY%ROWCOUNT : ' || NVL(TO_CHAR(CRS_RPT_EMPTY%ROWCOUNT),'NULL')); END; / CALL TEST_CRS_RPT_EMPTYSOR(0); CALL TEST_CRS_RPT_EMPTYSOR(1); DROP TABLE TBL_TEMP_MODULE_312; create table company(name varchar(100), loc varchar(100), no integer); insert into company values ('macrosoft', 'usa', 001); insert into company values ('oracle', 'usa', 002); insert into company values ('backberry', 'canada', 003); insert into company values ('sumsung', 'south korea', 004); insert into company values ('tencent', 'china', 005); insert into company values ('ibm', 'usa', 006); insert into company values ('nokia', 'finland', 007); insert into company values ('apple', 'usa', 008); insert into company values ('sony', 'japan', 009); insert into company values ('baidu', 'china', 010); insert into company values ('kingsoft', 'china', 011); --test explicit cursor without args create or replace procedure test_cursor_1 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c1_all is --cursor without args select name, loc, no from company order by 1, 2, 3; begin if not c1_all%isopen then open c1_all; end if; loop fetch c1_all into company_name, company_loc, company_no; exit when c1_all%notfound; end loop; if c1_all%isopen then close c1_all; end if; end; / call test_cursor_1(); drop procedure test_cursor_1; --test explicit cursor with args create or replace procedure test_cursor_2 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c2_no_range(no_1 integer, no_2 integer) is --cursor with args select name, loc, no from company where no >=no_1 and no <= no_2 order by 1, 2, 3; begin if not c2_no_range%isopen then open c2_no_range(5,10); end if; loop fetch c2_no_range into company_name, company_loc, company_no; exit when c2_no_range%notfound; end loop; if c2_no_range%isopen then close c2_no_range; dbms_output.put_line('c2_no_range closed'); end if; end; / call test_cursor_2(); drop procedure test_cursor_2; --test explicit cursor attributes create or replace procedure test_cursor_3 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c1_all is --cursor without args select name, loc, no from company order by 1, 2, 3; begin if not c1_all%isopen then open c1_all; end if; loop fetch c1_all into company_name, company_loc, company_no; if c1_all%notfound then exit; end if; if c1_all%found then end if; end loop; if c1_all%isopen then close c1_all; end if; end; / call test_cursor_3(); drop procedure test_cursor_3; --test implicit cursor attributes: (sql%)%found,%notfound,%isopen,%rowcount create or replace procedure test_cursor_4 as begin delete from company where loc='china'; if sql%isopen then --sql%isopen always false, as closed after the execution of sql. end if; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; end; / call test_cursor_4(); drop procedure test_cursor_4; --test dynamic cursor: (weak type)without return create or replace procedure test_cursor_5() as company_name varchar(100); company_loc varchar(100); company_no integer; type ref_cur_type is ref cursor; --declare cursor type my_cur ref_cur_type; --declare cursor var sqlstr varchar(100); begin sqlstr := 'select name,loc,no from company where loc=:1 order by 1, 2, 3'; open my_cur for 'select name,loc,no from company order by 1, 2, 3'; fetch my_cur into company_name,company_loc,company_no; while my_cur%found loop fetch my_cur into company_name,company_loc,company_no; end loop; close my_cur; end; / call test_cursor_5(); drop procedure test_cursor_5; ----test more than one cursors access create or replace procedure test_cursor_6 as company_name varchar(100); company_loc varchar(100); company_no integer; cursor c1_all is --cursor without args select name, loc, no from company order by 1, 2, 3; cursor c2_no_range(no_1 integer, no_2 integer) is --cursor with args select name, loc, no from company where no >=no_1 and no <= no_2 order by 1, 2, 3; begin open c1_all; open c2_no_range(50,100); --result null fetch c1_all into company_name, company_loc, company_no; fetch c2_no_range into company_name, company_loc, company_no; if c1_all%found then end if; if c1_all%notfound then end if; if c2_no_range%found then end if; if c2_no_range%notfound then end if; end; / call test_cursor_6(); drop procedure test_cursor_6; drop table company; create table tbl (id int); insert into tbl values (1); insert into tbl values (2); insert into tbl values (3); insert into tbl values (4); create or replace procedure sp_testsp as temp1 integer; temp2 integer; sql_str varchar2(200); begin declare type crs_recode_type is ref cursor; c1 crs_recode_type; begin temp1 := 4; temp2 := 0; sql_str := 'select id from tbl where id < :a and id > :b order by 1'; open c1 for sql_str using in temp1, in temp2; loop fetch c1 into temp1; exit when c1%notfound; end loop; close c1; --test implicit cursor rowcount attribute select id into temp1 from tbl where id=2 order by 1; update tbl set id=100 where id<3; insert into tbl select * from tbl; delete from tbl; end; end; / call sp_testsp(); drop procedure sp_testsp; drop table tbl; ------------------------------------------------------------------------------ -----test implicit cursor attributes for DML: select,insert,update,delete----- ------------------------------------------------------------------------------ create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp as v int:=0; begin --select select v1 into v from t1 where v1=1; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; --insert insert into t1 values (4,'abc4'); if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; --update update t1 set v1=v1+100 where v1>1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; dbms_output.put_line('test update: sql%rowcount=' || sql%rowcount); update t1 set v1=v1+100 where v1<1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; --delete delete from t1 where v1>1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; delete from t1 where v1<1000; if not sql%isopen then --sql%isopen always be false end if; if sql%found then end if; if sql%notfound then end if; end; / call sp_testsp(); drop procedure sp_testsp; drop table t1; ------------------------------------------------------------------------------ -----support A db's cursor in or out params--------------------------------- ------------------------------------------------------------------------------ CREATE TABLE TBL(VALUE INT); INSERT INTO TBL VALUES (1); INSERT INTO TBL VALUES (2); INSERT INTO TBL VALUES (3); INSERT INTO TBL VALUES (4); CREATE OR REPLACE PROCEDURE TEST_SP IS CURSOR C1(NO IN VARCHAR2) IS SELECT * FROM TBL WHERE VALUE < NO ORDER BY 1; CURSOR C2(NO OUT VARCHAR2) IS SELECT * FROM TBL WHERE VALUE < 10 ORDER BY 1; V INT; RESULT INT; BEGIN OPEN C1(10); OPEN C2(RESULT); LOOP FETCH C1 INTO V; IF C1%FOUND THEN ELSE EXIT; END IF; END LOOP; CLOSE C1; LOOP FETCH C2 INTO V; IF C2%FOUND THEN ELSE EXIT; END IF; END LOOP; CLOSE C2; END; / CALL TEST_SP(); DROP TABLE TBL; DROP PROCEDURE TEST_SP; --------------------------------------------------------------------------------- ----- test the mixed use of implicit and explicit cursor attributes ------------- ----- test the effect of the implicit cursor use to explicit cursor attributes -- --------------------------------------------------------------------------------- drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_select as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --select select v1 into v from t1 where v1=1; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_select(); drop procedure sp_testsp_select; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_insert as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --insert insert into t1 values (4,'abc4'); if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_insert(); drop procedure sp_testsp_insert; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_update as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --update update t1 set v1=v1+100 where v1>1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; dbms_output.put_line('test update: cur%rowcount=' || cur%rowcount); update t1 set v1=v1+100 where v1<1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_update(); drop procedure sp_testsp_update; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_delete as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --delete delete from t1 where v1>1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; delete from t1 where v1<1000; if not cur%isopen then end if; if cur%found then end if; if cur%notfound then end if; close cur; end; / call sp_testsp_delete(); drop procedure sp_testsp_delete; drop table t1; --------------------------------------------------------------------------------- ----- test the mixed use of implicit and explicit cursor attributes ------------- ----- test the effect of the explicit cursor use to implicit cursor attributes -- --------------------------------------------------------------------------------- create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_select as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --select select v1 into v from t1 where v1=1; fetch cur into v; fetch cur into v; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_select(); drop procedure sp_testsp_select; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_insert as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --insert insert into t1 values (4,'abc4'); fetch cur into v; fetch cur into v; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_insert(); drop procedure sp_testsp_insert; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_update as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --update update t1 set v1=v1+100 where v1>1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; dbms_output.put_line('test update: sql%rowcount=' || sql%rowcount); update t1 set v1=v1+100 where v1<1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_update(); drop procedure sp_testsp_update; drop table t1; create table t1(v1 int,v2 varchar2(100)); insert into t1 values (1,'abc1'); insert into t1 values (2,'abc2'); insert into t1 values (3,'abc3'); create or replace procedure sp_testsp_delete as v int:=0; CURSOR cur IS select v1 from t1; begin open cur; --delete delete from t1 where v1>1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; delete from t1 where v1<1000; fetch cur into v; fetch cur into v; if not sql%isopen then end if; if sql%found then end if; if sql%notfound then end if; close cur; end; / call sp_testsp_delete(); drop procedure sp_testsp_delete; drop table t1; -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- CREATE TABLE TBL(V1 INTEGER); INSERT INTO TBL VALUES(1); INSERT INTO TBL VALUES(2); CREATE OR REPLACE PROCEDURE SP_TEST AS CURSOR CUR IS SELECT * FROM TBL; BEGIN --EXPLICIT CURSOR ATTRIBUTES INITIAL STATUS IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; OPEN CUR; IF CUR%FOUND THEN ELSIF NOT CUR%FOUND THEN ELSE END IF; IF CUR%NOTFOUND THEN ELSIF NOT CUR%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('CUR%ROWCOUNT INITIAL STATUS : ' || NVL(TO_CHAR(CUR%ROWCOUNT),'NULL')); CLOSE CUR; IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; --IMPLICIT CURSOR ATTRIBUTES INITIAL STATUS IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('SQL%ROWCOUNT INITIAL STATUS : ' || NVL(TO_CHAR(SQL%ROWCOUNT),'NULL')); END; / CALL SP_TEST(); DROP TABLE TBL; DROP PROCEDURE SP_TEST; -- GAUSSDBV100R001C00-754 CREATE TABLE TBL_H248LNK_INFO(ULBSGMODULENO INTEGER); INSERT INTO TBL_H248LNK_INFO VALUES(123); INSERT INTO TBL_H248LNK_INFO VALUES(456); INSERT INTO TBL_H248LNK_INFO VALUES(789); CREATE TABLE TBL (I_MODULENO INTEGER); CREATE OR REPLACE PROCEDURE TEST_CURSOR AS TYPE CUR_TYPE IS REF CURSOR; CUR CUR_TYPE; PSV_SQL VARCHAR2(1000); PI_MODULENO INTEGER; TBL_STR VARCHAR2(1000) := 'TBL'; BEGIN OPEN CUR FOR SELECT DISTINCT ULBSGMODULENO FROM TBL_H248LNK_INFO; LOOP FETCH CUR INTO PI_MODULENO; EXIT WHEN CUR%NOTFOUND; PSV_SQL := 'BEGIN INSERT INTO TBL (I_MODULENO) VALUES('||PI_MODULENO||');END;'; EXECUTE IMMEDIATE PSV_SQL; -- check cursor attris status IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; IF CUR%FOUND THEN ELSIF NOT CUR%FOUND THEN ELSE END IF; IF CUR%NOTFOUND THEN ELSIF NOT CUR%NOTFOUND THEN ELSE END IF; IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; END LOOP; -- check cursor attris status IF CUR%ISOPEN THEN ELSIF NOT CUR%ISOPEN THEN ELSE END IF; IF CUR%FOUND THEN ELSIF NOT CUR%FOUND THEN ELSE END IF; IF CUR%NOTFOUND THEN ELSIF NOT CUR%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('CUR%ROWCOUNT : ' || NVL(TO_CHAR(CUR%ROWCOUNT),'NULL')); IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; END; / CALL TEST_CURSOR(); DROP PROCEDURE TEST_CURSOR; DROP TABLE TBL_H248LNK_INFO; DROP TABLE TBL; DROP TABLE TBL_RCWSCFG; CREATE TABLE TBL_RCWSCFG ( IWSNO INTEGER, USCDBMID SMALLINT, USWSBOARDMID SMALLINT, UCWSTYPE8100 SMALLINT, UCWSTYPE6600 SMALLINT, UCLOGINTYPE SMALLINT, UCTTSCAPABILITY SMALLINT, UCASRCAPABILITY SMALLINT, UCRESCAPABILITY CHARACTER VARYING(8) ); INSERT INTO TBL_RCWSCFG VALUES (0, 184, 472, 0, 1, 0, NULL, NULL, '11011000'); CREATE TABLE TBL_TEMP_MODULE_312 ( I_MODULENO INTEGER ); CREATE OR REPLACE PROCEDURE TEST_TEMP AS BEGIN END; / CREATE OR REPLACE PROCEDURE TEST_CRS_RPT_EMPTYSOR(FLAG INTEGER) AS TYPE T_PSTMT_CRS_RPT_EMPTY IS REF CURSOR; CRS_RPT_EMPTY T_PSTMT_CRS_RPT_EMPTY; PI_MODULENO INTEGER; PSV_MODULETBLNAME VARCHAR2(128) := 'TBL_TEMP_MODULE_312'; PSV_SQL VARCHAR2(128); V_TEMP INTEGER := 0; PI_NN INTEGER := NULL; BEGIN OPEN CRS_RPT_EMPTY FOR SELECT DISTINCT USCDBMID FROM TBL_RCWSCFG WHERE IWSNO >=0 AND IWSNO <= 0; LOOP FETCH CRS_RPT_EMPTY INTO PI_MODULENO; EXIT WHEN CRS_RPT_EMPTY%NOTFOUND; IF (FLAG = 0) THEN -- INSERT INTO TBL_TEMP_MODULE_312, INSERT TRIGGER FUNCTION CALLED PSV_SQL := 'BEGIN INSERT INTO '||PSV_MODULETBLNAME||' (I_MODULENO) VALUES('||PI_MODULENO||');END;'; EXECUTE IMMEDIATE PSV_SQL; ELSE TEST_TEMP(); END IF; END LOOP; -- check cursor attris status IF CRS_RPT_EMPTY%ISOPEN THEN ELSIF NOT CRS_RPT_EMPTY%ISOPEN THEN ELSE END IF; IF CRS_RPT_EMPTY%FOUND THEN ELSIF NOT CRS_RPT_EMPTY%FOUND THEN ELSE END IF; IF CRS_RPT_EMPTY%NOTFOUND THEN ELSIF NOT CRS_RPT_EMPTY%NOTFOUND THEN ELSE END IF; DBMS_OUTPUT.PUT_LINE('CRS_RPT_EMPTY%ROWCOUNT : ' || NVL(TO_CHAR(CRS_RPT_EMPTY%ROWCOUNT),'NULL')); IF SQL%ISOPEN THEN ELSIF NOT SQL%ISOPEN THEN ELSE END IF; IF SQL%FOUND THEN ELSIF NOT SQL%FOUND THEN ELSE END IF; IF SQL%NOTFOUND THEN ELSIF NOT SQL%NOTFOUND THEN ELSE END IF; END; / CALL TEST_CRS_RPT_EMPTYSOR(0); CALL TEST_CRS_RPT_EMPTYSOR(1); DROP PROCEDURE TEST_TEMP; DROP PROCEDURE TEST_CRS_RPT_EMPTYSOR; DROP TABLE TBL_RCWSCFG; drop table TBL_TEMP_MODULE_312; CREATE TABLE TEST_TB(ID INTEGER); INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(125); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP END LOOP; END; / --2 TEST FOR DISPLAY CURSOR IN (SELECT ,INSERT ,UPDATE ,DELETE); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP -- FOR SELECT SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; -- FOR INSERT INSERT INTO TEST_TB VALUES (125); IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; --UPDATE UPDATE TEST_TB SET ID=ID+1 WHERE ID=124; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; --DELETE DELETE FROM TEST_TB WHERE ID=125; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; END LOOP; END; / DROP TABLE IF EXISTS TEST_TB; --3 TEST FOR IMPLICIT CURSOR IN (SELECT ,INSERT ,UPDATE ,DELETE) CREATE TABLE TEST_TB (ID INT); INSERT INTO TEST_TB VALUES (123); INSERT INTO TEST_TB VALUES (124); INSERT INTO TEST_TB VALUES (125); DECLARE TEMP INTEGER = 0; BEGIN -- FOR SELECT SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; -- FOR INSERT INSERT INTO TEST_TB VALUES (125); IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; --UPDATE UPDATE TEST_TB SET ID=ID+1 WHERE ID<124; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; --DELETE DELETE FROM TEST_TB WHERE ID<125; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; END; / DROP TABLE IF EXISTS TEST_TB; --4 TEST FOR IMPLICIT CURSOR; CREATE TABLE TEST_TB (ID INT); INSERT INTO TEST_TB VALUES (123); INSERT INTO TEST_TB VALUES (124); INSERT INTO TEST_TB VALUES (125); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123; IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE END IF; IF SQL%FOUND THEN END IF; IF NOT SQL%NOTFOUND THEN END IF; DBMS_OUTPUT.PUT_LINE('TEST SELECT: SQL%ROWCOUNT=' || SQL%ROWCOUNT); END LOOP; END; / DROP TABLE IF EXISTS TEST_TB; CREATE TABLE TEST_TB(ID INTEGER); INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(125); DECLARE CURSOR CURS1 IS SELECT * FROM TEST_TB; TEMP INTEGER:=0; BEGIN FOR VARA IN CURS1 LOOP END LOOP; IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE END IF; IF CURS1%FOUND THEN END IF; IF CURS1%NOTFOUND THEN END IF; END; / DROP TABLE IF EXISTS TEST_TB; --TEST FOR CURSOR SYS_REFCURSOR IN PROCEDURE AND EMPTY TABLE; --IF THE RESULT IS 0 ,THAT'S OK,ELSE IS ERROR; DROP TABLE IF EXISTS TEST_TBL; CREATE TABLE TEST_TBL(ID INTEGER); CREATE OR REPLACE PROCEDURE T1(O OUT SYS_REFCURSOR) IS C1 SYS_REFCURSOR; BEGIN OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID; O := C1; END; / DECLARE C1 SYS_REFCURSOR; TEMP INTEGER; BEGIN T1(C1); LOOP FETCH C1 INTO TEMP; EXIT WHEN C1%NOTFOUND; END LOOP; END; / DROP TABLE IF EXISTS TEST_TBL; DROP PROCEDURE T1; --TEST FOR CURSOR REFCURSOR IN PROCEDURE AND EMPTY TABLE; --IF THE RESULT IS 0 ,THAT'S OK,ELSE IS ERROR; DROP TABLE IF EXISTS TEST_TBL; CREATE TABLE TEST_TBL(ID INTEGER); CREATE OR REPLACE PROCEDURE T2(O OUT REFCURSOR) IS C1 SYS_REFCURSOR; BEGIN OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID; O := C1; END; / DECLARE C1 REFCURSOR; TEMP INTEGER; BEGIN T2(C1); LOOP FETCH C1 INTO TEMP; EXIT WHEN C1%NOTFOUND; END LOOP; END; / DROP TABLE IF EXISTS TEST_TBL; DROP PROCEDURE T2; --TEST CURSOR IN Anonymous block DROP TABLE IF EXISTS TEST_TBL; CREATE TABLE TEST_TBL(ID INTEGER); DECLARE C1 REFCURSOR; TEMP INTEGER; BEGIN OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID; LOOP FETCH C1 INTO TEMP; EXIT WHEN C1%NOTFOUND; END LOOP; END; / DROP TABLE IF EXISTS TEST_TBL; DROP PROCEDURE TEST_TEMP; DROP PROCEDURE TEST_CRS_RPT_EMPTYSOR; DROP TABLE TBL_RCWSCFG; drop table TBL_TEMP_MODULE_312; CREATE TABLE TBL_RCWSCFG ( IWSNO INTEGER, USCDBMID SMALLINT ); INSERT INTO TBL_RCWSCFG VALUES (0, 184); CREATE TABLE TBL_TEMP_MODULE_312 ( I_MODULENO INTEGER ); CREATE OR REPLACE PROCEDURE TEST_TEMP AS BEGIN END; / CREATE OR REPLACE PROCEDURE TEST_CRS_RPT_EMPTYSOR(FLAG INTEGER) AS TYPE T_PSTMT_CRS_RPT_EMPTY IS REF CURSOR; CRS_RPT_EMPTY T_PSTMT_CRS_RPT_EMPTY; PI_MODULENO INTEGER; PSV_MODULETBLNAME VARCHAR2(128) := 'TBL_TEMP_MODULE_312'; PSV_SQL VARCHAR2(128); PI_NN INTEGER := NULL; BEGIN OPEN CRS_RPT_EMPTY FOR SELECT DISTINCT USCDBMID FROM TBL_RCWSCFG; LOOP FETCH CRS_RPT_EMPTY INTO PI_MODULENO; EXIT WHEN CRS_RPT_EMPTY%NOTFOUND; IF (FLAG = 0) THEN -- INSERT INTO TBL_TEMP_MODULE_312, INSERT TRIGGER FUNCTION CALLED PSV_SQL := 'BEGIN INSERT INTO '||PSV_MODULETBLNAME||' (I_MODULENO) VALUES('||PI_MODULENO||');END;'; EXECUTE IMMEDIATE PSV_SQL; ELSE TEST_TEMP(); END IF; END LOOP; -- check cursor attris status DBMS_OUTPUT.PUT_LINE('CRS_RPT_EMPTY%ROWCOUNT : ' || NVL(TO_CHAR(CRS_RPT_EMPTY%ROWCOUNT),'NULL')); END; / CALL TEST_CRS_RPT_EMPTYSOR(0); CALL TEST_CRS_RPT_EMPTYSOR(1); DROP TABLE TBL_TEMP_MODULE_312; --test cursor define create or replace procedure pro_cursor_c0019() as declare cursor cursor1 for create table t1(a int); BEGIN END; / create table t1(a int); --test with query create or replace procedure test_cursor() as declare cursor cursor1 is with recursive StepCTE(a) as (select a from t1) select * from StepCTE; BEGIN null; END; / cursor pro_cursor_c0019_1 with hold for select * from t1; create or replace procedure pro_cursor_c0019() as declare cursor cursor1 for fetch pro_cursor_c0019_1; BEGIN open cursor1; close cursor1; END; / select * from pro_cursor_c0019(); close pro_cursor_c0019_1; select * from pro_cursor_c0019(); drop table t1;
<filename>visitor.sql SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+05:30"; CREATE TABLE `visitors` ( `id` int(11) NOT NULL, `user_id` text COLLATE utf8_unicode_ci NOT NULL, `user_token` text COLLATE utf8_unicode_ci NOT NULL, `user_ip` text COLLATE utf8_unicode_ci NOT NULL, `user_agent` text COLLATE utf8_unicode_ci NOT NULL, `url` text COLLATE utf8_unicode_ci NOT NULL, `visitor_from` text COLLATE utf8_unicode_ci, `city` text COLLATE utf8_unicode_ci NOT NULL, `region` text COLLATE utf8_unicode_ci NOT NULL, `country` text COLLATE utf8_unicode_ci NOT NULL, `loc` text COLLATE utf8_unicode_ci NOT NULL, `isp` text COLLATE utf8_unicode_ci NOT NULL, `timezone` text COLLATE utf8_unicode_ci NOT NULL, `visited_on` text COLLATE utf8_unicode_ci NOT NULL, `last_seen` text COLLATE utf8_unicode_ci NOT NULL, `added_on` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ALTER TABLE `visitors` ADD PRIMARY KEY (`id`); COMMIT;
delete from posts where tags like '%<javascript>%' or tags like '%<java>%' or tags like '%<c#>%' or tags like '%<php>%' or tags like '%<android>%' or tags like '%<python>%' or tags like '%<jquery>%' or tags like '%<html>%' or tags like '%<ios>%' or tags like '%<css>%' or tags like '%<mysql>%' or tags like '%<sql>%' or tags like '%<asp.net>%' or tags like '%<ruby-on-rails>%' or tags like '%<objective-c>%' or tags like '%<.net>%' or tags like '%<angularjs>%' or tags like '%<r>%' or tags like '%<json>%' or tags like '%<sql-server>%' or tags like '%<iphone>%' or tags like '%<node.js>%' or tags like '%<ruby>%' or tags like '%<swift>%' or tags like '%<ajax>%' or tags like '%<asp.net-mvc>%' or tags like '%<django>%' or tags like '%<excel>%' or tags like '%<wpf>%' or tags like '%<wordpress>%' or tags like '%<spring>%' or tags like '%<xcode>%' or tags like '%<windows>%' or tags like '%<vb.net>%' or tags like '%<eclipse>%' or tags like '%<html5>%' or tags like '%<angular>%' or tags like '%<git>%' or tags like '%<mongodb>%' or tags like '%<vba>%' or tags like '%<oracle>%' or tags like '%<python-3.x>%' or tags like '%<twitter-bootstrap>%' or tags like '%<forms>%' or tags like '%<image>%' or tags like '%<laravel>%' or tags like '%<postgresql>%' or tags like '%<facebook>%' or tags like '%<python-2.7>%' or tags like '%<apache>%' or tags like '%<winforms>%' or tags like '%<visual-studio>%' or tags like '%<matlab>%' or tags like '%<scala>%' or tags like '%<reactjs>%' or tags like '%<excel-vba>%' or tags like '%<entity-framework>%' or tags like '%<css3>%' or tags like '%<swing>%' or tags like '%<linq>%' or tags like '%<pandas>%' or tags like '%<.htaccess>%' or tags like '%<maven>%' or tags like '%<perl>%' or tags like '%<codeigniter>%' or tags like '%<web-services>%' or tags like '%<google-maps>%' or tags like '%<uitableview>%' or tags like '%<symfony>%' or tags like '%<cordova>%' or tags like '%<ruby-on-rails-3>%' or tags like '%<powershell>%' or tags like '%<csv>%' or tags like '%<google-chrome>%' or tags like '%<sql-server-2008>%' or tags like '%<tsql>%' or tags like '%<typescript>%' or tags like '%<selenium>%' or tags like '%<xaml>%' or tags like '%<wcf>%' or tags like '%<android-layout>%' or tags like '%<jsp>%' or tags like '%<http>%' or tags like '%<spring-mvc>%' or tags like '%<visual-studio-2010>%' or tags like '%<numpy>%' or tags like '%<listview>%' or tags like '%<firebase>%' or tags like '%<android-studio>%' or tags like '%<asp.net-mvc-4>%' or tags like '%<delphi>%' or tags like '%<actionscript-3>%' or tags like '%<google-app-engine>%' or tags like '%<asp.net-mvc-3>%' or tags like '%<jquery-ui>%' or tags like '%<ms-access>%' or tags like '%<cocoa>%' or tags like '%<magento>%' or tags like '%<haskell>%' or tags like '%<internet-explorer>%'
<reponame>OpenPerpetuum/OPDB-docs USE [perpetuumsa] GO --------------------------------------- -- NPC ALPHA MARKET SELLS for gamma items -- Staging base, T0 blocks, decon, mods etc. -- Date modified: 2021/11/20 --------------------------------------- DECLARE @T0_AMMO_NAME AS VARCHAR(128) = 'def_construction_module_ammo_t0'; DECLARE @STAGING_BASE_NAME AS VARCHAR(128) = 'def_pbs_expiring_docking_base_capsule'; DECLARE @TERRAFORM_AMMO_NAME AS VARCHAR(128) = 'def_ammo_terraform'; DECLARE @CONSTRUCTION_MOD_NAME AS VARCHAR(128) = 'def_pbs_construction_module'; DECLARE @TERRAFORM_MOD_NAME AS VARCHAR(128) = 'def_terraform_multi_module'; DECLARE @DECONSTRUCTION_AMMO_NAME AS VARCHAR(128) = 'def_construction_module_ammo_deconstruct'; DROP TABLE IF EXISTS #SELLS; CREATE TABLE #SELLS( defName VARCHAR(100), price FLOAT ); INSERT INTO #SELLS (defName, price) VALUES (@T0_AMMO_NAME, 100000), (@STAGING_BASE_NAME, 25000000), (@TERRAFORM_AMMO_NAME,10000), (@CONSTRUCTION_MOD_NAME,500000), (@TERRAFORM_MOD_NAME,500000), (@DECONSTRUCTION_AMMO_NAME, 10000); UPDATE entitydefaults SET enabled=1, hidden=0, purchasable=1 WHERE definitionname IN (SELECT defName FROM #SELLS); PRINT N'SELECT TERMINAL DEFINITIONS'; DECLARE @MAIN_TERMINAL_DEFS AS TABLE (definition INT); INSERT INTO @MAIN_TERMINAL_DEFS SELECT definition FROM entitydefaults WHERE definitionname IN ( 'def_public_docking_base_nuimqol', 'def_public_docking_base_pelistal', 'def_public_docking_base_thelodica' ); DECLARE @MAIN_AND_PVE_OUTPOSTS AS TABLE (definition INT); INSERT INTO @MAIN_AND_PVE_OUTPOSTS (definition) SELECT definition FROM entitydefaults WHERE definitionname IN ( 'def_public_docking_base_nuimqol_outpost_pve', 'def_public_docking_base_thelodica_outpost_pve', 'def_public_docking_base_pelistal_outpost_pve' ); INSERT INTO @MAIN_AND_PVE_OUTPOSTS (definition) SELECT definition FROM @MAIN_TERMINAL_DEFS; PRINT N'SELECT MARKET ENTITIES'; DECLARE @ALPHA_MARKETS TABLE (eid BIGINT); DECLARE @BETA_PUBLIC_MARKETS TABLE (eid BIGINT); DECLARE @MARKET_DEF AS INT = (SELECT TOP 1 definition FROM entitydefaults WHERE definitionname='def_public_market'); INSERT INTO @ALPHA_MARKETS (eid) SELECT e.eid FROM entities e JOIN zoneentities ze ON e.parent=ze.eid JOIN zones z ON z.id=ze.zoneID WHERE (SELECT TOP 1 definition FROM entities WHERE eid=ze.eid) IN (SELECT definition FROM @MAIN_AND_PVE_OUTPOSTS) AND e.definition=@MARKET_DEF AND z.protected=1 AND zonetype=1; --alpha DECLARE @VENDOR_DEF AS INT = (SELECT TOP 1 definition FROM entitydefaults WHERE definitionname='def_public_vendor'); DECLARE @ALPHA_MARKETS_AND_VENDOR TABLE (market BIGINT, vendor BIGINT); INSERT INTO @ALPHA_MARKETS_AND_VENDOR (market, vendor) SELECT m.eid market, v.eid vendor FROM entities v JOIN entities m ON m.parent=v.parent AND v.definition=@VENDOR_DEF AND m.eid IN (SELECT eid FROM @ALPHA_MARKETS); DECLARE @ALPHA_ORDERS TABLE (marketEid BIGINT, itemDef INT, vendorEid BIGINT, price FLOAT); INSERT INTO @ALPHA_ORDERS (marketEid, itemDef, vendorEid, price) SELECT market, (select definition from entitydefaults where definitionname=defName), vendor, price FROM @ALPHA_MARKETS_AND_VENDOR m JOIN #SELLS o ON 1=1; MERGE [dbo].[marketitems] m USING @ALPHA_ORDERS o ON m.marketeid = o.marketEid AND m.itemdefinition = o.itemDef AND m.submittereid = o.vendorEid AND m.isSell=1 AND m.isVendorItem=1 AND m.duration=0 AND m.quantity=-1 WHEN MATCHED THEN UPDATE SET price = o.price WHEN NOT MATCHED THEN INSERT (marketeid, itemdefinition, submittereid, duration, isSell, price, quantity, usecorporationwallet, isvendoritem) VALUES (o.marketEid, o.itemDef, o.vendorEid, 0, 1, o.price, -1, 0, 1); MERGE [dbo].[marketitems] m USING #SELLS o ON m.itemdefinition = (SELECT TOP 1 definition FROM entitydefaults WHERE o.defName=definitionname) AND m.isSell=1 AND m.isVendorItem=1 AND m.duration=0 AND m.quantity=-1 WHEN MATCHED THEN UPDATE SET price = o.price; PRINT N'ALPHA ORDERS FOR GAMMA SEEDED'; GO
<filename>sql/setup.sql CREATE AGGREGATE FUNCTION trimmean_20 RETURNS REAL SONAME 'libtrimmean_plugin.so'; CREATE USER cobitis_service@localhost IDENTIFIED BY '***'; CREATE DATABASE cobitis_session CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; GRANT ALL ON cobitis_session.* TO cobitis_service@localhost; CREATE DATABASE cobitis_app CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; GRANT SELECT, INSERT, UPDATE ON cobitis_app.* TO cobitis_service@localhost; -- On database cobitis_app CREATE TABLE users ( user_id INT NOT NULL AUTO_INCREMENT, auth_provider VARCHAR(16) NOT NULL, auth_id VARCHAR(64) NOT NULL UNIQUE, description TEXT, is_deleted BOOLEAN NOT NULL DEFAULT FALSE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (user_id), INDEX (is_deleted) ); CREATE TABLE sensors ( sensor_id INT NOT NULL AUTO_INCREMENT, user_id INT, secret CHAR(32) NOT NULL UNIQUE, description TEXT, is_deleted BOOLEAN NOT NULL DEFAULT FALSE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (sensor_id), FOREIGN KEY (user_id) REFERENCES users (user_id), INDEX (is_deleted) ); CREATE TABLE measurements ( sensor_id INT NOT NULL, measured_at BIGINT UNSIGNED NOT NULL DEFAULT UNIX_TIMESTAMP(), temp1 FLOAT, temp2 FLOAT, tds FLOAT, is_deleted BOOLEAN NOT NULL DEFAULT FALSE, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (sensor_id, measured_at), FOREIGN KEY (sensor_id) REFERENCES sensors (sensor_id), INDEX (is_deleted) );
<reponame>Melanchorilla-Youtube-Tutorial/wpu-ci4<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Nov 06, 2021 at 09:17 AM -- Server version: 10.4.20-MariaDB -- PHP Version: 7.4.22 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `wpu-ci4` -- -- -------------------------------------------------------- -- -- Table structure for table `komik` -- CREATE TABLE `komik` ( `id` int(11) NOT NULL, `judul` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `penulis` varchar(255) NOT NULL, `penerbit` varchar(255) NOT NULL, `sampul` varchar(255) NOT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `komik` -- INSERT INTO `komik` (`id`, `judul`, `slug`, `penulis`, `penerbit`, `sampul`, `created_at`, `updated_at`) VALUES (1, 'Naruto Season 1', 'naruto-season-1', '<NAME>', 'Shonen Jump', 'naruto.jpg', NULL, '2021-11-05 11:11:06'), (2, 'One Piece', 'one-piece', 'Eichiro Oda', 'Gramedia', 'onepiece.jpg', NULL, NULL), (4, 'Eye shield 21', 'eye-shield-21', '<NAME>', 'Penerbit', '1636128805_13aa5baa7a16be520326.jpg', '2021-11-04 05:49:55', '2021-11-05 11:13:25'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` bigint(20) UNSIGNED NOT NULL, `version` varchar(255) NOT NULL, `class` varchar(255) NOT NULL, `group` varchar(255) NOT NULL, `namespace` varchar(255) NOT NULL, `time` int(11) NOT NULL, `batch` int(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `version`, `class`, `group`, `namespace`, `time`, `batch`) VALUES (1, '2021-11-06-004207', 'App\\Database\\Migrations\\Orang', 'default', 'App', 1636159717, 1); -- -------------------------------------------------------- -- -- Table structure for table `orang` -- CREATE TABLE `orang` ( `id` int(11) UNSIGNED NOT NULL, `nama` varchar(255) NOT NULL, `alamat` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `orang` -- INSERT INTO `orang` (`id`, `nama`, `alamat`, `created_at`, `updated_at`) VALUES (1, '<NAME>', 'Ds. Diponegoro No. 355, Cirebon 71737, Maluku', '2006-07-25 22:32:53', '2021-11-05 22:49:39'), (2, '<NAME>', 'Ds. Yos Sudarso No. 951, Cimahi 41212, Kaltara', '1982-04-02 19:02:03', '2021-11-05 22:49:39'), (3, '<NAME>', '<NAME> No. 646, Kendari 97770, Sulteng', '2019-03-08 17:38:55', '2021-11-05 22:49:40'), (4, 'Eka Anggraini M.M.', 'Dk. Sutami No. 663, Bitung 84155, Bengkulu', '2014-12-10 00:44:38', '2021-11-05 22:49:40'), (5, '<NAME>', 'Kpg. Dewi Sartika No. 771, Tegal 60693, Bali', '2018-10-28 02:57:51', '2021-11-05 22:49:40'), (6, '<NAME>', 'Kpg. Raya Setiabudhi No. 921, Mataram 42799, Sumsel', '2007-01-27 22:50:07', '2021-11-05 22:49:40'), (7, '<NAME>', 'Kpg. Pelajar Pejuang 45 No. 773, Parepare 34874, Sultra', '2007-11-28 08:23:41', '2021-11-05 22:49:40'), (8, '<NAME>', 'Gg. Bambon No. 162, Tanjung Pinang 63452, NTT', '2007-11-27 13:28:01', '2021-11-05 22:49:40'), (9, '<NAME>', 'Jr. Baya Kali Bungur No. 419, Tual 25692, Sultra', '1999-01-22 17:12:06', '2021-11-05 22:49:40'), (10, '<NAME>.', 'Gg. Bayan No. 887, Malang 37730, Lampung', '1972-07-30 22:11:59', '2021-11-05 22:49:40'), (11, '<NAME>', 'Psr. Ujung No. 712, Gunungsitoli 82102, Maluku', '1983-06-10 09:19:59', '2021-11-05 22:49:40'), (12, '<NAME>', 'Ds. Casablanca No. 722, Palangka Raya 40333, NTT', '2004-02-24 00:16:42', '2021-11-05 22:49:40'), (13, '<NAME>', 'Gg. Sugiono No. 49, Banjarmasin 96638, Bengkulu', '1970-03-27 06:08:03', '2021-11-05 22:49:40'), (14, '<NAME>.T.', 'Psr. Kusmanto No. 889, Padangpanjang 33903, Maluku', '1973-04-16 19:44:34', '2021-11-05 22:49:40'), (15, '<NAME>', 'Gg. Karel S. Tubun No. 943, Jayapura 79081, Sumbar', '1970-04-28 02:58:47', '2021-11-05 22:49:40'), (16, '<NAME>.Pd', 'Jln. Veteran No. 764, Mataram 10835, Sulbar', '2003-09-15 14:36:07', '2021-11-05 22:49:41'), (17, '<NAME>', 'Ki. Gedebage Selatan No. 403, Administrasi Jakarta Timur 25786, DKI', '2009-08-23 14:19:29', '2021-11-05 22:49:41'), (18, '<NAME>', 'Ki. Bak Air No. 408, Parepare 77678, Kaltim', '1976-06-02 05:35:29', '2021-11-05 22:49:41'), (19, '<NAME>', 'Gg. B.Agam Dlm No. 18, Tomohon 45217, Jabar', '2001-07-30 08:51:09', '2021-11-05 22:49:41'), (20, '<NAME>', 'Gg. Bambon No. 489, Bitung 10913, NTT', '2015-01-28 04:45:24', '2021-11-05 22:49:41'), (21, '<NAME>', 'Jln. Bayam No. 28, Batam 47253, Aceh', '1980-06-08 19:46:35', '2021-11-05 22:49:41'), (22, '<NAME>', 'Kpg. Bawal No. 25, Cimahi 99624, Kepri', '1985-04-15 16:57:23', '2021-11-05 22:49:41'), (23, '<NAME> S.Pt', 'Gg. Untung Suropati No. 982, Medan 26035, Kepri', '2005-11-12 15:21:19', '2021-11-05 22:49:41'), (24, '<NAME>', 'Jln. Haji No. 697, Denpasar 30379, DKI', '1986-08-05 02:55:55', '2021-11-05 22:49:41'), (25, '<NAME> S.Psi', 'Ds. Jaksa No. 179, Cimahi 73545, Kepri', '1979-12-26 01:39:38', '2021-11-05 22:49:41'), (26, '<NAME>', 'Gg. Bayam No. 990, Kediri 31624, DIY', '1993-09-16 07:32:41', '2021-11-05 22:49:41'), (27, '<NAME>.H.', 'Ki. Baya Kali Bungur No. 843, Magelang 66258, Kepri', '1996-07-09 16:13:44', '2021-11-05 22:49:41'), (28, '<NAME>', 'Jln. <NAME> No. 703, Pariaman 63227, Sumbar', '1975-08-11 13:19:37', '2021-11-05 22:49:41'), (29, '<NAME>.', 'Ds. <NAME>dah No. 146, Cirebon 53496, Sumut', '2012-03-02 20:22:13', '2021-11-05 22:49:41'), (30, '<NAME>', 'Kpg. Imam Bonjol No. 43, Padangpanjang 53379, Sumbar', '1999-04-21 23:36:55', '2021-11-05 22:49:41'), (31, '<NAME> S.Gz', 'Ki. Wahidin No. 689, Langsa 22042, Gorontalo', '2013-03-15 06:57:37', '2021-11-05 22:49:41'), (32, '<NAME>', 'Psr. Ciwastra No. 986, Pagar Alam 15189, Sumsel', '2009-07-18 20:24:23', '2021-11-05 22:49:41'), (33, '<NAME>', 'Jln. W.R. Supratman No. 727, Probolinggo 24511, Kalteng', '2002-06-11 09:43:03', '2021-11-05 22:49:41'), (34, '<NAME>', 'Psr. Tambak No. 156, Banjar 63009, Aceh', '1980-06-09 23:52:32', '2021-11-05 22:49:41'), (35, '<NAME>', 'Jr. Cokroaminoto No. 519, Palopo 41516, Sulbar', '2007-05-24 16:27:39', '2021-11-05 22:49:42'), (36, '<NAME>.Psi', 'Psr. Ciwastra No. 361, Surakarta 74747, Kepri', '1988-03-18 02:13:34', '2021-11-05 22:49:42'), (37, '<NAME>', 'Jr. Baja Raya No. 928, Bengkulu 62501, Banten', '1983-12-06 15:41:10', '2021-11-05 22:49:42'), (38, '<NAME>', 'Gg. Barasak No. 244, Tebing Tinggi 23358, Papua', '2011-12-27 20:43:18', '2021-11-05 22:49:42'), (39, '<NAME>', 'Jln. Jend. Sudirman No. 448, Palopo 45962, Lampung', '1990-07-08 04:08:46', '2021-11-05 22:49:42'), (40, '<NAME>', 'Dk. Baik No. 368, Tasikmalaya 25534, DIY', '2005-01-09 09:36:25', '2021-11-05 22:49:42'), (41, '<NAME>', 'Jln. Cut Nyak Dien No. 498, Bontang 48649, Sulbar', '2020-12-03 21:05:27', '2021-11-05 22:49:42'), (42, '<NAME>', 'Jr. Baja No. 203, Padangpanjang 38505, Kalbar', '2018-04-03 10:26:13', '2021-11-05 22:49:42'), (43, '<NAME>', 'Kpg. Jakarta No. 792, Palembang 76087, Gorontalo', '1977-08-10 12:31:13', '2021-11-05 22:49:42'), (44, '<NAME>', 'Psr. Nanas No. 725, Ambon 74989, Riau', '1976-12-26 22:12:40', '2021-11-05 22:49:42'), (45, 'Radika Situmorang S.Gz', 'Jln. Bak Air No. 244, Palangka Raya 36360, Kalbar', '2018-10-03 20:50:15', '2021-11-05 22:49:42'), (46, '<NAME>', 'Jr. Kalimantan No. 450, Tidore Kepulauan 20726, Bengkulu', '1984-12-04 08:45:44', '2021-11-05 22:49:42'), (47, '<NAME>', 'Jr. Kalimantan No. 798, Administrasi Jakarta Utara 59315, Jatim', '1996-10-30 20:16:57', '2021-11-05 22:49:42'), (48, '<NAME>', 'Jr. Sampangan No. 429, Subulussalam 27764, Kalteng', '1975-06-30 02:50:36', '2021-11-05 22:49:42'), (49, 'L<NAME>ah M.TI.', 'Dk. Krakatau No. 268, Tanjungbalai 29738, Banten', '1983-07-05 16:44:09', '2021-11-05 22:49:42'), (50, '<NAME>', 'Dk. Baiduri No. 412, Subulussalam 54778, Kepri', '1981-07-10 08:51:25', '2021-11-05 22:49:42'), (51, '<NAME>', 'Ki. <NAME> No. 337, Padangsidempuan 13239, Sulteng', '2019-10-09 01:30:43', '2021-11-05 22:49:42'), (52, '<NAME>', 'Psr. Rajawali Barat No. 691, Pekanbaru 20259, Babel', '2004-06-28 11:19:17', '2021-11-05 22:49:42'), (53, '<NAME>.E.I', 'Ki. Moch. Yamin No. 48, Subulussalam 97772, Sultra', '1986-02-11 19:22:04', '2021-11-05 22:49:42'), (54, '<NAME>.Ked', 'Kpg. Setia Budi No. 420, Sibolga 27565, Gorontalo', '1990-05-10 18:08:27', '2021-11-05 22:49:43'), (55, '<NAME>', 'Ds. Ronggowarsito No. 525, Banda Aceh 56304, Kalsel', '1991-01-27 19:10:57', '2021-11-05 22:49:43'), (56, '<NAME>', 'Gg. Bak Mandi No. 905, Tomohon 61136, DIY', '2016-09-20 02:07:30', '2021-11-05 22:49:43'), (57, '<NAME>', 'Dk. Sudirman No. 870, Pontianak 13497, Kepri', '1979-02-12 03:24:58', '2021-11-05 22:49:43'), (58, '<NAME>', 'Dk. Sutami No. 472, Solok 27972, Pabar', '1972-04-26 00:24:14', '2021-11-05 22:49:43'), (59, '<NAME>', 'Jln. Katamso No. 139, Pangkal Pinang 17942, Jabar', '1985-10-28 17:14:38', '2021-11-05 22:49:43'), (60, 'Winda Puspa Uyainah S.H.', 'Gg. Baranang No. 916, Administrasi Jakarta Utara 78203, Sumbar', '1988-02-11 18:39:25', '2021-11-05 22:49:43'), (61, '<NAME>ika Handay<NAME>', 'Jr. PHH. Mustofa No. 314, Sukabumi 13269, Sulsel', '1983-08-20 04:52:23', '2021-11-05 22:49:43'), (62, '<NAME>', 'Psr. Muwardi No. 436, Cirebon 92444, Pabar', '2004-11-09 10:30:15', '2021-11-05 22:49:43'), (63, '<NAME>', 'Gg. Ki Hajar Dewantara No. 683, Tangerang 89942, Sultra', '2019-12-10 09:37:17', '2021-11-05 22:49:43'), (64, '<NAME> S.Psi', 'Ds. Labu No. 346, Makassar 34818, Banten', '2012-01-06 21:44:18', '2021-11-05 22:49:43'), (65, '<NAME>', 'Psr. Hang No. 751, Tual 98135, Riau', '2017-01-25 22:34:05', '2021-11-05 22:49:43'), (66, '<NAME> S.T.', 'Jln. Raden Saleh No. 697, Pangkal Pinang 52431, Jambi', '1995-11-29 17:47:21', '2021-11-05 22:49:43'), (67, '<NAME>', 'Ds. Wahidin No. 600, Mojokerto 11237, Pabar', '2006-07-09 20:39:39', '2021-11-05 22:49:43'), (68, '<NAME>', 'Dk. Sampangan No. 126, Bengkulu 40131, Kalbar', '1982-03-10 15:54:01', '2021-11-05 22:49:43'), (69, '<NAME>', 'Kpg. Astana Anyar No. 267, Mataram 42743, Jabar', '2006-07-21 19:09:27', '2021-11-05 22:49:43'), (70, '<NAME>', 'Jln. Perintis Kemerdekaan No. 265, Kupang 97987, Kaltim', '2017-01-27 15:20:45', '2021-11-05 22:49:44'), (71, '<NAME> S.E.', 'Psr. Baiduri No. 615, Sabang 79778, NTT', '1991-08-03 13:40:34', '2021-11-05 22:49:44'), (72, '<NAME> S.Gz', 'Dk. Monginsidi No. 809, Kotamobagu 57259, Kalbar', '1999-12-17 10:00:26', '2021-11-05 22:49:44'), (73, '<NAME>', 'Jr. Jakarta No. 346, Singkawang 42659, Bali', '1991-09-20 09:48:53', '2021-11-05 22:49:44'), (74, '<NAME>', 'Ds. Basuki No. 862, Bengkulu 36780, Kaltim', '1998-02-20 01:15:47', '2021-11-05 22:49:44'), (75, '<NAME>', 'Ki. Gatot Subroto No. 20, Depok 99747, Gorontalo', '2005-09-19 18:26:56', '2021-11-05 22:49:44'), (76, '<NAME>', 'Jr. Casablanca No. 245, Bima 13505, Banten', '1973-04-02 20:30:00', '2021-11-05 22:49:44'), (77, '<NAME>', 'Psr. Mulyadi No. 84, Tual 90023, Kepri', '1980-03-13 10:01:50', '2021-11-05 22:49:44'), (78, '<NAME>', 'Ki. Bara No. 59, Tangerang Selatan 99484, Sumut', '1990-08-22 03:58:00', '2021-11-05 22:49:44'), (79, '<NAME>', 'Dk. Otto No. 714, Tangerang 33523, Aceh', '2020-10-28 21:27:39', '2021-11-05 22:49:44'), (80, '<NAME>', 'Ki. Rajawali Barat No. 593, Parepare 93971, Lampung', '2001-03-10 18:11:28', '2021-11-05 22:49:44'), (81, '<NAME>.Farm', 'Dk. Supomo No. 520, Medan 55179, Sumsel', '2003-09-22 03:58:41', '2021-11-05 22:49:44'), (82, '<NAME>', 'Psr. Sampangan No. 443, Pariaman 58601, Kalbar', '2002-08-26 09:14:10', '2021-11-05 22:49:44'), (83, '<NAME>', 'Ki. Samanhudi No. 669, Banjarbaru 24894, Kaltim', '2013-12-02 07:59:45', '2021-11-05 22:49:44'), (84, '<NAME>', 'Ki. Elang No. 742, Tebing Tinggi 43092, Jatim', '1976-11-19 03:52:00', '2021-11-05 22:49:44'), (85, '<NAME>', 'Kpg. Orang No. 413, Pekanbaru 56717, Sulsel', '1991-01-09 05:36:09', '2021-11-05 22:49:44'), (86, '<NAME>', 'Jln. Wahid Hasyim No. 485, Pekanbaru 65587, Jateng', '1990-08-04 21:09:34', '2021-11-05 22:49:45'), (87, '<NAME>', 'Ki. Basket No. 516, Binjai 40635, Banten', '1992-10-01 08:42:43', '2021-11-05 22:49:45'), (88, '<NAME>', 'Jr. Baya Kali Bungur No. 683, Bandar Lampung 56403, Riau', '2016-11-24 14:46:08', '2021-11-05 22:49:45'), (89, '<NAME>', 'Dk. Arifin No. 956, Palangka Raya 51499, Jambi', '1990-06-24 06:06:22', '2021-11-05 22:49:45'), (90, '<NAME>', 'Ds. Katamso No. 614, Tomohon 97686, Kaltara', '2018-11-10 06:25:48', '2021-11-05 22:49:45'), (91, '<NAME> S.I.Kom', 'Kpg. Rajawali Barat No. 550, Samarinda 97321, Jambi', '1987-10-26 00:49:39', '2021-11-05 22:49:45'), (92, '<NAME> S.Sos', 'Ki. Agus Salim No. 875, Padang 57688, Banten', '1998-09-06 15:52:01', '2021-11-05 22:49:45'), (93, '<NAME> M.Pd', 'Jln. Tambun No. 811, Tangerang 51439, Jambi', '1998-03-01 16:41:11', '2021-11-05 22:49:45'), (94, '<NAME> M.M.', 'Ki. Sugiyopranoto No. 479, Lhokseumawe 88270, Sulut', '1978-06-15 06:35:35', '2021-11-05 22:49:45'), (95, 'Among Maryadi S.Pt', 'Psr. Lada No. 823, Bontang 76530, Jateng', '2006-05-19 17:33:04', '2021-11-05 22:49:45'), (96, '<NAME>', 'Jln. Laksamana No. 249, Balikpapan 90327, Kalteng', '1976-11-07 02:12:10', '2021-11-05 22:49:45'), (97, '<NAME>.', 'Jr. Cemara No. 781, Singkawang 62434, DIY', '1994-03-27 10:35:14', '2021-11-05 22:49:45'), (98, '<NAME>', 'Ki. Padang No. 107, Balikpapan 83635, Sumut', '1986-05-10 07:24:41', '2021-11-05 22:49:45'), (99, '<NAME>', 'Gg. Pelajar Pejuang 45 No. 520, Gorontalo 25002, Gorontalo', '2013-08-09 19:56:05', '2021-11-05 22:49:45'), (100, '<NAME>', 'Dk. Radio No. 541, Banjar 32726, Riau', '1989-10-14 03:22:00', '2021-11-05 22:49:45'); -- -- Indexes for dumped tables -- -- -- Indexes for table `komik` -- ALTER TABLE `komik` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orang` -- ALTER TABLE `orang` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `komik` -- ALTER TABLE `komik` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `orang` -- ALTER TABLE `orang` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101; 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 */;
INSERT INTO `article` VALUES (14, 'Title3', 'Content3asdasd', 1, 2, '2016-7-5 02:04:05', '2016-7-7 04:50:51'); INSERT INTO `article` VALUES (16, 'Title5', 'Content5asd', 1, 1, '2016-7-5 02:04:05', '2016-7-7 04:50:56'); INSERT INTO `article` VALUES (17, 'Title6', 'Content6', 1, 6, '2016-7-5 02:04:05', '2016-7-5 02:04:05'); INSERT INTO `article` VALUES (18, 'Title7', 'Content7', 1, 7, '2016-7-5 02:04:05', '2016-7-5 02:04:05'); INSERT INTO `article` VALUES (19, 'Title8', 'Content8', 1, 8, '2016-7-5 02:04:05', '2016-7-5 02:04:05'); INSERT INTO `article` VALUES (20, 'Title9', 'Content9', 1, 9, '2016-7-5 02:04:05', '2016-7-5 02:04:05'); INSERT INTO `article` VALUES (21, 'asgasdgag', 'adfgdasf', 2, 0, '2016-7-5 11:44:31', '2016-7-5 11:44:31'); INSERT INTO `article` VALUES (22, '都是vsdfgvs', '阿瑟发到付 ', 2, 0, '2016-7-6 00:54:50', '2016-7-6 00:54:50'); INSERT INTO `article` VALUES (23, '阿大声道', '啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊大事件不断部分与青蛙不是娿uasbdubausbdu啊啊护士都不顾亚比速度把预算表的话爱速度不爱上百度不是孤独爱USB断不苏杭的爸爸说u爱USB毒霸吧按时发大厦的房顶上鬼刀啊是的噶速度跟山东干傻大个发撒地方水电费水电费是的发生的地方地方是否', 2, 0, '2016-7-6 02:13:14', '2016-7-6 02:13:14'); INSERT INTO `article` VALUES (24, 'asdas', 'asdasdasd', 2, 0, '2016-7-6 02:39:18', '2016-7-6 02:39:18'); INSERT INTO `article` VALUES (25, 'fsdfsdf', 'sdfsdfsdf', 2, 0, '2016-7-6 02:39:40', '2016-7-6 02:39:40'); INSERT INTO `article` VALUES (26, 'nihaoa a a a ', 'aaaaa实打实大声道', 2, 4, '2016-7-6 02:39:51', '2016-7-6 08:20:24'); INSERT INTO `article` VALUES (27, 'daima', 'PATH=/usr/local/php5/bin:$PATH\r\nexport PATH', 2, 0, '2016-7-6 02:41:36', '2016-7-6 02:41:36'); INSERT INTO `article` VALUES (28, 'dd', ' public function show($id){\r\n $article = Article::find($id);\r\n $navList = Category::get();\r\n return \\View::make(\'themes.default.article\',compact(\'article\',\'navList\'));\r\n }', 2, 0, '2016-7-6 02:43:05', '2016-7-6 02:43:05'); INSERT INTO `article` VALUES (29, 'sd', 'asd', 2, 4, '2016-7-6 07:20:30', '2016-7-6 07:20:30');
<filename>sql/semantic/create_semantic_schema.sql<gh_stars>1-10 --drop schema if exists semantic cascade; create schema if not exists semantic;
<filename>ORACLE_SQL/SHARED_FUNCTIONS/14_ORG/14F001_ORG.GET_ORGFUNC_CRNCY_ID.sql /* Formatted on 12-20-2018 9:44:22 AM (QP5 v5.126.903.23003) */ CREATE OR REPLACE FUNCTION ORG.GET_ORGFUNC_CRNCY_ID (P_ORGIDNO NUMBER) RETURN NUMBER AS L_RESULT NUMBER; BEGIN L_RESULT := -1; SELECT OPRTNL_CRNCY_ID INTO L_RESULT FROM ORG.ORG_DETAILS WHERE ORG_ID = P_ORGIDNO; RETURN L_RESULT; EXCEPTION WHEN OTHERS THEN RETURN -1; END; /
<gh_stars>10-100 CREATE TABLE [UserData].[UserLogin] ( [Id] BIGINT IDENTITY (1, 1) NOT NULL, [UserId] BIGINT NOT NULL, [LoginProvider] NVARCHAR (128) NOT NULL, [ProviderKey] NVARCHAR (128) NOT NULL, CONSTRAINT [PK_UserLogin] PRIMARY KEY CLUSTERED ([Id] ASC), CONSTRAINT [FK_UserLogin_User] FOREIGN KEY ([UserId]) REFERENCES [UserData].[User] ([Id]) );
\set ON_ERROR_STOP true CREATE TABLE dec02 ( rownum bigint GENERATED ALWAYS AS IDENTITY, input text ); /* Import the input file. We're using perl to remove the final newline. */ \COPY dec02 (input) FROM PROGRAM 'perl -pe ''chomp if eof'' input.dat' /* * We need the fuzzystrmatch extension the levenshtein function for Part Two. */ CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; \timing on /* Part One */ SELECT sum(two) * sum(three) FROM ( SELECT input, count(*) FILTER ( WHERE EXISTS ( SELECT FROM unnest(string_to_array(input, null)) AS u(x) GROUP BY u.x HAVING count(*) = 2 )) AS two, count(*) FILTER ( WHERE EXISTS ( SELECT FROM unnest(string_to_array(input, null)) AS u(x) GROUP BY u.x HAVING count(*) = 3 )) AS three FROM dec02 GROUP BY input ) _; /* * Part Two * * This assumes that there is only one pair in the input that is off by one. */ WITH inputs (a, b) AS ( SELECT a.input, b.input FROM dec02 AS a JOIN dec02 AS b ON a.rownum < b.rownum WHERE levenshtein(a.input, b.input) = 1 ) SELECT string_agg(a, '' ORDER BY ord) FROM ROWS FROM (unnest(string_to_array((SELECT a FROM inputs), null)), unnest(string_to_array((SELECT b FROM inputs), null)) ) WITH ORDINALITY AS x (a, b, ord) WHERE a = b;
SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN IsPhantom'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN Order_Max'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN Order_Min'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN Order_Pack'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN Order_Period'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN Order_Policy'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN Order_Qty'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN PP_POQ_AggregateOnBPartnerLevel'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN SafetyStock'); SELECT public.db_alter_table('PP_Product_Planning','ALTER TABLE public.M_Product_PlanningSchema DROP COLUMN TimeFence');