composite_primary_keys 8.1.1 → 8.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.rdoc +4 -1
- data/lib/composite_primary_keys.rb +5 -1
- data/lib/composite_primary_keys/arel/visitors/to_sql.rb +24 -0
- data/lib/composite_primary_keys/associations/association_scope.rb +32 -58
- data/lib/composite_primary_keys/associations/join_dependency/join_association.rb +22 -22
- data/lib/composite_primary_keys/associations/preloader/association.rb +12 -6
- data/lib/composite_primary_keys/associations/preloader/belongs_to.rb +19 -19
- data/lib/composite_primary_keys/attribute_methods/primary_key.rb +1 -2
- data/lib/composite_primary_keys/attribute_methods/read.rb +2 -2
- data/lib/composite_primary_keys/attribute_methods/write.rb +1 -1
- data/lib/composite_primary_keys/composite_predicates.rb +55 -50
- data/lib/composite_primary_keys/composite_relation.rb +48 -48
- data/lib/composite_primary_keys/connection_adapters/abstract/connection_specification_changes.rb +2 -2
- data/lib/composite_primary_keys/connection_adapters/postgresql_adapter.rb +19 -46
- data/lib/composite_primary_keys/connection_adapters/sqlserver_adapter.rb +8 -4
- data/lib/composite_primary_keys/fixtures.rb +26 -22
- data/lib/composite_primary_keys/locking/optimistic.rb +54 -55
- data/lib/composite_primary_keys/relation.rb +15 -8
- data/lib/composite_primary_keys/relation/batches.rb +23 -19
- data/lib/composite_primary_keys/relation/calculations.rb +4 -2
- data/lib/composite_primary_keys/relation/finder_methods.rb +33 -27
- data/lib/composite_primary_keys/relation/predicate_builder.rb +18 -3
- data/lib/composite_primary_keys/relation/query_methods.rb +41 -41
- data/lib/composite_primary_keys/sanitization.rb +7 -5
- data/lib/composite_primary_keys/validations/uniqueness.rb +20 -16
- data/lib/composite_primary_keys/version.rb +1 -1
- data/tasks/databases/oracle.rake +27 -25
- data/tasks/databases/oracle_enhanced.rake +27 -0
- data/test/connections/databases.ci.yml +15 -15
- data/test/connections/native_oracle/connection.rb +11 -11
- data/test/connections/native_oracle_enhanced/connection.rb +16 -16
- data/test/fixtures/comment.rb +7 -7
- data/test/fixtures/db_definitions/db2-create-tables.sql +126 -126
- data/test/fixtures/db_definitions/db2-drop-tables.sql +18 -18
- data/test/fixtures/db_definitions/oracle.drop.sql +48 -45
- data/test/fixtures/db_definitions/oracle.sql +236 -223
- data/test/fixtures/dorm.rb +2 -2
- data/test/fixtures/membership.rb +6 -6
- data/test/fixtures/membership_statuses.yml +16 -16
- data/test/fixtures/memberships.yml +10 -10
- data/test/fixtures/product_tariffs.yml +14 -14
- data/test/fixtures/reference_code.rb +7 -7
- data/test/fixtures/restaurants_suburb.rb +2 -2
- data/test/fixtures/suburb.rb +5 -5
- data/test/fixtures/topic.rb +5 -5
- data/test/fixtures/topic_source.rb +6 -6
- data/test/fixtures/topic_sources.yml +3 -3
- data/test/fixtures/topics.yml +8 -8
- data/test/fixtures/users.yml +10 -10
- data/test/test_attribute_methods.rb +63 -63
- data/test/test_calculations.rb +42 -37
- data/test/test_callbacks.rb +99 -99
- data/test/test_delete.rb +28 -21
- data/test/test_delete_all.rb +5 -4
- data/test/test_dumpable.rb +15 -15
- data/test/test_nested_attributes.rb +124 -124
- data/test/test_optimistic.rb +18 -18
- data/test/test_polymorphic.rb +1 -1
- data/test/test_predicates.rb +40 -40
- data/test/test_santiago.rb +23 -23
- data/test/test_suite.rb +34 -34
- data/test/test_touch.rb +23 -23
- data/test/test_update.rb +71 -71
- metadata +9 -8
- data/lib/composite_primary_keys/model_schema.rb +0 -15
| @@ -1,223 +1,236 @@ | |
| 1 | 
            -
            create sequence topics_seq start with 1000;
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            create table topics (
         | 
| 4 | 
            -
                id          number(11)  primary key,
         | 
| 5 | 
            -
                name        varchar(50) default null,  
         | 
| 6 | 
            -
                feed_size   number(11)  default null | 
| 7 | 
            -
            );
         | 
