composite_primary_keys 7.0.16 → 8.0.0
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 +600 -623
- data/lib/composite_primary_keys.rb +113 -115
- data/lib/composite_primary_keys/associations/association.rb +23 -23
- data/lib/composite_primary_keys/associations/association_scope.rb +73 -77
- data/lib/composite_primary_keys/associations/collection_association.rb +15 -0
- data/lib/composite_primary_keys/associations/has_many_association.rb +69 -56
- data/lib/composite_primary_keys/associations/has_many_through_association.rb +30 -28
- data/lib/composite_primary_keys/associations/join_dependency.rb +87 -89
- data/lib/composite_primary_keys/associations/join_dependency/join_association.rb +22 -22
- data/lib/composite_primary_keys/associations/preloader/association.rb +90 -78
- data/lib/composite_primary_keys/associations/preloader/belongs_to.rb +19 -19
- data/lib/composite_primary_keys/associations/singular_association.rb +15 -0
- data/lib/composite_primary_keys/attribute_methods.rb +9 -0
- data/lib/composite_primary_keys/attribute_methods/dirty.rb +29 -26
- data/lib/composite_primary_keys/attribute_methods/read.rb +19 -34
- data/lib/composite_primary_keys/attribute_methods/write.rb +30 -36
- data/lib/composite_primary_keys/attribute_set/builder.rb +20 -0
- data/lib/composite_primary_keys/base.rb +135 -129
- data/lib/composite_primary_keys/composite_arrays.rb +30 -30
- data/lib/composite_primary_keys/composite_predicates.rb +50 -50
- data/lib/composite_primary_keys/composite_relation.rb +48 -48
- data/lib/composite_primary_keys/connection_adapters/abstract/connection_specification_changes.rb +2 -4
- data/lib/composite_primary_keys/connection_adapters/postgresql_adapter.rb +46 -60
- data/lib/composite_primary_keys/core.rb +69 -47
- data/lib/composite_primary_keys/fixtures.rb +22 -22
- data/lib/composite_primary_keys/persistence.rb +56 -60
- data/lib/composite_primary_keys/relation.rb +68 -56
- data/lib/composite_primary_keys/relation/calculations.rb +79 -75
- data/lib/composite_primary_keys/relation/finder_methods.rb +175 -196
- data/lib/composite_primary_keys/relation/query_methods.rb +40 -40
- data/lib/composite_primary_keys/sanitization.rb +52 -52
- data/lib/composite_primary_keys/validations/uniqueness.rb +36 -37
- data/lib/composite_primary_keys/version.rb +8 -8
- data/tasks/databases/oracle.rake +25 -25
- data/tasks/databases/sqlserver.rake +27 -40
- data/test/abstract_unit.rb +113 -113
- data/test/connections/databases.ci.yml +15 -15
- data/test/connections/databases.example.yml +18 -18
- data/test/connections/native_oracle/connection.rb +11 -11
- data/test/connections/native_oracle_enhanced/connection.rb +16 -16
- data/test/connections/native_sqlserver/connection.rb +11 -14
- data/test/fixtures/comment.rb +7 -7
- data/test/fixtures/db_definitions/db2-create-tables.sql +125 -126
- data/test/fixtures/db_definitions/db2-drop-tables.sql +18 -18
- data/test/fixtures/db_definitions/mysql.sql +207 -208
- data/test/fixtures/db_definitions/oracle.drop.sql +45 -45
- data/test/fixtures/db_definitions/oracle.sql +222 -223
- data/test/fixtures/db_definitions/postgresql.sql +209 -210
- data/test/fixtures/db_definitions/sqlite.sql +196 -197
- data/test/fixtures/db_definitions/sqlserver.drop.sql +91 -94
- data/test/fixtures/db_definitions/sqlserver.sql +225 -232
- data/test/fixtures/dorm.rb +2 -2
- data/test/fixtures/employee.rb +5 -5
- 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_associations.rb +295 -275
- data/test/test_attribute_methods.rb +63 -63
- data/test/test_attributes.rb +60 -60
- data/test/test_calculations.rb +37 -42
- data/test/test_callbacks.rb +99 -99
- data/test/test_create.rb +112 -112
- data/test/test_delete.rb +148 -152
- data/test/test_delete_all.rb +28 -26
- data/test/test_dumpable.rb +15 -15
- data/test/test_enum.rb +21 -20
- data/test/test_equal.rb +26 -26
- data/test/test_find.rb +118 -118
- data/test/test_habtm.rb +113 -113
- data/test/test_nested_attributes.rb +124 -124
- data/test/test_polymorphic.rb +26 -26
- data/test/test_predicates.rb +40 -40
- data/test/test_santiago.rb +23 -23
- data/test/test_suite.rb +33 -34
- data/test/test_touch.rb +23 -23
- data/test/test_tutorial_example.rb +21 -21
- data/test/test_update.rb +71 -71
- metadata +9 -13
- data/lib/composite_primary_keys/arel/visitors/to_sql.rb +0 -20
- data/lib/composite_primary_keys/associations/has_and_belongs_to_many_association.rb +0 -59
- data/lib/composite_primary_keys/associations/join_dependency/join_part.rb +0 -39
- data/lib/composite_primary_keys/associations/preloader/has_and_belongs_to_many.rb +0 -46
- data/lib/composite_primary_keys/connection_adapters/sqlserver_adapter.rb +0 -17
- data/lib/composite_primary_keys/locking/optimistic.rb +0 -55
- data/test/test_optimistic.rb +0 -18
@@ -1,15 +1,15 @@
|
|
1
|
-
mysql:
|
2
|
-
adapter: mysql2
|
3
|
-
username: travis
|
4
|
-
password: ""
|
5
|
-
database: composite_primary_keys_unittest
|
6
|
-
|
7
|
-
sqlite3:
|
8
|
-
adapter: sqlite3
|
9
|
-
database: db/composite_primary_keys_unittest.sqlite
|
10
|
-
|
11
|
-
postgresql:
|
12
|
-
adapter: postgresql
|
13
|
-
database: composite_primary_keys_unittest
|
14
|
-
username: postgres
|
15
|
-
host: localhost
|
1
|
+
mysql:
|
2
|
+
adapter: mysql2
|
3
|
+
username: travis
|
4
|
+
password: ""
|
5
|
+
database: composite_primary_keys_unittest
|
6
|
+
|
7
|
+
sqlite3:
|
8
|
+
adapter: sqlite3
|
9
|
+
database: db/composite_primary_keys_unittest.sqlite
|
10
|
+
|
11
|
+
postgresql:
|
12
|
+
adapter: postgresql
|
13
|
+
database: composite_primary_keys_unittest
|
14
|
+
username: postgres
|
15
|
+
host: localhost
|
@@ -1,18 +1,18 @@
|
|
1
|
-
# To run tests:
|
2
|
-
# 1. Copy this file to test/connections/databases.yml.
|
3
|
-
# 2. Update to match the databases you want to test against.
|
4
|
-
|
5
|
-
mysql:
|
6
|
-
adapter: mysql2
|
7
|
-
username: root
|
8
|
-
database: composite_primary_keys_unittest
|
9
|
-
|
10
|
-
sqlite3:
|
11
|
-
adapter: sqlite3
|
12
|
-
database: db/composite_primary_keys_unittest.sqlite
|
13
|
-
|
14
|
-
postgresql:
|
15
|
-
adapter: postgresql
|
16
|
-
database: composite_primary_keys_unittest
|
17
|
-
username: postgres
|
18
|
-
host: localhost
|
1
|
+
# To run tests:
|
2
|
+
# 1. Copy this file to test/connections/databases.yml.
|
3
|
+
# 2. Update to match the databases you want to test against.
|
4
|
+
|
5
|
+
mysql:
|
6
|
+
adapter: mysql2
|
7
|
+
username: root
|
8
|
+
database: composite_primary_keys_unittest
|
9
|
+
|
10
|
+
sqlite3:
|
11
|
+
adapter: sqlite3
|
12
|
+
database: db/composite_primary_keys_unittest.sqlite
|
13
|
+
|
14
|
+
postgresql:
|
15
|
+
adapter: postgresql
|
16
|
+
database: composite_primary_keys_unittest
|
17
|
+
username: postgres
|
18
|
+
host: localhost
|
@@ -1,11 +1,11 @@
|
|
1
|
-
print "Using native Oracle\n"
|
2
|
-
|
3
|
-
require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
|
4
|
-
|
5
|
-
def connection_string
|
6
|
-
"#{SPEC['username']}/#{SPEC['password']}@#{SPEC['host']}"
|
7
|
-
end
|
8
|
-
|
9
|
-
# Adapter config setup in locals/database_connections.rb
|
10
|
-
SPEC = CompositePrimaryKeys::ConnectionSpec['oracle']
|
11
|
-
ActiveRecord::Base.establish_connection(SPEC)
|
1
|
+
print "Using native Oracle\n"
|
2
|
+
|
3
|
+
require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
|
4
|
+
|
5
|
+
def connection_string
|
6
|
+
"#{SPEC['username']}/#{SPEC['password']}@#{SPEC['host']}"
|
7
|
+
end
|
8
|
+
|
9
|
+
# Adapter config setup in locals/database_connections.rb
|
10
|
+
SPEC = CompositePrimaryKeys::ConnectionSpec['oracle']
|
11
|
+
ActiveRecord::Base.establish_connection(SPEC)
|
@@ -1,16 +1,16 @@
|
|
1
|
-
print "Using native Oracle Enhanced\n"
|
2
|
-
|
3
|
-
require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
|
4
|
-
|
5
|
-
def connection_string
|
6
|
-
"#{SPEC['username']}/#{SPEC['password']}@#{SPEC['host']}"
|
7
|
-
end
|
8
|
-
|
9
|
-
# Adapter config setup in locals/database_connections.rb
|
10
|
-
SPEC = CompositePrimaryKeys::ConnectionSpec[:oracle]
|
11
|
-
ActiveRecord::Base.establish_connection(SPEC)
|
12
|
-
|
13
|
-
# Change default options for Oracle Enhanced adapter
|
14
|
-
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_dates_by_column_name = true
|
15
|
-
# Change NLS_DATE_FORMAT to non-default format to verify that all tests should pass
|
16
|
-
ActiveRecord::Base.connection.execute %q{alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'}
|
1
|
+
print "Using native Oracle Enhanced\n"
|
2
|
+
|
3
|
+
require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
|
4
|
+
|
5
|
+
def connection_string
|
6
|
+
"#{SPEC['username']}/#{SPEC['password']}@#{SPEC['host']}"
|
7
|
+
end
|
8
|
+
|
9
|
+
# Adapter config setup in locals/database_connections.rb
|
10
|
+
SPEC = CompositePrimaryKeys::ConnectionSpec[:oracle]
|
11
|
+
ActiveRecord::Base.establish_connection(SPEC)
|
12
|
+
|
13
|
+
# Change default options for Oracle Enhanced adapter
|
14
|
+
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_dates_by_column_name = true
|
15
|
+
# Change NLS_DATE_FORMAT to non-default format to verify that all tests should pass
|
16
|
+
ActiveRecord::Base.connection.execute %q{alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'}
|
@@ -1,14 +1,11 @@
|
|
1
|
-
print "Using native SQL Server\n"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# Adapter config setup in locals/database_connections.rb
|
13
|
-
SPEC = CompositePrimaryKeys::ConnectionSpec['sqlserver']
|
14
|
-
ActiveRecord::Base.establish_connection(SPEC)
|
1
|
+
print "Using native SQL Server\n"
|
2
|
+
|
3
|
+
require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
|
4
|
+
|
5
|
+
def connection_string
|
6
|
+
"-S #{SPEC['host']} -U #{SPEC['username']} -P\"#{SPEC['password']}\""
|
7
|
+
end
|
8
|
+
|
9
|
+
# Adapter config setup in locals/database_connections.rb
|
10
|
+
SPEC = CompositePrimaryKeys::ConnectionSpec['sqlserver']
|
11
|
+
ActiveRecord::Base.establish_connection(SPEC)
|
data/test/fixtures/comment.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
class Comment < ActiveRecord::Base
|
2
|
-
belongs_to :person, :polymorphic => true
|
3
|
-
belongs_to :hack
|
4
|
-
|
5
|
-
enum :shown => [ :true, :false ]
|
6
|
-
end
|
7
|
-
|
1
|
+
class Comment < ActiveRecord::Base
|
2
|
+
belongs_to :person, :polymorphic => true
|
3
|
+
belongs_to :hack
|
4
|
+
|
5
|
+
enum :shown => [ :true, :false ]
|
6
|
+
end
|
7
|
+
|
@@ -1,126 +1,125 @@
|
|
1
|
-
CREATE TABLE topics (
|
2
|
-
id integer NOT NULL,
|
3
|
-
name varchar(50) default NULL,
|
4
|
-
feed_size integer default NULL,
|
5
|
-
PRIMARY KEY (id)
|
6
|
-
);
|
7
|
-
|
8
|
-
CREATE TABLE topic_sources (
|
9
|
-
topic_id integer NOT NULL,
|
10
|
-
platform varchar(50) NOT NULL,
|
11
|
-
keywords varchar(50) default NULL,
|
12
|
-
PRIMARY KEY (topic_id,platform)
|
13
|
-
);
|
14
|
-
|
15
|
-
CREATE TABLE reference_types (
|
16
|
-
reference_type_id integer NOT NULL generated by default as identity (start with 100, increment by 1, no cache),
|
17
|
-
type_label varchar(50) default NULL,
|
18
|
-
abbreviation varchar(50) default NULL,
|
19
|
-
description varchar(50) default NULL,
|
20
|
-
PRIMARY KEY (reference_type_id)
|
21
|
-
);
|
22
|
-
|
23
|
-
CREATE TABLE reference_codes (
|
24
|
-
reference_type_id integer,
|
25
|
-
reference_code integer NOT NULL,
|
26
|
-
code_label varchar(50) default NULL,
|
27
|
-
abbreviation varchar(50) default NULL,
|
28
|
-
description varchar(50) default NULL,
|
29
|
-
PRIMARY KEY (reference_type_id,reference_code)
|
30
|
-
);
|
31
|
-
|
32
|
-
CREATE TABLE products (
|
33
|
-
id integer NOT NULL,
|
34
|
-
name varchar(50) default NULL,
|
35
|
-
PRIMARY KEY (id)
|
36
|
-
);
|
37
|
-
|
38
|
-
CREATE TABLE tariffs (
|
39
|
-
tariff_id integer NOT NULL,
|
40
|
-
start_date date NOT NULL,
|
41
|
-
amount integer default NULL,
|
42
|
-
PRIMARY KEY (tariff_id,start_date)
|
43
|
-
);
|
44
|
-
|
45
|
-
CREATE TABLE product_tariffs (
|
46
|
-
product_id integer NOT NULL,
|
47
|
-
tariff_id integer NOT NULL,
|
48
|
-
tariff_start_date date NOT NULL,
|
49
|
-
PRIMARY KEY (product_id,tariff_id,tariff_start_date)
|
50
|
-
);
|
51
|
-
|
52
|
-
CREATE TABLE suburbs (
|
53
|
-
city_id integer NOT NULL,
|
54
|
-
suburb_id integer NOT NULL,
|
55
|
-
name varchar(50) NOT NULL,
|
56
|
-
PRIMARY KEY (city_id,suburb_id)
|
57
|
-
);
|
58
|
-
|
59
|
-
CREATE TABLE streets (
|
60
|
-
id integer NOT NULL ,
|
61
|
-
city_id integer NOT NULL,
|
62
|
-
suburb_id integer NOT NULL,
|
63
|
-
name varchar(50) NOT NULL,
|
64
|
-
PRIMARY KEY (id)
|
65
|
-
);
|
66
|
-
|
67
|
-
CREATE TABLE users (
|
68
|
-
id integer NOT NULL ,
|
69
|
-
name varchar(50) NOT NULL,
|
70
|
-
PRIMARY KEY (id)
|
71
|
-
);
|
72
|
-
|
73
|
-
CREATE TABLE articles (
|
74
|
-
id integer NOT NULL ,
|
75
|
-
name varchar(50) NOT NULL,
|
76
|
-
PRIMARY KEY (id)
|
77
|
-
);
|
78
|
-
|
79
|
-
CREATE TABLE readings (
|
80
|
-
id integer NOT NULL ,
|
81
|
-
user_id integer NOT NULL,
|
82
|
-
article_id integer NOT NULL,
|
83
|
-
rating integer NOT NULL,
|
84
|
-
PRIMARY KEY (id)
|
85
|
-
);
|
86
|
-
|
87
|
-
CREATE TABLE groups (
|
88
|
-
id integer NOT NULL ,
|
89
|
-
name varchar(50) NOT NULL,
|
90
|
-
PRIMARY KEY (id)
|
91
|
-
);
|
92
|
-
|
93
|
-
CREATE TABLE memberships (
|
94
|
-
user_id integer NOT NULL,
|
95
|
-
group_id integer NOT NULL,
|
96
|
-
PRIMARY KEY (user_id,group_id)
|
97
|
-
);
|
98
|
-
|
99
|
-
CREATE TABLE membership_statuses (
|
100
|
-
id integer NOT NULL ,
|
101
|
-
user_id integer NOT NULL,
|
102
|
-
group_id integer NOT NULL,
|
103
|
-
status varchar(50) NOT NULL,
|
104
|
-
PRIMARY KEY (id)
|
105
|
-
);
|
106
|
-
|
107
|
-
create table restaurants (
|
108
|
-
franchise_id integer not null,
|
109
|
-
store_id integer not null,
|
110
|
-
name varchar(100),
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
);
|
1
|
+
CREATE TABLE topics (
|
2
|
+
id integer NOT NULL,
|
3
|
+
name varchar(50) default NULL,
|
4
|
+
feed_size integer default NULL,
|
5
|
+
PRIMARY KEY (id)
|
6
|
+
);
|
7
|
+
|
8
|
+
CREATE TABLE topic_sources (
|
9
|
+
topic_id integer NOT NULL,
|
10
|
+
platform varchar(50) NOT NULL,
|
11
|
+
keywords varchar(50) default NULL,
|
12
|
+
PRIMARY KEY (topic_id,platform)
|
13
|
+
);
|
14
|
+
|
15
|
+
CREATE TABLE reference_types (
|
16
|
+
reference_type_id integer NOT NULL generated by default as identity (start with 100, increment by 1, no cache),
|
17
|
+
type_label varchar(50) default NULL,
|
18
|
+
abbreviation varchar(50) default NULL,
|
19
|
+
description varchar(50) default NULL,
|
20
|
+
PRIMARY KEY (reference_type_id)
|
21
|
+
);
|
22
|
+
|
23
|
+
CREATE TABLE reference_codes (
|
24
|
+
reference_type_id integer,
|
25
|
+
reference_code integer NOT NULL,
|
26
|
+
code_label varchar(50) default NULL,
|
27
|
+
abbreviation varchar(50) default NULL,
|
28
|
+
description varchar(50) default NULL,
|
29
|
+
PRIMARY KEY (reference_type_id,reference_code)
|
30
|
+
);
|
31
|
+
|
32
|
+
CREATE TABLE products (
|
33
|
+
id integer NOT NULL,
|
34
|
+
name varchar(50) default NULL,
|
35
|
+
PRIMARY KEY (id)
|
36
|
+
);
|
37
|
+
|
38
|
+
CREATE TABLE tariffs (
|
39
|
+
tariff_id integer NOT NULL,
|
40
|
+
start_date date NOT NULL,
|
41
|
+
amount integer default NULL,
|
42
|
+
PRIMARY KEY (tariff_id,start_date)
|
43
|
+
);
|
44
|
+
|
45
|
+
CREATE TABLE product_tariffs (
|
46
|
+
product_id integer NOT NULL,
|
47
|
+
tariff_id integer NOT NULL,
|
48
|
+
tariff_start_date date NOT NULL,
|
49
|
+
PRIMARY KEY (product_id,tariff_id,tariff_start_date)
|
50
|
+
);
|
51
|
+
|
52
|
+
CREATE TABLE suburbs (
|
53
|
+
city_id integer NOT NULL,
|
54
|
+
suburb_id integer NOT NULL,
|
55
|
+
name varchar(50) NOT NULL,
|
56
|
+
PRIMARY KEY (city_id,suburb_id)
|
57
|
+
);
|
58
|
+
|
59
|
+
CREATE TABLE streets (
|
60
|
+
id integer NOT NULL ,
|
61
|
+
city_id integer NOT NULL,
|
62
|
+
suburb_id integer NOT NULL,
|
63
|
+
name varchar(50) NOT NULL,
|
64
|
+
PRIMARY KEY (id)
|
65
|
+
);
|
66
|
+
|
67
|
+
CREATE TABLE users (
|
68
|
+
id integer NOT NULL ,
|
69
|
+
name varchar(50) NOT NULL,
|
70
|
+
PRIMARY KEY (id)
|
71
|
+
);
|
72
|
+
|
73
|
+
CREATE TABLE articles (
|
74
|
+
id integer NOT NULL ,
|
75
|
+
name varchar(50) NOT NULL,
|
76
|
+
PRIMARY KEY (id)
|
77
|
+
);
|
78
|
+
|
79
|
+
CREATE TABLE readings (
|
80
|
+
id integer NOT NULL ,
|
81
|
+
user_id integer NOT NULL,
|
82
|
+
article_id integer NOT NULL,
|
83
|
+
rating integer NOT NULL,
|
84
|
+
PRIMARY KEY (id)
|
85
|
+
);
|
86
|
+
|
87
|
+
CREATE TABLE groups (
|
88
|
+
id integer NOT NULL ,
|
89
|
+
name varchar(50) NOT NULL,
|
90
|
+
PRIMARY KEY (id)
|
91
|
+
);
|
92
|
+
|
93
|
+
CREATE TABLE memberships (
|
94
|
+
user_id integer NOT NULL,
|
95
|
+
group_id integer NOT NULL,
|
96
|
+
PRIMARY KEY (user_id,group_id)
|
97
|
+
);
|
98
|
+
|
99
|
+
CREATE TABLE membership_statuses (
|
100
|
+
id integer NOT NULL ,
|
101
|
+
user_id integer NOT NULL,
|
102
|
+
group_id integer NOT NULL,
|
103
|
+
status varchar(50) NOT NULL,
|
104
|
+
PRIMARY KEY (id)
|
105
|
+
);
|
106
|
+
|
107
|
+
create table restaurants (
|
108
|
+
franchise_id integer not null,
|
109
|
+
store_id integer not null,
|
110
|
+
name varchar(100),
|
111
|
+
primary key (franchise_id, store_id)
|
112
|
+
);
|
113
|
+
|
114
|
+
create table restaurants_suburbs (
|
115
|
+
franchise_id integer not null,
|
116
|
+
store_id integer not null,
|
117
|
+
city_id integer not null,
|
118
|
+
suburb_id integer not null
|
119
|
+
);
|
120
|
+
|
121
|
+
create table products_restaurants (
|
122
|
+
product_id integer not null,
|
123
|
+
franchise_id integer not null,
|
124
|
+
store_id integer not null
|
125
|
+
);
|
@@ -1,19 +1,19 @@
|
|
1
|
-
drop table MEMBERSHIPS;
|
2
|
-
drop table REFERENCE_CODES;
|
3
|
-
drop table TARIFFS;
|
4
|
-
drop table ARTICLES;
|
5
|
-
drop table GROUPS;
|
6
|
-
drop table MEMBERSHIP_STATUSES;
|
7
|
-
drop table READINGS;
|
8
|
-
drop table REFERENCE_TYPES;
|
9
|
-
drop table STREETS;
|
10
|
-
drop table PRODUCTS;
|
11
|
-
drop table USERS;
|
12
|
-
drop table SUBURBS;
|
13
|
-
drop table PRODUCT_TARIFFS;
|
14
|
-
drop table KITCHEN_SINK;
|
15
|
-
drop table RESTAURANTS;
|
16
|
-
drop table RESTAURANTS_SUBURBS;
|
17
|
-
drop table PRODUCTS_RESTAURANTS;
|
18
|
-
drop table TOPICS;
|
1
|
+
drop table MEMBERSHIPS;
|
2
|
+
drop table REFERENCE_CODES;
|
3
|
+
drop table TARIFFS;
|
4
|
+
drop table ARTICLES;
|
5
|
+
drop table GROUPS;
|
6
|
+
drop table MEMBERSHIP_STATUSES;
|
7
|
+
drop table READINGS;
|
8
|
+
drop table REFERENCE_TYPES;
|
9
|
+
drop table STREETS;
|
10
|
+
drop table PRODUCTS;
|
11
|
+
drop table USERS;
|
12
|
+
drop table SUBURBS;
|
13
|
+
drop table PRODUCT_TARIFFS;
|
14
|
+
drop table KITCHEN_SINK;
|
15
|
+
drop table RESTAURANTS;
|
16
|
+
drop table RESTAURANTS_SUBURBS;
|
17
|
+
drop table PRODUCTS_RESTAURANTS;
|
18
|
+
drop table TOPICS;
|
19
19
|
drop table TOPIC_SOURCES;
|