added unit test for #2568

This commit is contained in:
Carsten Brandt
2014-02-27 15:12:18 +01:00
parent ad06b80e6e
commit c21e01930e
8 changed files with 126 additions and 11 deletions

View File

@ -9,6 +9,7 @@ DROP TABLE IF EXISTS tbl_item CASCADE;
DROP TABLE IF EXISTS tbl_order CASCADE;
DROP TABLE IF EXISTS tbl_category CASCADE;
DROP TABLE IF EXISTS tbl_customer CASCADE;
DROP TABLE IF EXISTS tbl_profile CASCADE;
DROP TABLE IF EXISTS tbl_type CASCADE;
DROP TABLE IF EXISTS tbl_null_values CASCADE;
DROP TABLE IF EXISTS tbl_constraints CASCADE;
@ -19,12 +20,18 @@ CREATE TABLE tbl_constraints
field1 varchar(255)
);
CREATE TABLE tbl_profile (
id serial not null primary key,
description varchar(128) NOT NULL
);
CREATE TABLE tbl_customer (
id serial not null primary key,
email varchar(128) NOT NULL,
name varchar(128),
address text,
status integer DEFAULT 0
status integer DEFAULT 0,
profile_id integer
);
comment on column public.tbl_customer.email is 'someone@example.com';
@ -79,9 +86,12 @@ CREATE TABLE tbl_type (
bool_col2 smallint DEFAULT '1'
);
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user1@example.com', 'user1', 'address1', 1);
INSERT INTO tbl_profile (description) VALUES ('profile customer 1');
INSERT INTO tbl_profile (description) VALUES ('profile customer 3');
INSERT INTO tbl_customer (email, name, address, status, profile_id) VALUES ('user1@example.com', 'user1', 'address1', 1, 1);
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user2@example.com', 'user2', 'address2', 1);
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user3@example.com', 'user3', 'address3', 2);
INSERT INTO tbl_customer (email, name, address, status, profile_id) VALUES ('user3@example.com', 'user3', 'address3', 2, 2);
INSERT INTO tbl_category (name) VALUES ('Books');
INSERT INTO tbl_category (name) VALUES ('Movies');