| 8 | 
            -
             | 
| 9 | 
            -
            create table topic_sources (
         | 
| 10 | 
            -
                topic_id number(11),
         | 
| 11 | 
            -
                platform varchar(50),
         | 
| 12 | 
            -
                keywords varchar(50) default null | 
| 13 | 
            -
            );
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            create sequence reference_types_seq start with 1000;
         | 
| 16 | 
            -
             | 
| 17 | 
            -
            create table reference_types (
         | 
| 18 | 
            -
                reference_type_id number(11)   primary key,
         | 
| 19 | 
            -
                type_label        varchar2(50) default null,
         | 
| 20 | 
            -
                abbreviation      varchar2(50) default null,
         | 
| 21 | 
            -
                description       varchar2(50) default null
         | 
| 22 | 
            -
            );
         | 
| 23 | 
            -
             | 
| 24 | 
            -
            create table reference_codes (
         | 
| 25 | 
            -
                reference_type_id number(11),
         | 
| 26 | 
            -
                reference_code    number(11),
         | 
| 27 | 
            -
                code_label        varchar2(50) default null,
         | 
| 28 | 
            -
                abbreviation      varchar2(50) default null,
         | 
| 29 | 
            -
                description       varchar2(50) default null
         | 
| 30 | 
            -
            );
         | 
| 31 | 
            -
             | 
| 32 | 
            -
            create sequence products_seq start with 1000;
         | 
| 33 | 
            -
             | 
| 34 | 
            -
            create table products (
         | 
| 35 | 
            -
                id   number(11)   primary key,
         | 
| 36 | 
            -
                name varchar2(50) default null
         | 
| 37 | 
            -
            );
         | 
| 38 | 
            -
             | 
| 39 | 
            -
            create table tariffs (
         | 
| 40 | 
            -
                tariff_id  number(11),
         | 
| 41 | 
            -
                start_date date,
         | 
| 42 | 
            -
                amount     number(11) default null,
         | 
| 43 | 
            -
                 | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
                 | 
| 50 | 
            -
                 | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
                 | 
| 57 | 
            -
                 | 
| 58 | 
            -
            ) | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
            create  | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
                 | 
| 66 | 
            -
                 | 
| 67 | 
            -
            ) | 
| 68 | 
            -
             | 
| 69 | 
            -
             | 
| 70 | 
            -
             | 
| 71 | 
            -
            create  | 
| 72 | 
            -
             | 
| 73 | 
            -
             | 
| 74 | 
            -
            ) | 
| 75 | 
            -
             | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
            create  | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
            ) | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
            create  | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
                 | 
| 89 | 
            -
                 | 
| 90 | 
            -
            ) | 
| 91 | 
            -
             | 
| 92 | 
            -
             | 
| 93 | 
            -
             | 
| 94 | 
            -
            create  | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
            ) | 
| 98 | 
            -
             | 
| 99 | 
            -
             | 
| 100 | 
            -
             | 
| 101 | 
            -
             | 
| 102 | 
            -
                 | 
| 103 | 
            -
            ) | 
| 104 | 
            -
             | 
| 105 | 
            -
             | 
| 106 | 
            -
             | 
| 107 | 
            -
            create  | 
| 108 | 
            -
             | 
| 109 | 
            -
             | 
| 110 | 
            -
                 | 
| 111 | 
            -
                 | 
| 112 | 
            -
            ) | 
| 113 | 
            -
             | 
| 114 | 
            -
             | 
| 115 | 
            -
             | 
| 116 | 
            -
             | 
