CREATE TABLE accounts ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), firm_id INT DEFAULT NULL, credit_limit INT DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX accounts_id_idx ON accounts (id); CREATE TABLE funny_jokes ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(50) DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX funny_jokes_id_idx ON funny_jokes (id); CREATE TABLE companies ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), type VARCHAR(50) DEFAULT NULL, ruby_type VARCHAR(50) DEFAULT NULL, firm_id INT DEFAULT NULL, name VARCHAR(50) DEFAULT NULL, client_of INT DEFAULT NULL, rating INT DEFAULT 1, PRIMARY KEY (id) ); CREATE UNIQUE INDEX companies_id_idx ON companies (id); CREATE TABLE topics ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), title VARCHAR(255) DEFAULT NULL, author_name VARCHAR(255) DEFAULT NULL, author_email_address VARCHAR(255) DEFAULT NULL, written_on TIMESTAMP DEFAULT NULL, --bonus_time TIMESTAMP DEFAULT NULL, bonus_time TIME DEFAULT NULL, last_read DATE DEFAULT NULL, content VARCHAR(3000), approved SMALLINT DEFAULT 1, replies_count INT DEFAULT 0, parent_id INT DEFAULT NULL, type VARCHAR(50) DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX topics_id_idx ON topics (id); CREATE TABLE developers ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(100) DEFAULT NULL, salary INT DEFAULT 70000, created_at TIMESTAMP DEFAULT NULL, updated_at TIMESTAMP DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX developers_id_idx ON developers (id); CREATE TABLE projects ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(100) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX projects_id_idx ON projects (id); CREATE TABLE developers_projects ( developer_id INT NOT NULL, project_id INT NOT NULL, joined_on DATE DEFAULT NULL, access_level SMALLINT DEFAULT 1 ); CREATE TABLE orders ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(100) DEFAULT NULL, billing_customer_id INT DEFAULT NULL, shipping_customer_id INT DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX orders_idx ON orders (id); CREATE TABLE customers ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(100) DEFAULT NULL, balance INT DEFAULT 0, address_street VARCHAR(100) DEFAULT NULL, address_city VARCHAR(100) DEFAULT NULL, address_country VARCHAR(100) DEFAULT NULL, gps_location VARCHAR(100) DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX customers_id_idx ON customers (id); CREATE TABLE movies ( movieid INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(100) DEFAULT NULL, PRIMARY KEY (movieid) ); CREATE UNIQUE INDEX movies_id_idx ON movies (movieid); CREATE TABLE subscribers ( nick VARCHAR(100) NOT NULL, name VARCHAR(100) DEFAULT NULL, PRIMARY KEY (nick) ); CREATE UNIQUE INDEX subscribers_id_idx ON subscribers (nick); CREATE TABLE booleantests ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), value INT DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX booleantest_id_idx ON booleantests (id); CREATE TABLE auto_id_tests ( auto_id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), value INT DEFAULT NULL, PRIMARY KEY (auto_id) ); CREATE UNIQUE INDEX auto_id_tests_idx ON auto_id_tests (auto_id); CREATE TABLE entrants ( id INT NOT NULL PRIMARY KEY, name VARCHAR(255) NOT NULL, course_id INT NOT NULL ); CREATE UNIQUE INDEX entrants_id_idx ON entrants (id); CREATE TABLE colnametests ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), references INT NOT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX colnametest_id_idx ON colnametests (id); CREATE TABLE mixins ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), parent_id INT DEFAULT NULL, pos INT DEFAULT NULL, created_at TIMESTAMP DEFAULT NULL, updated_at TIMESTAMP DEFAULT NULL, lft INT DEFAULT NULL, rgt INT DEFAULT NULL, root_id INT DEFAULT NULL, type VARCHAR(40) DEFAULT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX mixins_id_idx ON mixins (id); CREATE TABLE people ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), first_name VARCHAR(40) NOT NULL, lock_version INT DEFAULT 0, PRIMARY KEY (id) ); CREATE UNIQUE INDEX people_id_idx ON people (id); CREATE TABLE readers ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), post_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY (id) ); CREATE UNIQUE INDEX readers_id_idx ON readers (id); CREATE TABLE binaries ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), data BLOB(5000000), PRIMARY KEY (id) ); CREATE UNIQUE INDEX binaries_id_idx ON binaries (id); CREATE LOB TABLESPACE datalob; CREATE AUXILIARY TABLE data_aux IN datalob STORES binaries COLUMN data; CREATE UNIQUE INDEX lob_data_idx ON data_aux; CREATE TABLE computers ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), developer INT NOT NULL, extendedWarranty INT NOT NULL ); CREATE TABLE posts ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), author_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, body VARCHAR(3000) DEFAULT NULL ); CREATE TABLE comments ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), post_id INT DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, body VARCHAR(3000) DEFAULT NULL ); CREATE TABLE authors ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(255) DEFAULT NULL ); CREATE TABLE tasks ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), starting TIMESTAMP DEFAULT NULL, ending TIMESTAMP DEFAULT NULL ); CREATE TABLE categories ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(255) NOT NULL, type VARCHAR(40) DEFAULT NULL ); CREATE TABLE categories_posts ( category_id INT NOT NULL, post_id INT NOT NULL ); CREATE TABLE keyboards ( key_number INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), name VARCHAR(255) ); CREATE TABLE fk_test_has_pk ( id INT NOT NULL PRIMARY KEY ); CREATE UNIQUE INDEX fk_test_has_id_idx ON fk_test_has_pk (id); CREATE TABLE fk_test_has_fk ( id INT NOT NULL PRIMARY KEY, fk_id INT NOT NULL, FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id) ); CREATE UNIQUE INDEX fk_test_has_fk_idx ON fk_test_has_fk (id); --This table has an altered lock_version column name CREATE TABLE legacy_things ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), tps_report_number INT DEFAULT NULL, version INT DEFAULT 0, PRIMARY KEY (id) ); CREATE UNIQUE INDEX legacy_thin_id_idx ON legacy_things (id); CREATE TABLE numeric_data ( id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), bank_balance DECIMAL(10,2), big_bank_balance DECIMAL(15,2), world_population DECIMAL(10), my_house_population DECIMAL(2), decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78 ); CREATE UNIQUE INDEX numeric_data_idx ON numeric_data (id); CREATE TABLE mixed_case_monkeys ( monkeyID INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100), fleaCount INT DEFAULT 0, PRIMARY KEY (monkeyID) ); CREATE UNIQUE INDEX mixed_monkeys_idx ON mixed_case_monkeys (monkeyID);