Skip to content

Commit

Permalink
#14862 - Update schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Feb 25, 2020
1 parent 7976dcb commit 3bf9412
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 41 deletions.
50 changes: 25 additions & 25 deletions tests/_data/assets/schemas/mysql.sql
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@


drop table if exists `co_customers`;

create table co_customers
(
`cst_id` int(10) auto_increment primary key,
`cst_status_flag` tinyint(1) null,
`cst_name_last` varchar(100) null,
`cst_name_first` varchar(50) null
);

create index co_customers_cst_status_flag_index
on `co_customers` (`cst_status_flag`);

create index co_customers_cst_name_last_index
on `co_customers` (`cst_name_last`);

create index co_customers_cst_name_first_index
on `co_customers` (`cst_name_first`);



drop table if exists `co_invoices`;

create table co_invoices
(
`inv_id` int(10) auto_increment primary key,
Expand All @@ -32,90 +32,90 @@ create table co_invoices
`inv_total` float(10, 2) null,
`inv_created_at` datetime null
);

create index co_invoices_inv_cst_id_index
on `co_invoices` (`inv_cst_id`);

create index co_invoices_inv_status_flag_index
on `co_invoices` (`inv_status_flag`);

create index co_invoices_inv_created_at_index
on `co_invoices` (`inv_created_at`);



drop table if exists objects;

create table objects
(
`obj_id` int(10) auto_increment primary key,
`obj_name` varchar(100) not null,
`obj_type` tinyint(3) unsigned not null
);



drop table if exists `co_orders`;

CREATE TABLE `co_orders` (
`ord_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ord_name` VARCHAR(70) NULL,
PRIMARY KEY (`ord_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



drop table if exists private.`co_orders_x_products`;

CREATE TABLE private.`co_orders_x_products` (
`oxp_ord_id` int(10) unsigned NOT NULL,
`oxp_prd_id` int(10) unsigned NOT NULL,
`oxp_quantity` int(10) unsigned NOT NULL,
PRIMARY KEY (`oxp_ord_id`, `oxp_prd_id` )
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



drop table if exists `co_products`;

CREATE TABLE `co_products` (
`prd_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`prd_name` VARCHAR(70) NULL,
PRIMARY KEY (`prd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



drop table if exists `co_sources`;

create table co_sources
(
`id` int(10) auto_increment primary key,
`username` varchar(100) null,
`source` varchar(100) null
);

create index co_sources_username_index
on co_sources (username);



drop table if exists `table_with_uuid_primary`;

create table table_with_uuid_primary
(
`uuid` char(36) not null primary key,
`int_field` int null
);



drop table if exists `stuff`;

create table stuff
(
`stf_id` int(10) auto_increment primary key,
`stf_name` varchar(100) not null,
`stf_type` tinyint(3) unsigned not null
);

61 changes: 45 additions & 16 deletions tests/_data/assets/schemas/pgsql.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
drop table if exists co_invoices;


drop table if exists co_customers;

create table co_customers
(
cst_id serial not null constraint co_customers_pk primary key,
cst_status_flag smallint null,
cst_name_last varchar(100) null,
cst_name_first varchar(50) null
);

create index co_customers_cst_status_flag_index
on co_customers (cst_status_flag);

create index co_customers_cst_name_last_index
on co_customers (cst_name_last);

create index co_customers_cst_name_first_index
on co_customers (cst_name_first);



drop table if exists co_invoices;

create table co_invoices
(
inv_id serial not null constraint co_invoices_pk primary key,
Expand All @@ -9,56 +32,62 @@ create table co_invoices
inv_total numeric(10, 2),
inv_created_at timestamp
);

alter table co_invoices owner to postgres;


create index co_invoices_inv_created_at_index
on co_invoices (inv_created_at);

create index co_invoices_inv_cst_id_index
on co_invoices (inv_cst_id);

create index co_invoices_inv_status_flag_index
on co_invoices (inv_status_flag);





drop table if exists co_orders;

drop table if exists co_orders;
create table co_orders
(
ord_id serial not null
constraint ord_pk
primary key,
ord_name varchar(70)
);

alter table public.co_orders owner to postgres;



drop table if exists public.co_orders_x_products;

create table public.co_orders_x_products
(
oxp_ord_id int not null,
oxp_prd_id int not null,
oxp_quantity int not null
);

alter table public.co_orders_x_products owner to postgres;




drop table if exists co_products;

drop table if exists co_products;

create table co_products
(
prd_id serial not null
constraint prd_pk
primary key,
prd_name varchar(70)
);

alter table public.co_products owner to postgres;







0 comments on commit 3bf9412

Please sign in to comment.