| 117 | 
            -
                 | 
| 118 | 
            -
            ) | 
| 119 | 
            -
             | 
| 120 | 
            -
             | 
| 121 | 
            -
             | 
| 122 | 
            -
            create  | 
| 123 | 
            -
             | 
| 124 | 
            -
             | 
| 125 | 
            -
                 | 
| 126 | 
            -
            ) | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
            create  | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 133 | 
            -
                 | 
| 134 | 
            -
                 | 
| 135 | 
            -
                 | 
| 136 | 
            -
             | 
| 137 | 
            -
             | 
| 138 | 
            -
             | 
| 139 | 
            -
             | 
| 140 | 
            -
             | 
| 141 | 
            -
             | 
| 142 | 
            -
             | 
| 143 | 
            -
             | 
| 144 | 
            -
             | 
| 145 | 
            -
             | 
| 146 | 
            -
                 | 
| 147 | 
            -
                 | 
| 148 | 
            -
                 | 
| 149 | 
            -
             | 
| 150 | 
            -
             | 
| 151 | 
            -
             | 
| 152 | 
            -
             | 
| 153 | 
            -
            create table  | 
| 154 | 
            -
                 | 
| 155 | 
            -
                 | 
| 156 | 
            -
             | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 159 | 
            -
             | 
| 160 | 
            -
             | 
| 161 | 
            -
             | 
| 162 | 
            -
             | 
| 163 | 
            -
                 | 
| 164 | 
            -
             | 
| 165 | 
            -
             | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 168 | 
            -
                 | 
| 169 | 
            -
                 | 
| 170 | 
            -
                 | 
| 171 | 
            -
            );
         | 
| 172 | 
            -
             | 
| 173 | 
            -
            create sequence  | 
| 174 | 
            -
             | 
| 175 | 
            -
            create table  | 
| 176 | 
            -
                id | 
| 177 | 
            -
                 | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 180 | 
            -
             | 
| 181 | 
            -
             | 
| 182 | 
            -
                 | 
| 183 | 
            -
                 | 
| 184 | 
            -
             | 
| 185 | 
            -
             | 
| 186 | 
            -
             | 
| 187 | 
            -
             | 
| 188 | 
            -
             | 
| 189 | 
            -
             | 
| 190 | 
            -
                 | 
| 191 | 
            -
                constraint  | 
| 192 | 
            -
            );
         | 
| 193 | 
            -
             | 
| 194 | 
            -
            create table  | 
| 195 | 
            -
                 | 
| 196 | 
            -
                 | 
| 197 | 
            -
                 | 
| 198 | 
            -
            );
         | 
| 199 | 
            -
             | 
| 200 | 
            -
            create  | 
| 201 | 
            -
             | 
| 202 | 
            -
             | 
| 203 | 
            -
                 | 
| 204 | 
            -
                primary key ( | 
| 205 | 
            -
            );
         | 
| 206 | 
            -
             | 
| 207 | 
            -
            create table  | 
| 208 | 
            -
                 | 
| 209 | 
            -
                 | 
| 210 | 
            -
                 | 
| 211 | 
            -
            );
         | 
| 212 | 
            -
             | 
| 213 | 
            -
            create table  | 
| 214 | 
            -
                 | 
| 215 | 
            -
                 | 
| 216 | 
            -
                 | 
| 217 | 
            -
            ) | 
| 218 | 
            -
             | 
| 219 | 
            -
             | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
            ) | 
| 223 | 
            -
             | 
