activerecord 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activerecord might be problematic. Click here for more details.
- data/CHANGELOG +168 -6
- data/README +27 -22
- data/RUNNING_UNIT_TESTS +7 -4
- data/Rakefile +22 -25
- data/lib/active_record.rb +8 -2
- data/lib/active_record/aggregations.rb +21 -12
- data/lib/active_record/association_preload.rb +277 -0
- data/lib/active_record/associations.rb +481 -295
- data/lib/active_record/associations/association_collection.rb +162 -37
- data/lib/active_record/associations/association_proxy.rb +71 -7
- data/lib/active_record/associations/belongs_to_association.rb +5 -3
- data/lib/active_record/associations/belongs_to_polymorphic_association.rb +5 -6
- data/lib/active_record/associations/has_and_belongs_to_many_association.rb +12 -64
- data/lib/active_record/associations/has_many_association.rb +8 -73
- data/lib/active_record/associations/has_many_through_association.rb +68 -117
- data/lib/active_record/associations/has_one_association.rb +7 -5
- data/lib/active_record/associations/has_one_through_association.rb +28 -0
- data/lib/active_record/attribute_methods.rb +69 -19
- data/lib/active_record/base.rb +496 -275
- data/lib/active_record/calculations.rb +28 -21
- data/lib/active_record/callbacks.rb +9 -38
- data/lib/active_record/connection_adapters/abstract/connection_specification.rb +3 -2
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +2 -2
- data/lib/active_record/connection_adapters/abstract/query_cache.rb +6 -0
- data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +232 -45
- data/lib/active_record/connection_adapters/abstract/schema_statements.rb +141 -27
- data/lib/active_record/connection_adapters/abstract_adapter.rb +9 -13
- data/lib/active_record/connection_adapters/mysql_adapter.rb +57 -24
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +143 -42
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/sqlite_adapter.rb +18 -10
- data/lib/active_record/dirty.rb +158 -0
- data/lib/active_record/fixtures.rb +121 -156
- data/lib/active_record/locking/optimistic.rb +14 -11
- data/lib/active_record/locking/pessimistic.rb +2 -2
- data/lib/active_record/migration.rb +157 -77
- data/lib/active_record/named_scope.rb +163 -0
- data/lib/active_record/observer.rb +19 -5
- data/lib/active_record/reflection.rb +34 -14
- data/lib/active_record/schema.rb +7 -14
- data/lib/active_record/schema_dumper.rb +4 -4
- data/lib/active_record/serialization.rb +5 -5
- data/lib/active_record/serializers/json_serializer.rb +37 -28
- data/lib/active_record/serializers/xml_serializer.rb +52 -29
- data/lib/active_record/test_case.rb +36 -0
- data/lib/active_record/timestamp.rb +4 -4
- data/lib/active_record/transactions.rb +3 -3
- data/lib/active_record/validations.rb +182 -248
- data/lib/active_record/version.rb +2 -2
- data/test/{fixtures → assets}/example.log +0 -0
- data/test/{fixtures → assets}/flowers.jpg +0 -0
- data/test/cases/aaa_create_tables_test.rb +24 -0
- data/test/cases/active_schema_test_mysql.rb +95 -0
- data/test/cases/active_schema_test_postgresql.rb +24 -0
- data/test/{adapter_test.rb → cases/adapter_test.rb} +15 -14
- data/test/{adapter_test_sqlserver.rb → cases/adapter_test_sqlserver.rb} +95 -95
- data/test/{aggregations_test.rb → cases/aggregations_test.rb} +20 -20
- data/test/{ar_schema_test.rb → cases/ar_schema_test.rb} +6 -6
- data/test/cases/associations/belongs_to_associations_test.rb +412 -0
- data/test/{associations → cases/associations}/callbacks_test.rb +24 -10
- data/test/{associations → cases/associations}/cascaded_eager_loading_test.rb +18 -17
- data/test/cases/associations/eager_load_nested_include_test.rb +83 -0
- data/test/{associations → cases/associations}/eager_singularization_test.rb +5 -5
- data/test/{associations → cases/associations}/eager_test.rb +216 -51
- data/test/{associations → cases/associations}/extension_test.rb +8 -8
- data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +684 -0
- data/test/cases/associations/has_many_associations_test.rb +932 -0
- data/test/cases/associations/has_many_through_associations_test.rb +190 -0
- data/test/cases/associations/has_one_associations_test.rb +323 -0
- data/test/cases/associations/has_one_through_associations_test.rb +74 -0
- data/test/{associations → cases/associations}/inner_join_association_test.rb +20 -20
- data/test/{associations → cases/associations}/join_model_test.rb +175 -35
- data/test/cases/associations_test.rb +262 -0
- data/test/{attribute_methods_test.rb → cases/attribute_methods_test.rb} +103 -11
- data/test/{base_test.rb → cases/base_test.rb} +338 -191
- data/test/{binary_test.rb → cases/binary_test.rb} +6 -4
- data/test/{calculations_test.rb → cases/calculations_test.rb} +35 -23
- data/test/{callbacks_test.rb → cases/callbacks_test.rb} +7 -7
- data/test/{class_inheritable_attributes_test.rb → cases/class_inheritable_attributes_test.rb} +3 -3
- data/test/{column_alias_test.rb → cases/column_alias_test.rb} +3 -3
- data/test/{connection_test_firebird.rb → cases/connection_test_firebird.rb} +2 -2
- data/test/{connection_test_mysql.rb → cases/connection_test_mysql.rb} +2 -2
- data/test/{copy_table_test_sqlite.rb → cases/copy_table_test_sqlite.rb} +13 -13
- data/test/{datatype_test_postgresql.rb → cases/datatype_test_postgresql.rb} +8 -8
- data/test/{date_time_test.rb → cases/date_time_test.rb} +5 -5
- data/test/{default_test_firebird.rb → cases/default_test_firebird.rb} +3 -3
- data/test/{defaults_test.rb → cases/defaults_test.rb} +8 -6
- data/test/{deprecated_finder_test.rb → cases/deprecated_finder_test.rb} +3 -3
- data/test/cases/dirty_test.rb +163 -0
- data/test/cases/finder_respond_to_test.rb +76 -0
- data/test/{finder_test.rb → cases/finder_test.rb} +266 -33
- data/test/{fixtures_test.rb → cases/fixtures_test.rb} +88 -72
- data/test/cases/helper.rb +47 -0
- data/test/{inheritance_test.rb → cases/inheritance_test.rb} +61 -17
- data/test/cases/invalid_date_test.rb +24 -0
- data/test/{json_serialization_test.rb → cases/json_serialization_test.rb} +36 -11
- data/test/{lifecycle_test.rb → cases/lifecycle_test.rb} +16 -13
- data/test/{locking_test.rb → cases/locking_test.rb} +17 -10
- data/test/{method_scoping_test.rb → cases/method_scoping_test.rb} +75 -39
- data/test/{migration_test.rb → cases/migration_test.rb} +420 -80
- data/test/{migration_test_firebird.rb → cases/migration_test_firebird.rb} +3 -3
- data/test/{mixin_test.rb → cases/mixin_test.rb} +7 -6
- data/test/{modules_test.rb → cases/modules_test.rb} +11 -6
- data/test/{multiple_db_test.rb → cases/multiple_db_test.rb} +5 -5
- data/test/cases/named_scope_test.rb +157 -0
- data/test/{pk_test.rb → cases/pk_test.rb} +10 -10
- data/test/{query_cache_test.rb → cases/query_cache_test.rb} +12 -10
- data/test/{readonly_test.rb → cases/readonly_test.rb} +11 -11
- data/test/{reflection_test.rb → cases/reflection_test.rb} +15 -14
- data/test/{reserved_word_test_mysql.rb → cases/reserved_word_test_mysql.rb} +4 -5
- data/test/{schema_authorization_test_postgresql.rb → cases/schema_authorization_test_postgresql.rb} +5 -5
- data/test/cases/schema_dumper_test.rb +138 -0
- data/test/cases/schema_test_postgresql.rb +102 -0
- data/test/{serialization_test.rb → cases/serialization_test.rb} +7 -7
- data/test/{synonym_test_oracle.rb → cases/synonym_test_oracle.rb} +5 -5
- data/test/{table_name_test_sqlserver.rb → cases/table_name_test_sqlserver.rb} +3 -3
- data/test/{threaded_connections_test.rb → cases/threaded_connections_test.rb} +7 -7
- data/test/{transactions_test.rb → cases/transactions_test.rb} +31 -5
- data/test/{unconnected_test.rb → cases/unconnected_test.rb} +2 -2
- data/test/{validations_test.rb → cases/validations_test.rb} +141 -39
- data/test/{xml_serialization_test.rb → cases/xml_serialization_test.rb} +12 -12
- data/test/config.rb +5 -0
- data/test/connections/native_db2/connection.rb +1 -1
- data/test/connections/native_firebird/connection.rb +1 -1
- data/test/connections/native_frontbase/connection.rb +1 -1
- data/test/connections/native_mysql/connection.rb +1 -1
- data/test/connections/native_openbase/connection.rb +1 -1
- data/test/connections/native_oracle/connection.rb +1 -1
- data/test/connections/native_postgresql/connection.rb +1 -3
- data/test/connections/native_sqlite/connection.rb +2 -2
- data/test/connections/native_sqlite3/connection.rb +2 -2
- data/test/connections/native_sqlite3/in_memory_connection.rb +3 -3
- data/test/connections/native_sybase/connection.rb +1 -1
- data/test/fixtures/author_addresses.yml +5 -0
- data/test/fixtures/authors.yml +2 -0
- data/test/fixtures/clubs.yml +6 -0
- data/test/fixtures/jobs.yml +7 -0
- data/test/fixtures/members.yml +4 -0
- data/test/fixtures/memberships.yml +20 -0
- data/test/fixtures/owners.yml +7 -0
- data/test/fixtures/people.yml +4 -1
- data/test/fixtures/pets.yml +14 -0
- data/test/fixtures/posts.yml +1 -0
- data/test/fixtures/price_estimates.yml +7 -0
- data/test/fixtures/readers.yml +5 -0
- data/test/fixtures/references.yml +17 -0
- data/test/fixtures/sponsors.yml +9 -0
- data/test/fixtures/subscribers.yml +7 -0
- data/test/fixtures/subscriptions.yml +12 -0
- data/test/fixtures/taggings.yml +4 -1
- data/test/fixtures/topics.yml +22 -2
- data/test/fixtures/warehouse-things.yml +3 -0
- data/test/{fixtures/migrations_with_decimal → migrations/decimal}/1_give_me_big_numbers.rb +0 -0
- data/test/{fixtures/migrations_with_duplicate → migrations/duplicate}/1_people_have_last_names.rb +1 -1
- data/test/{fixtures/migrations_with_duplicate → migrations/duplicate}/2_we_need_reminders.rb +1 -1
- data/test/{fixtures/migrations_with_duplicate → migrations/duplicate}/3_foo.rb +0 -0
- data/test/{fixtures/migrations → migrations/duplicate}/3_innocent_jointable.rb +0 -0
- data/test/migrations/duplicate_names/20080507052938_chunky.rb +7 -0
- data/test/migrations/duplicate_names/20080507053028_chunky.rb +7 -0
- data/test/{fixtures/migrations_with_duplicate → migrations/interleaved/pass_1}/3_innocent_jointable.rb +0 -0
- data/test/{fixtures/migrations → migrations/interleaved/pass_2}/1_people_have_last_names.rb +1 -1
- data/test/{fixtures/migrations_with_missing_versions/4_innocent_jointable.rb → migrations/interleaved/pass_2/3_innocent_jointable.rb} +0 -0
- data/test/{fixtures/migrations_with_missing_versions → migrations/interleaved/pass_3}/1_people_have_last_names.rb +1 -1
- data/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +8 -0
- data/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +12 -0
- data/test/{fixtures/migrations_with_missing_versions → migrations/missing}/1000_people_have_middle_names.rb +1 -1
- data/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/test/{fixtures/migrations_with_missing_versions → migrations/missing}/3_we_need_reminders.rb +1 -1
- data/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/test/migrations/valid/1_people_have_last_names.rb +9 -0
- data/test/{fixtures/migrations → migrations/valid}/2_we_need_reminders.rb +1 -1
- data/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/test/{fixtures → models}/author.rb +28 -4
- data/test/{fixtures → models}/auto_id.rb +0 -0
- data/test/{fixtures → models}/binary.rb +0 -0
- data/test/{fixtures → models}/book.rb +0 -0
- data/test/{fixtures → models}/categorization.rb +0 -0
- data/test/{fixtures → models}/category.rb +8 -5
- data/test/{fixtures → models}/citation.rb +0 -0
- data/test/models/club.rb +7 -0
- data/test/{fixtures → models}/column_name.rb +0 -0
- data/test/{fixtures → models}/comment.rb +5 -3
- data/test/{fixtures → models}/company.rb +15 -6
- data/test/{fixtures → models}/company_in_module.rb +5 -3
- data/test/{fixtures → models}/computer.rb +0 -1
- data/test/{fixtures → models}/contact.rb +1 -1
- data/test/{fixtures → models}/course.rb +0 -0
- data/test/{fixtures → models}/customer.rb +8 -8
- data/test/{fixtures → models}/default.rb +0 -0
- data/test/{fixtures → models}/developer.rb +14 -10
- data/test/{fixtures → models}/edge.rb +0 -0
- data/test/{fixtures → models}/entrant.rb +0 -0
- data/test/models/guid.rb +2 -0
- data/test/{fixtures → models}/item.rb +0 -0
- data/test/models/job.rb +5 -0
- data/test/{fixtures → models}/joke.rb +0 -0
- data/test/{fixtures → models}/keyboard.rb +0 -0
- data/test/{fixtures → models}/legacy_thing.rb +0 -0
- data/test/{fixtures → models}/matey.rb +0 -0
- data/test/models/member.rb +9 -0
- data/test/models/membership.rb +9 -0
- data/test/{fixtures → models}/minimalistic.rb +0 -0
- data/test/{fixtures → models}/mixed_case_monkey.rb +0 -0
- data/test/{fixtures → models}/movie.rb +0 -0
- data/test/{fixtures → models}/order.rb +2 -2
- data/test/models/owner.rb +4 -0
- data/test/{fixtures → models}/parrot.rb +0 -0
- data/test/models/person.rb +10 -0
- data/test/models/pet.rb +4 -0
- data/test/models/pirate.rb +9 -0
- data/test/{fixtures → models}/post.rb +23 -2
- data/test/models/price_estimate.rb +3 -0
- data/test/{fixtures → models}/project.rb +1 -0
- data/test/{fixtures → models}/reader.rb +0 -0
- data/test/models/reference.rb +4 -0
- data/test/{fixtures → models}/reply.rb +7 -5
- data/test/{fixtures → models}/ship.rb +0 -0
- data/test/models/sponsor.rb +4 -0
- data/test/{fixtures → models}/subject.rb +0 -0
- data/test/{fixtures → models}/subscriber.rb +2 -0
- data/test/models/subscription.rb +4 -0
- data/test/{fixtures → models}/tag.rb +0 -0
- data/test/{fixtures → models}/tagging.rb +0 -0
- data/test/{fixtures → models}/task.rb +0 -0
- data/test/{fixtures → models}/topic.rb +32 -4
- data/test/{fixtures → models}/treasure.rb +2 -0
- data/test/{fixtures → models}/vertex.rb +0 -0
- data/test/models/warehouse_thing.rb +5 -0
- data/test/schema/mysql_specific_schema.rb +12 -0
- data/test/schema/postgresql_specific_schema.rb +103 -0
- data/test/schema/schema.rb +421 -0
- data/test/schema/schema2.rb +6 -0
- data/test/schema/sqlite_specific_schema.rb +25 -0
- data/test/schema/sqlserver_specific_schema.rb +5 -0
- metadata +192 -176
- data/test/aaa_create_tables_test.rb +0 -72
- data/test/abstract_unit.rb +0 -84
- data/test/active_schema_test_mysql.rb +0 -46
- data/test/all.sh +0 -8
- data/test/association_inheritance_reload.rb +0 -14
- data/test/associations_test.rb +0 -2177
- data/test/fixtures/bad_fixtures/attr_with_numeric_first_char +0 -1
- data/test/fixtures/bad_fixtures/attr_with_spaces +0 -1
- data/test/fixtures/bad_fixtures/blank_line +0 -3
- data/test/fixtures/bad_fixtures/duplicate_attributes +0 -3
- data/test/fixtures/bad_fixtures/missing_value +0 -1
- data/test/fixtures/db_definitions/db2.drop.sql +0 -33
- data/test/fixtures/db_definitions/db2.sql +0 -235
- data/test/fixtures/db_definitions/db22.drop.sql +0 -2
- data/test/fixtures/db_definitions/db22.sql +0 -5
- data/test/fixtures/db_definitions/firebird.drop.sql +0 -65
- data/test/fixtures/db_definitions/firebird.sql +0 -310
- data/test/fixtures/db_definitions/firebird2.drop.sql +0 -2
- data/test/fixtures/db_definitions/firebird2.sql +0 -6
- data/test/fixtures/db_definitions/frontbase.drop.sql +0 -33
- data/test/fixtures/db_definitions/frontbase.sql +0 -273
- data/test/fixtures/db_definitions/frontbase2.drop.sql +0 -1
- data/test/fixtures/db_definitions/frontbase2.sql +0 -4
- data/test/fixtures/db_definitions/openbase.drop.sql +0 -2
- data/test/fixtures/db_definitions/openbase.sql +0 -318
- data/test/fixtures/db_definitions/openbase2.drop.sql +0 -2
- data/test/fixtures/db_definitions/openbase2.sql +0 -7
- data/test/fixtures/db_definitions/oracle.drop.sql +0 -67
- data/test/fixtures/db_definitions/oracle.sql +0 -330
- data/test/fixtures/db_definitions/oracle2.drop.sql +0 -2
- data/test/fixtures/db_definitions/oracle2.sql +0 -6
- data/test/fixtures/db_definitions/postgresql.drop.sql +0 -44
- data/test/fixtures/db_definitions/postgresql.sql +0 -292
- data/test/fixtures/db_definitions/postgresql2.drop.sql +0 -2
- data/test/fixtures/db_definitions/postgresql2.sql +0 -4
- data/test/fixtures/db_definitions/schema.rb +0 -354
- data/test/fixtures/db_definitions/schema2.rb +0 -11
- data/test/fixtures/db_definitions/sqlite.drop.sql +0 -33
- data/test/fixtures/db_definitions/sqlite.sql +0 -219
- data/test/fixtures/db_definitions/sqlite2.drop.sql +0 -2
- data/test/fixtures/db_definitions/sqlite2.sql +0 -5
- data/test/fixtures/db_definitions/sybase.drop.sql +0 -35
- data/test/fixtures/db_definitions/sybase.sql +0 -222
- data/test/fixtures/db_definitions/sybase2.drop.sql +0 -4
- data/test/fixtures/db_definitions/sybase2.sql +0 -5
- data/test/fixtures/developers_projects/david_action_controller +0 -3
- data/test/fixtures/developers_projects/david_active_record +0 -3
- data/test/fixtures/developers_projects/jamis_active_record +0 -2
- data/test/fixtures/person.rb +0 -4
- data/test/fixtures/pirate.rb +0 -5
- data/test/fixtures/subscribers/first +0 -2
- data/test/fixtures/subscribers/second +0 -2
- data/test/schema_dumper_test.rb +0 -131
- data/test/schema_test_postgresql.rb +0 -64
@@ -1 +0,0 @@
|
|
1
|
-
1b => 1
|
@@ -1 +0,0 @@
|
|
1
|
-
a b => 1
|
@@ -1 +0,0 @@
|
|
1
|
-
a =>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
DROP TABLE accounts;
|
2
|
-
DROP TABLE funny_jokes;
|
3
|
-
DROP TABLE companies;
|
4
|
-
DROP TABLE topics;
|
5
|
-
DROP TABLE developers;
|
6
|
-
DROP TABLE projects;
|
7
|
-
DROP TABLE developers_projects;
|
8
|
-
DROP TABLE orders;
|
9
|
-
DROP TABLE customers;
|
10
|
-
DROP TABLE movies;
|
11
|
-
DROP TABLE subscribers;
|
12
|
-
DROP TABLE booleantests;
|
13
|
-
DROP TABLE auto_id_tests;
|
14
|
-
DROP TABLE entrants;
|
15
|
-
DROP TABLE colnametests;
|
16
|
-
DROP TABLE mixins;
|
17
|
-
DROP TABLE people;
|
18
|
-
DROP TABLE readers;
|
19
|
-
DROP TABLE binaries;
|
20
|
-
DROP TABLE computers;
|
21
|
-
DROP TABLE posts;
|
22
|
-
DROP TABLE comments;
|
23
|
-
DROP TABLE authors;
|
24
|
-
DROP TABLE tasks;
|
25
|
-
DROP TABLE categories;
|
26
|
-
DROP TABLE categories_posts;
|
27
|
-
DROP TABLE fk_test_has_pk;
|
28
|
-
DROP TABLE fk_test_has_fk;
|
29
|
-
DROP TABLE keyboards;
|
30
|
-
DROP TABLE legacy_things;
|
31
|
-
DROP TABLE numeric_data;
|
32
|
-
DROP TABLE mixed_case_monkeys;
|
33
|
-
DROP TABLE minimalistics;
|
@@ -1,235 +0,0 @@
|
|
1
|
-
CREATE TABLE accounts (
|
2
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
3
|
-
firm_id INT DEFAULT NULL,
|
4
|
-
credit_limit INT DEFAULT NULL,
|
5
|
-
PRIMARY KEY (id)
|
6
|
-
);
|
7
|
-
|
8
|
-
CREATE TABLE funny_jokes (
|
9
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
10
|
-
name VARCHAR(50) DEFAULT NULL,
|
11
|
-
PRIMARY KEY (id)
|
12
|
-
);
|
13
|
-
|
14
|
-
CREATE TABLE companies (
|
15
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
16
|
-
type VARCHAR(50) DEFAULT NULL,
|
17
|
-
ruby_type VARCHAR(50) DEFAULT NULL,
|
18
|
-
firm_id INT DEFAULT NULL,
|
19
|
-
name VARCHAR(50) DEFAULT NULL,
|
20
|
-
client_of INT DEFAULT NULL,
|
21
|
-
rating INT DEFAULT 1,
|
22
|
-
PRIMARY KEY (id)
|
23
|
-
);
|
24
|
-
|
25
|
-
CREATE TABLE topics (
|
26
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
27
|
-
title VARCHAR(255) DEFAULT NULL,
|
28
|
-
author_name VARCHAR(255) DEFAULT NULL,
|
29
|
-
author_email_address VARCHAR(255) DEFAULT NULL,
|
30
|
-
written_on TIMESTAMP DEFAULT NULL,
|
31
|
-
bonus_time TIME DEFAULT NULL,
|
32
|
-
last_read DATE DEFAULT NULL,
|
33
|
-
content VARCHAR(3000),
|
34
|
-
approved SMALLINT DEFAULT 1,
|
35
|
-
replies_count INT DEFAULT 0,
|
36
|
-
parent_id INT DEFAULT NULL,
|
37
|
-
type VARCHAR(50) DEFAULT NULL,
|
38
|
-
PRIMARY KEY (id)
|
39
|
-
);
|
40
|
-
|
41
|
-
CREATE TABLE developers (
|
42
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
43
|
-
name VARCHAR(100) DEFAULT NULL,
|
44
|
-
salary INT DEFAULT 70000,
|
45
|
-
created_at TIMESTAMP DEFAULT NULL,
|
46
|
-
updated_at TIMESTAMP DEFAULT NULL,
|
47
|
-
PRIMARY KEY (id)
|
48
|
-
);
|
49
|
-
|
50
|
-
CREATE TABLE projects (
|
51
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
52
|
-
name VARCHAR(100) DEFAULT NULL,
|
53
|
-
type VARCHAR(255) DEFAULT NULL,
|
54
|
-
PRIMARY KEY (id)
|
55
|
-
);
|
56
|
-
|
57
|
-
CREATE TABLE developers_projects (
|
58
|
-
developer_id INT NOT NULL,
|
59
|
-
project_id INT NOT NULL,
|
60
|
-
joined_on DATE DEFAULT NULL,
|
61
|
-
access_level SMALLINT DEFAULT 1
|
62
|
-
);
|
63
|
-
|
64
|
-
CREATE TABLE orders (
|
65
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
66
|
-
name VARCHAR(100) DEFAULT NULL,
|
67
|
-
billing_customer_id INT DEFAULT NULL,
|
68
|
-
shipping_customer_id INT DEFAULT NULL,
|
69
|
-
PRIMARY KEY (id)
|
70
|
-
);
|
71
|
-
|
72
|
-
CREATE TABLE customers (
|
73
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
74
|
-
name VARCHAR(100) DEFAULT NULL,
|
75
|
-
balance INT DEFAULT 0,
|
76
|
-
address_street VARCHAR(100) DEFAULT NULL,
|
77
|
-
address_city VARCHAR(100) DEFAULT NULL,
|
78
|
-
address_country VARCHAR(100) DEFAULT NULL,
|
79
|
-
gps_location VARCHAR(100) DEFAULT NULL,
|
80
|
-
PRIMARY KEY (id)
|
81
|
-
);
|
82
|
-
|
83
|
-
CREATE TABLE movies (
|
84
|
-
movieid INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
85
|
-
name VARCHAR(100) DEFAULT NULL,
|
86
|
-
PRIMARY KEY (movieid)
|
87
|
-
);
|
88
|
-
|
89
|
-
CREATE TABLE subscribers (
|
90
|
-
nick VARCHAR(100) NOT NULL,
|
91
|
-
name VARCHAR(100) DEFAULT NULL,
|
92
|
-
PRIMARY KEY (nick)
|
93
|
-
);
|
94
|
-
|
95
|
-
CREATE TABLE booleantests (
|
96
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
97
|
-
value INT DEFAULT NULL,
|
98
|
-
PRIMARY KEY (id)
|
99
|
-
);
|
100
|
-
|
101
|
-
CREATE TABLE auto_id_tests (
|
102
|
-
auto_id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
103
|
-
value INT DEFAULT NULL,
|
104
|
-
PRIMARY KEY (auto_id)
|
105
|
-
);
|
106
|
-
|
107
|
-
CREATE TABLE entrants (
|
108
|
-
id INT NOT NULL PRIMARY KEY,
|
109
|
-
name VARCHAR(255) NOT NULL,
|
110
|
-
course_id INT NOT NULL
|
111
|
-
);
|
112
|
-
|
113
|
-
CREATE TABLE colnametests (
|
114
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
115
|
-
references INT NOT NULL,
|
116
|
-
PRIMARY KEY (id)
|
117
|
-
);
|
118
|
-
|
119
|
-
CREATE TABLE mixins (
|
120
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
121
|
-
parent_id INT DEFAULT NULL,
|
122
|
-
pos INT DEFAULT NULL,
|
123
|
-
created_at TIMESTAMP DEFAULT NULL,
|
124
|
-
updated_at TIMESTAMP DEFAULT NULL,
|
125
|
-
lft INT DEFAULT NULL,
|
126
|
-
rgt INT DEFAULT NULL,
|
127
|
-
root_id INT DEFAULT NULL,
|
128
|
-
type VARCHAR(40) DEFAULT NULL,
|
129
|
-
PRIMARY KEY (id)
|
130
|
-
);
|
131
|
-
|
132
|
-
CREATE TABLE people (
|
133
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
134
|
-
first_name VARCHAR(40) NOT NULL,
|
135
|
-
lock_version INT DEFAULT 0,
|
136
|
-
PRIMARY KEY (id)
|
137
|
-
);
|
138
|
-
|
139
|
-
CREATE TABLE readers (
|
140
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
141
|
-
post_id INT NOT NULL,
|
142
|
-
person_id INT NOT NULL,
|
143
|
-
PRIMARY KEY (id)
|
144
|
-
);
|
145
|
-
|
146
|
-
CREATE TABLE binaries (
|
147
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
148
|
-
data BLOB(50000),
|
149
|
-
PRIMARY KEY (id)
|
150
|
-
);
|
151
|
-
|
152
|
-
CREATE TABLE computers (
|
153
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
154
|
-
developer INT NOT NULL,
|
155
|
-
extendedWarranty INT NOT NULL
|
156
|
-
);
|
157
|
-
|
158
|
-
CREATE TABLE posts (
|
159
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
160
|
-
author_id INT DEFAULT NULL,
|
161
|
-
title VARCHAR(255) DEFAULT NULL,
|
162
|
-
type VARCHAR(255) DEFAULT NULL,
|
163
|
-
body VARCHAR(3000) DEFAULT NULL
|
164
|
-
);
|
165
|
-
|
166
|
-
CREATE TABLE comments (
|
167
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
168
|
-
post_id INT DEFAULT NULL,
|
169
|
-
type VARCHAR(255) DEFAULT NULL,
|
170
|
-
body VARCHAR(3000) DEFAULT NULL
|
171
|
-
);
|
172
|
-
|
173
|
-
CREATE TABLE authors (
|
174
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
175
|
-
name VARCHAR(255) DEFAULT NULL
|
176
|
-
);
|
177
|
-
|
178
|
-
CREATE TABLE tasks (
|
179
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
180
|
-
starting TIMESTAMP DEFAULT NULL,
|
181
|
-
ending TIMESTAMP DEFAULT NULL
|
182
|
-
);
|
183
|
-
|
184
|
-
CREATE TABLE categories (
|
185
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
186
|
-
name VARCHAR(255) NOT NULL,
|
187
|
-
type VARCHAR(40) DEFAULT NULL
|
188
|
-
);
|
189
|
-
|
190
|
-
CREATE TABLE categories_posts (
|
191
|
-
category_id INT NOT NULL,
|
192
|
-
post_id INT NOT NULL
|
193
|
-
);
|
194
|
-
|
195
|
-
CREATE TABLE keyboards (
|
196
|
-
key_number INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
197
|
-
name VARCHAR(255)
|
198
|
-
);
|
199
|
-
|
200
|
-
CREATE TABLE fk_test_has_pk (
|
201
|
-
id INT NOT NULL PRIMARY KEY
|
202
|
-
);
|
203
|
-
|
204
|
-
CREATE TABLE fk_test_has_fk (
|
205
|
-
id INT NOT NULL PRIMARY KEY,
|
206
|
-
fk_id INT NOT NULL,
|
207
|
-
|
208
|
-
FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
|
209
|
-
);
|
210
|
-
|
211
|
-
--This table has an altered lock_version column name
|
212
|
-
CREATE TABLE legacy_things (
|
213
|
-
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
|
214
|
-
tps_report_number INT DEFAULT NULL,
|
215
|
-
version INT DEFAULT 0,
|
216
|
-
PRIMARY KEY (id)
|
217
|
-
);
|
218
|
-
|
219
|
-
CREATE TABLE numeric_data (
|
220
|
-
id INT NOT NULL PRIMARY KEY,
|
221
|
-
bank_balance DECIMAL(10,2),
|
222
|
-
big_bank_balance DECIMAL(15,2),
|
223
|
-
world_population DECIMAL(10),
|
224
|
-
my_house_population DECIMAL(2),
|
225
|
-
decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78
|
226
|
-
);
|
227
|
-
|
228
|
-
CREATE TABLE mixed_case_monkeys (
|
229
|
-
monkeyID INT NOT NULL PRIMARY KEY,
|
230
|
-
fleaCount INT
|
231
|
-
);
|
232
|
-
|
233
|
-
CREATE TABLE minimalistics (
|
234
|
-
id INT NOT NULL PRIMARY KEY
|
235
|
-
);
|
@@ -1,65 +0,0 @@
|
|
1
|
-
DROP TABLE accounts;
|
2
|
-
DROP TABLE funny_jokes;
|
3
|
-
DROP TABLE companies;
|
4
|
-
DROP TABLE topics;
|
5
|
-
DROP TABLE developers;
|
6
|
-
DROP TABLE projects;
|
7
|
-
DROP TABLE developers_projects;
|
8
|
-
DROP TABLE orders;
|
9
|
-
DROP TABLE customers;
|
10
|
-
DROP TABLE movies;
|
11
|
-
DROP TABLE subscribers;
|
12
|
-
DROP TABLE booleantests;
|
13
|
-
DROP TABLE auto_id_tests;
|
14
|
-
DROP TABLE entrants;
|
15
|
-
DROP TABLE colnametests;
|
16
|
-
DROP TABLE mixins;
|
17
|
-
DROP TABLE people;
|
18
|
-
DROP TABLE readers;
|
19
|
-
DROP TABLE binaries;
|
20
|
-
DROP TABLE computers;
|
21
|
-
DROP TABLE posts;
|
22
|
-
DROP TABLE comments;
|
23
|
-
DROP TABLE authors;
|
24
|
-
DROP TABLE tasks;
|
25
|
-
DROP TABLE categories;
|
26
|
-
DROP TABLE categories_posts;
|
27
|
-
DROP TABLE fk_test_has_fk;
|
28
|
-
DROP TABLE fk_test_has_pk;
|
29
|
-
DROP TABLE keyboards;
|
30
|
-
DROP TABLE defaults;
|
31
|
-
DROP TABLE legacy_things;
|
32
|
-
DROP TABLE numeric_data;
|
33
|
-
DROP TABLE mixed_case_monkeys;
|
34
|
-
DROP TABLE minimalistics;
|
35
|
-
|
36
|
-
DROP DOMAIN D_BOOLEAN;
|
37
|
-
|
38
|
-
DROP GENERATOR accounts_seq;
|
39
|
-
DROP GENERATOR funny_jokes_seq;
|
40
|
-
DROP GENERATOR companies_nonstd_seq;
|
41
|
-
DROP GENERATOR topics_seq;
|
42
|
-
DROP GENERATOR developers_seq;
|
43
|
-
DROP GENERATOR projects_seq;
|
44
|
-
DROP GENERATOR orders_seq;
|
45
|
-
DROP GENERATOR customers_seq;
|
46
|
-
DROP GENERATOR movies_seq;
|
47
|
-
DROP GENERATOR booleantests_seq;
|
48
|
-
DROP GENERATOR auto_id_tests_seq;
|
49
|
-
DROP GENERATOR entrants_seq;
|
50
|
-
DROP GENERATOR colnametests_seq;
|
51
|
-
DROP GENERATOR mixins_seq;
|
52
|
-
DROP GENERATOR people_seq;
|
53
|
-
DROP GENERATOR binaries_seq;
|
54
|
-
DROP GENERATOR computers_seq;
|
55
|
-
DROP GENERATOR posts_seq;
|
56
|
-
DROP GENERATOR comments_seq;
|
57
|
-
DROP GENERATOR authors_seq;
|
58
|
-
DROP GENERATOR tasks_seq;
|
59
|
-
DROP GENERATOR categories_seq;
|
60
|
-
DROP GENERATOR keyboards_seq;
|
61
|
-
DROP GENERATOR defaults_seq;
|
62
|
-
DROP GENERATOR legacy_things_seq;
|
63
|
-
DROP GENERATOR numeric_data_seq;
|
64
|
-
DROP GENERATOR mixed_case_monkeys_seq;
|
65
|
-
DROP GENERATOR minimalistics_seq;
|
@@ -1,310 +0,0 @@
|
|
1
|
-
CREATE DOMAIN D_BOOLEAN AS SMALLINT CHECK (VALUE IN (0, 1) OR VALUE IS NULL);
|
2
|
-
|
3
|
-
CREATE TABLE accounts (
|
4
|
-
id BIGINT NOT NULL,
|
5
|
-
firm_id BIGINT,
|
6
|
-
credit_limit INTEGER,
|
7
|
-
PRIMARY KEY (id)
|
8
|
-
);
|
9
|
-
CREATE GENERATOR accounts_seq;
|
10
|
-
SET GENERATOR accounts_seq TO 10000;
|
11
|
-
|
12
|
-
CREATE TABLE funny_jokes (
|
13
|
-
id BIGINT NOT NULL,
|
14
|
-
name VARCHAR(50),
|
15
|
-
PRIMARY KEY (id)
|
16
|
-
);
|
17
|
-
CREATE GENERATOR funny_jokes_seq;
|
18
|
-
SET GENERATOR funny_jokes_seq TO 10000;
|
19
|
-
|
20
|
-
CREATE TABLE companies (
|
21
|
-
id BIGINT NOT NULL,
|
22
|
-
"TYPE" VARCHAR(50),
|
23
|
-
ruby_type VARCHAR(50),
|
24
|
-
firm_id BIGINT,
|
25
|
-
name VARCHAR(50),
|
26
|
-
client_of INTEGER,
|
27
|
-
rating INTEGER DEFAULT 1,
|
28
|
-
PRIMARY KEY (id)
|
29
|
-
);
|
30
|
-
CREATE GENERATOR companies_nonstd_seq;
|
31
|
-
SET GENERATOR companies_nonstd_seq TO 10000;
|
32
|
-
|
33
|
-
CREATE TABLE topics (
|
34
|
-
id BIGINT NOT NULL,
|
35
|
-
title VARCHAR(255),
|
36
|
-
author_name VARCHAR(255),
|
37
|
-
author_email_address VARCHAR(255),
|
38
|
-
written_on TIMESTAMP,
|
39
|
-
bonus_time TIME,
|
40
|
-
last_read DATE,
|
41
|
-
content VARCHAR(4000),
|
42
|
-
approved D_BOOLEAN DEFAULT 1,
|
43
|
-
replies_count INTEGER DEFAULT 0,
|
44
|
-
parent_id BIGINT,
|
45
|
-
"TYPE" VARCHAR(50),
|
46
|
-
PRIMARY KEY (id)
|
47
|
-
);
|
48
|
-
CREATE GENERATOR topics_seq;
|
49
|
-
SET GENERATOR topics_seq TO 10000;
|
50
|
-
|
51
|
-
CREATE TABLE developers (
|
52
|
-
id BIGINT NOT NULL,
|
53
|
-
name VARCHAR(100),
|
54
|
-
salary INTEGER DEFAULT 70000,
|
55
|
-
created_at TIMESTAMP,
|
56
|
-
updated_at TIMESTAMP,
|
57
|
-
PRIMARY KEY (id)
|
58
|
-
);
|
59
|
-
CREATE GENERATOR developers_seq;
|
60
|
-
SET GENERATOR developers_seq TO 10000;
|
61
|
-
|
62
|
-
CREATE TABLE projects (
|
63
|
-
id BIGINT NOT NULL,
|
64
|
-
name VARCHAR(100),
|
65
|
-
"TYPE" VARCHAR(255),
|
66
|
-
PRIMARY KEY (id)
|
67
|
-
);
|
68
|
-
CREATE GENERATOR projects_seq;
|
69
|
-
SET GENERATOR projects_seq TO 10000;
|
70
|
-
|
71
|
-
CREATE TABLE developers_projects (
|
72
|
-
developer_id BIGINT NOT NULL,
|
73
|
-
project_id BIGINT NOT NULL,
|
74
|
-
joined_on DATE,
|
75
|
-
access_level SMALLINT DEFAULT 1
|
76
|
-
);
|
77
|
-
|
78
|
-
CREATE TABLE orders (
|
79
|
-
id BIGINT NOT NULL,
|
80
|
-
name VARCHAR(100),
|
81
|
-
billing_customer_id BIGINT,
|
82
|
-
shipping_customer_id BIGINT,
|
83
|
-
PRIMARY KEY (id)
|
84
|
-
);
|
85
|
-
CREATE GENERATOR orders_seq;
|
86
|
-
SET GENERATOR orders_seq TO 10000;
|
87
|
-
|
88
|
-
CREATE TABLE customers (
|
89
|
-
id BIGINT NOT NULL,
|
90
|
-
name VARCHAR(100),
|
91
|
-
balance INTEGER DEFAULT 0,
|
92
|
-
address_street VARCHAR(100),
|
93
|
-
address_city VARCHAR(100),
|
94
|
-
address_country VARCHAR(100),
|
95
|
-
gps_location VARCHAR(100),
|
96
|
-
PRIMARY KEY (id)
|
97
|
-
);
|
98
|
-
CREATE GENERATOR customers_seq;
|
99
|
-
SET GENERATOR customers_seq TO 10000;
|
100
|
-
|
101
|
-
CREATE TABLE movies (
|
102
|
-
movieid BIGINT NOT NULL,
|
103
|
-
name varchar(100),
|
104
|
-
PRIMARY KEY (movieid)
|
105
|
-
);
|
106
|
-
CREATE GENERATOR movies_seq;
|
107
|
-
SET GENERATOR movies_seq TO 10000;
|
108
|
-
|
109
|
-
CREATE TABLE subscribers (
|
110
|
-
nick VARCHAR(100) NOT NULL,
|
111
|
-
name VARCHAR(100),
|
112
|
-
PRIMARY KEY (nick)
|
113
|
-
);
|
114
|
-
|
115
|
-
CREATE TABLE booleantests (
|
116
|
-
id BIGINT NOT NULL,
|
117
|
-
"VALUE" D_BOOLEAN,
|
118
|
-
PRIMARY KEY (id)
|
119
|
-
);
|
120
|
-
CREATE GENERATOR booleantests_seq;
|
121
|
-
SET GENERATOR booleantests_seq TO 10000;
|
122
|
-
|
123
|
-
CREATE TABLE auto_id_tests (
|
124
|
-
auto_id BIGINT NOT NULL,
|
125
|
-
"VALUE" INTEGER,
|
126
|
-
PRIMARY KEY (auto_id)
|
127
|
-
);
|
128
|
-
CREATE GENERATOR auto_id_tests_seq;
|
129
|
-
SET GENERATOR auto_id_tests_seq TO 10000;
|
130
|
-
|
131
|
-
CREATE TABLE entrants (
|
132
|
-
id BIGINT NOT NULL,
|
133
|
-
name VARCHAR(255) NOT NULL,
|
134
|
-
course_id INTEGER NOT NULL,
|
135
|
-
PRIMARY KEY (id)
|
136
|
-
);
|
137
|
-
CREATE GENERATOR entrants_seq;
|
138
|
-
SET GENERATOR entrants_seq TO 10000;
|
139
|
-
|
140
|
-
CREATE TABLE colnametests (
|
141
|
-
id BIGINT NOT NULL,
|
142
|
-
"REFERENCES" INTEGER NOT NULL,
|
143
|
-
PRIMARY KEY (id)
|
144
|
-
);
|
145
|
-
CREATE GENERATOR colnametests_seq;
|
146
|
-
SET GENERATOR colnametests_seq TO 10000;
|
147
|
-
|
148
|
-
CREATE TABLE mixins (
|
149
|
-
id BIGINT NOT NULL,
|
150
|
-
parent_id BIGINT,
|
151
|
-
pos INTEGER,
|
152
|
-
created_at TIMESTAMP,
|
153
|
-
updated_at TIMESTAMP,
|
154
|
-
lft INTEGER,
|
155
|
-
rgt INTEGER,
|
156
|
-
root_id BIGINT,
|
157
|
-
"TYPE" VARCHAR(40),
|
158
|
-
PRIMARY KEY (id)
|
159
|
-
);
|
160
|
-
CREATE GENERATOR mixins_seq;
|
161
|
-
SET GENERATOR mixins_seq TO 10000;
|
162
|
-
|
163
|
-
CREATE TABLE people (
|
164
|
-
id BIGINT NOT NULL,
|
165
|
-
first_name VARCHAR(40),
|
166
|
-
lock_version INTEGER DEFAULT 0 NOT NULL,
|
167
|
-
PRIMARY KEY (id)
|
168
|
-
);
|
169
|
-
CREATE GENERATOR people_seq;
|
170
|
-
SET GENERATOR people_seq TO 10000;
|
171
|
-
|
172
|
-
CREATE TABLE readers (
|
173
|
-
id BIGINT NOT NULL,
|
174
|
-
post_id BIGINT NOT NULL,
|
175
|
-
person_id BIGINT NOT NULL,
|
176
|
-
PRIMARY KEY (id)
|
177
|
-
);
|
178
|
-
CREATE GENERATOR readers_seq;
|
179
|
-
SET GENERATOR readers_seq TO 10000;
|
180
|
-
|
181
|
-
CREATE TABLE binaries (
|
182
|
-
id BIGINT NOT NULL,
|
183
|
-
data BLOB,
|
184
|
-
PRIMARY KEY (id)
|
185
|
-
);
|
186
|
-
CREATE GENERATOR binaries_seq;
|
187
|
-
SET GENERATOR binaries_seq TO 10000;
|
188
|
-
|
189
|
-
CREATE TABLE computers (
|
190
|
-
id BIGINT NOT NULL,
|
191
|
-
developer INTEGER NOT NULL,
|
192
|
-
"extendedWarranty" INTEGER NOT NULL,
|
193
|
-
PRIMARY KEY (id)
|
194
|
-
);
|
195
|
-
CREATE GENERATOR computers_seq;
|
196
|
-
SET GENERATOR computers_seq TO 10000;
|
197
|
-
|
198
|
-
CREATE TABLE posts (
|
199
|
-
id BIGINT NOT NULL,
|
200
|
-
author_id BIGINT,
|
201
|
-
title VARCHAR(255) NOT NULL,
|
202
|
-
"TYPE" VARCHAR(255) NOT NULL,
|
203
|
-
body VARCHAR(3000) NOT NULL,
|
204
|
-
PRIMARY KEY (id)
|
205
|
-
);
|
206
|
-
CREATE GENERATOR posts_seq;
|
207
|
-
SET GENERATOR posts_seq TO 10000;
|
208
|
-
|
209
|
-
CREATE TABLE comments (
|
210
|
-
id BIGINT NOT NULL,
|
211
|
-
post_id BIGINT NOT NULL,
|
212
|
-
"TYPE" VARCHAR(255) NOT NULL,
|
213
|
-
body VARCHAR(3000) NOT NULL,
|
214
|
-
PRIMARY KEY (id)
|
215
|
-
);
|
216
|
-
CREATE GENERATOR comments_seq;
|
217
|
-
SET GENERATOR comments_seq TO 10000;
|
218
|
-
|
219
|
-
CREATE TABLE authors (
|
220
|
-
id BIGINT NOT NULL,
|
221
|
-
name VARCHAR(255) NOT NULL,
|
222
|
-
PRIMARY KEY (id)
|
223
|
-
);
|
224
|
-
CREATE GENERATOR authors_seq;
|
225
|
-
SET GENERATOR authors_seq TO 10000;
|
226
|
-
|
227
|
-
CREATE TABLE tasks (
|
228
|
-
id BIGINT NOT NULL,
|
229
|
-
"STARTING" TIMESTAMP,
|
230
|
-
ending TIMESTAMP,
|
231
|
-
PRIMARY KEY (id)
|
232
|
-
);
|
233
|
-
CREATE GENERATOR tasks_seq;
|
234
|
-
SET GENERATOR tasks_seq TO 10000;
|
235
|
-
|
236
|
-
CREATE TABLE categories (
|
237
|
-
id BIGINT NOT NULL,
|
238
|
-
name VARCHAR(255) NOT NULL,
|
239
|
-
"TYPE" VARCHAR(255) NOT NULL,
|
240
|
-
PRIMARY KEY (id)
|
241
|
-
);
|
242
|
-
CREATE GENERATOR categories_seq;
|
243
|
-
SET GENERATOR categories_seq TO 10000;
|
244
|
-
|
245
|
-
CREATE TABLE categories_posts (
|
246
|
-
category_id BIGINT NOT NULL,
|
247
|
-
post_id BIGINT NOT NULL,
|
248
|
-
PRIMARY KEY (category_id, post_id)
|
249
|
-
);
|
250
|
-
|
251
|
-
CREATE TABLE fk_test_has_pk (
|
252
|
-
id BIGINT NOT NULL,
|
253
|
-
PRIMARY KEY (id)
|
254
|
-
);
|
255
|
-
|
256
|
-
CREATE TABLE fk_test_has_fk (
|
257
|
-
id BIGINT NOT NULL,
|
258
|
-
fk_id BIGINT NOT NULL,
|
259
|
-
PRIMARY KEY (id),
|
260
|
-
FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
|
261
|
-
);
|
262
|
-
|
263
|
-
CREATE TABLE keyboards (
|
264
|
-
key_number BIGINT NOT NULL,
|
265
|
-
name VARCHAR(50),
|
266
|
-
PRIMARY KEY (key_number)
|
267
|
-
);
|
268
|
-
CREATE GENERATOR keyboards_seq;
|
269
|
-
SET GENERATOR keyboards_seq TO 10000;
|
270
|
-
|
271
|
-
CREATE TABLE defaults (
|
272
|
-
id BIGINT NOT NULL,
|
273
|
-
default_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
274
|
-
);
|
275
|
-
CREATE GENERATOR defaults_seq;
|
276
|
-
SET GENERATOR defaults_seq TO 10000;
|
277
|
-
|
278
|
-
CREATE TABLE legacy_things (
|
279
|
-
id BIGINT NOT NULL,
|
280
|
-
tps_report_number INTEGER,
|
281
|
-
version INTEGER DEFAULT 0 NOT NULL,
|
282
|
-
PRIMARY KEY (id)
|
283
|
-
);
|
284
|
-
CREATE GENERATOR legacy_things_seq;
|
285
|
-
SET GENERATOR legacy_things_seq TO 10000;
|
286
|
-
|
287
|
-
CREATE TABLE numeric_data (
|
288
|
-
id BIGINT NOT NULL,
|
289
|
-
bank_balance DECIMAL(10,2),
|
290
|
-
big_bank_balance DECIMAL(15,2),
|
291
|
-
world_population DECIMAL(10),
|
292
|
-
my_house_population DECIMAL(2),
|
293
|
-
decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78,
|
294
|
-
PRIMARY KEY (id)
|
295
|
-
);
|
296
|
-
CREATE GENERATOR numeric_data_seq;
|
297
|
-
SET GENERATOR numeric_data_seq TO 10000;
|
298
|
-
|
299
|
-
CREATE TABLE mixed_case_monkeys (
|
300
|
-
"monkeyID" BIGINT NOT NULL,
|
301
|
-
"fleaCount" INTEGER
|
302
|
-
);
|
303
|
-
CREATE GENERATOR mixed_case_monkeys_seq;
|
304
|
-
SET GENERATOR mixed_case_monkeys_seq TO 10000;
|
305
|
-
|
306
|
-
CREATE TABLE minimalistics (
|
307
|
-
id BIGINT NOT NULL
|
308
|
-
);
|
309
|
-
CREATE GENERATOR minimalistics_seq;
|
310
|
-
SET GENERATOR minimalistics_seq TO 10000;
|