| 1 | 
            +
            create sequence topics_seq start with 1000;
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            create table topics (
         | 
| 4 | 
            +
                id          number(11)  primary key,
         | 
| 5 | 
            +
                name        varchar(50) default null,  
         | 
| 6 | 
            +
                feed_size   number(11)  default null
         | 
| 7 | 
            +
            );
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            create table topic_sources (
         | 
| 10 | 
            +
                topic_id number(11),
         | 
| 11 | 
            +
                platform varchar(50),
         | 
| 12 | 
            +
                keywords varchar(50) default null
         | 
| 13 | 
            +
            );
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            create sequence reference_types_seq start with 1000;
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            create table reference_types (
         | 
| 18 | 
            +
                reference_type_id number(11)   primary key,
         | 
| 19 | 
            +
                type_label        varchar2(50) default null,
         | 
| 20 | 
            +
                abbreviation      varchar2(50) default null,
         | 
| 21 | 
            +
                description       varchar2(50) default null
         | 
| 22 | 
            +
            );
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            create table reference_codes (
         | 
| 25 | 
            +
                reference_type_id number(11),
         | 
| 26 | 
            +
                reference_code    number(11),
         | 
| 27 | 
            +
                code_label        varchar2(50) default null,
         | 
| 28 | 
            +
                abbreviation      varchar2(50) default null,
         | 
| 29 | 
            +
                description       varchar2(50) default null
         | 
| 30 | 
            +
            );
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            create sequence products_seq start with 1000;
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            create table products (
         | 
| 35 | 
            +
                id   number(11)   primary key,
         | 
| 36 | 
            +
                name varchar2(50) default null
         | 
| 37 | 
            +
            );
         | 
| 38 | 
            +
             | 
| 39 | 
            +
            create table tariffs (
         | 
| 40 | 
            +
                tariff_id  number(11),
         | 
| 41 | 
            +
                start_date date,
         | 
| 42 | 
            +
                amount     number(11) default null,
         | 
| 43 | 
            +
                created_at timestamp,
         | 
| 44 | 
            +
                updated_at timestamp,
         | 
| 45 | 
            +
                constraint tariffs_pk primary key (tariff_id, start_date)
         | 
| 46 | 
            +
            );
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            create table product_tariffs (
         | 
| 49 | 
            +
                product_id        number(11),
         | 
| 50 | 
            +
                tariff_id         number(11),
         | 
| 51 | 
            +
                tariff_start_date date,
         | 
| 52 | 
            +
                constraint product_tariffs_pk primary key (product_id, tariff_id, tariff_start_date)
         | 
| 53 | 
            +
            );
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            create table suburbs (
         | 
| 56 | 
            +
                city_id   number(11),
         | 
| 57 | 
            +
                suburb_id number(11),
         | 
| 58 | 
            +
                name      varchar2(50) not null,
         | 
| 59 | 
            +
                constraint suburbs_pk primary key (city_id, suburb_id)
         | 
| 60 | 
            +
            );
         | 
| 61 | 
            +
             | 
| 62 | 
            +
            create sequence streets_seq start with 1000;
         | 
| 63 | 
            +
             | 
| 64 | 
            +
            create table streets (
         | 
| 65 | 
            +
                id        number(11)   primary key,
         | 
| 66 | 
            +
                city_id   number(11)   not null,
         | 
| 67 | 
            +
                suburb_id number(11)   not null,
         | 
| 68 | 
            +
                name      varchar2(50) not null
         | 
| 69 | 
            +
            );
         | 
| 70 | 
            +
             | 
| 71 | 
            +
            create sequence users_seq start with 1000;
         | 
| 72 | 
            +
             | 
| 73 | 
            +
            create table users (
         | 
| 74 | 
            +
                id   number(11)   primary key,
         | 
| 75 | 
            +
                name varchar2(50) not null
         | 
| 76 | 
            +
            );
         | 
| 77 | 
            +
             | 
| 78 | 
            +
            create sequence articles_seq start with 1000;
         | 
| 79 | 
            +
             | 
| 80 | 
            +
            create table articles (
         | 
| 81 | 
            +
                id   number(11)   primary key,
         | 
| 82 | 
            +
                name varchar2(50) not null
         | 
| 83 | 
            +
            );
         | 
| 84 | 
            +
             | 
| 85 | 
            +
            create sequence readings_seq start with 1000;
         | 
| 86 | 
            +
             | 
| 87 | 
            +
            create table readings (
         | 
| 88 | 
            +
                id         number(11) primary key,
         | 
| 89 | 
            +
                user_id    number(11) not null,
         | 
| 90 | 
            +
                article_id number(11) not null,
         | 
| 91 | 
            +
                rating     number(11) not null
         | 
| 92 | 
            +
            );
         | 
| 93 | 
            +
             | 
| 94 | 
            +
            create sequence groups_seq start with 1000;
         | 
| 95 | 
            +
             | 
| 96 | 
            +
            create table groups (
         | 
| 97 | 
            +
                id   number(11)   primary key,
         | 
| 98 | 
            +
                name varchar2(50) not null
         | 
| 99 | 
            +
            );
         | 
| 100 | 
            +
             | 
| 101 | 
            +
            create table memberships (
         | 
| 102 | 
            +
                user_id  number(11) not null,
         | 
| 103 | 
            +
                group_id number(11) not null,
         | 
| 104 | 
            +
                constraint memberships_pk primary key (user_id, group_id)
         | 
| 105 | 
            +
            );
         | 
| 106 | 
            +
             | 
| 107 | 
            +
            create sequence membership_statuses_seq start with 1000;
         | 
| 108 | 
            +
             | 
| 109 | 
            +
            create table membership_statuses (
         | 
| 110 | 
            +
                id       number(11)   primary key,
         | 
| 111 | 
            +
                user_id  number(11)   not null,
         | 
| 112 | 
            +
                group_id number(11)   not null,
         | 
| 113 | 
            +
                status   varchar2(50) not null
         | 
| 114 | 
            +
            );
         | 
| 115 | 
            +
             | 
| 116 | 
            +
            create table departments (
         | 
| 117 | 
            +
                department_id number(11) not null,
         | 
| 118 | 
            +
                location_id   number(11) not null,
         | 
| 119 | 
            +
                constraint departments_pk primary key (department_id, location_id)
         | 
| 120 | 
            +
            );
         | 
| 121 | 
            +
             | 
| 122 | 
            +
            create sequence employees_seq start with 1000;
         | 
| 123 | 
            +
             | 
| 124 | 
            +
            create table employees (
         | 
| 125 | 
            +
                id            number(11) not null primary key,
         | 
| 126 | 
            +
                department_id number(11) default null,
         | 
| 127 | 
            +
                location_id   number(11) default null
         | 
| 128 | 
            +
            );
         | 
| 129 | 
            +
             | 
| 130 | 
            +
            create sequence salaries_seq start with 1000;
         | 
| 131 | 
            +
             | 
| 132 | 
            +
            create table salaries (
         | 
| 133 | 
            +
                id          number(11) not null primary key,
         | 
| 134 | 
            +
                employee_id number(11) default null,
         | 
| 135 | 
            +
                location_id number(11) default null,
         | 
| 136 | 
            +
                year        int not null,
         | 
| 137 | 
            +
                month       int not null,
         | 
| 138 | 
            +
                value       int default null
         | 
| 139 | 
            +
            );
         | 
| 140 | 
            +
             | 
| 141 | 
            +
            create sequence comments_seq start with 1000;
         | 
| 142 | 
            +
             | 
| 143 | 
            +
            create table comments (
         | 
| 144 | 
            +
                id          number(11)   not null primary key,
         | 
| 145 | 
            +
                person_id   number(11)   default null,
         | 
| 146 | 
            +
                shown       number(11)   default null,
         | 
| 147 | 
            +
                person_type varchar(100) default null,
         | 
| 148 | 
            +
                hack_id     number(11)   default null
         | 
| 149 | 
            +
            );
         | 
| 150 | 
            +
             | 
| 151 | 
            +
            create sequence hacks_seq start with 1000;
         | 
| 152 | 
            +
             | 
| 153 | 
            +
            create table hacks (
         | 
| 154 | 
            +
                id   number(11)  not null primary key,
         | 
| 155 | 
            +
                name varchar(50) not null
         | 
| 156 | 
            +
            );
         | 
| 157 | 
            +
             | 
| 158 | 
            +
            create table restaurants (
         | 
| 159 | 
            +
                franchise_id number(11) not null,
         | 
| 160 | 
            +
                store_id     number(11) not null,
         | 
| 161 | 
            +
                name         varchar(100),
         | 
| 162 | 
            +
                lock_version number(11) default 0,
         | 
| 163 | 
            +
                constraint restaurants_pk primary key (franchise_id, store_id)
         | 
| 164 | 
            +
            );
         | 
| 165 | 
            +
             | 
| 166 | 
            +
            create table restaurants_suburbs (
         | 
| 167 | 
            +
                franchise_id number(11) not null,
         | 
| 168 | 
            +
                store_id     number(11) not null,
         | 
| 169 | 
            +
                city_id      number(11) not null,
         | 
| 170 | 
            +
                suburb_id    number(11) not null
         | 
| 171 | 
            +
            );
         | 
| 172 | 
            +
             | 
| 173 | 
            +
            create sequence dorms_seq start with 1000;
         | 
| 174 | 
            +
             | 
| 175 | 
            +
            create table dorms (
         | 
| 176 | 
            +
                id number(11) not null,
         | 
| 177 | 
            +
                constraint dorms_pk primary key (id)
         | 
| 178 | 
            +
            );
         | 
| 179 | 
            +
             | 
| 180 | 
            +
            create table rooms (
         | 
| 181 | 
            +
                dorm_id number(11) not null,
         | 
| 182 | 
            +
                room_id number(11) not null,
         | 
| 183 | 
            +
                constraint rooms_pk primary key (dorm_id, room_id)
         | 
| 184 | 
            +
            );
         | 
| 185 | 
            +
             | 
| 186 | 
            +
            create sequence room_attributes_seq start with 1000;
         | 
| 187 | 
            +
             | 
| 188 | 
            +
            create table room_attributes (
         | 
| 189 | 
            +
                id   number(11) not null,
         | 
| 190 | 
            +
                name varchar(50),
         | 
| 191 | 
            +
                constraint room_attributes_pk primary key (id)
         | 
| 192 | 
            +
            );
         | 
| 193 | 
            +
             | 
| 194 | 
            +
            create table room_attribute_assignments (
         | 
| 195 | 
            +
                dorm_id           number(11) not null,
         | 
| 196 | 
            +
                room_id           number(11) not null,
         | 
| 197 | 
            +
                room_attribute_id number(11) not null
         | 
| 198 | 
            +
            );
         | 
| 199 | 
            +
             | 
| 200 | 
            +
            create sequence students_seq start with 1000;
         | 
| 201 | 
            +
             | 
| 202 | 
            +
            create table students (
         | 
| 203 | 
            +
                id number(11) not null,
         | 
| 204 | 
            +
                constraint students_pk primary key (id)
         | 
| 205 | 
            +
            );
         | 
| 206 | 
            +
             | 
| 207 | 
            +
            create table room_assignments (
         | 
| 208 | 
            +
                student_id number(11) not null,
         | 
| 209 | 
            +
                dorm_id    number(11) not null,
         | 
| 210 | 
            +
                room_id    number(11) not null
         | 
| 211 | 
            +
            );
         | 
| 212 | 
            +
             | 
| 213 | 
            +
            create table seats (
         | 
| 214 | 
            +
                flight_number int not null,
         | 
| 215 | 
            +
                seat          int not null,
         | 
| 216 | 
            +
                customer      int,
         | 
| 217 | 
            +
                primary key (flight_number, seat)
         | 
| 218 | 
            +
            );
         | 
| 219 | 
            +
             | 
| 220 | 
            +
            create table capitols (
         | 
| 221 | 
            +
                country varchar2(100) not null,
         | 
| 222 | 
            +
                city varchar2(100) not null,
         | 
| 223 | 
            +
                primary key (country, city)
         | 
| 224 | 
            +
            );
         | 
| 225 | 
            +
             | 
| 226 | 
            +
            create table products_restaurants (
         | 
| 227 | 
            +
                product_id   number(11) not null,
         | 
| 228 | 
            +
                franchise_id number(11) not null,
         | 
| 229 | 
            +
                store_id     number(11) not null
         | 
| 230 | 
            +
            );
         | 
| 231 | 
            +
             | 
| 232 | 
            +
            create table employees_groups (
         | 
| 233 | 
            +
              employee_id int not null,
         | 
| 234 | 
            +
              group_id int not null
         | 
| 235 | 
            +
            );
         | 
| 236 | 
            +
             |