odbc-rails 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/ChangeLog +18 -0
  2. data/NEWS +5 -0
  3. data/README +20 -7
  4. data/lib/active_record/connection_adapters/odbc_adapter.rb +254 -211
  5. data/lib/active_record/vendor/odbcext_informix.rb +17 -4
  6. data/lib/active_record/vendor/odbcext_ingres.rb +5 -5
  7. data/lib/active_record/vendor/odbcext_microsoftsqlserver.rb +35 -4
  8. data/lib/active_record/vendor/odbcext_mysql.rb +36 -8
  9. data/lib/active_record/vendor/odbcext_oracle.rb +4 -4
  10. data/lib/active_record/vendor/odbcext_postgresql.rb +8 -12
  11. data/lib/active_record/vendor/odbcext_progress.rb +3 -3
  12. data/lib/active_record/vendor/odbcext_progress89.rb +5 -4
  13. data/lib/active_record/vendor/odbcext_sybase.rb +6 -5
  14. data/lib/active_record/vendor/odbcext_virtuoso.rb +16 -3
  15. data/support/odbc_rails.diff +335 -266
  16. data/support/rake_fixes/README +6 -0
  17. data/support/rake_fixes/databases.dif +13 -0
  18. data/support/test/base_test.rb +333 -75
  19. data/support/test/migration_test.rb +430 -149
  20. data/test/connections/native_odbc/connection.rb +63 -44
  21. data/test/fixtures/db_definitions/db2.drop.sql +1 -0
  22. data/test/fixtures/db_definitions/db2.sql +9 -0
  23. data/test/fixtures/db_definitions/informix.drop.sql +1 -0
  24. data/test/fixtures/db_definitions/informix.sql +10 -0
  25. data/test/fixtures/db_definitions/ingres.drop.sql +2 -0
  26. data/test/fixtures/db_definitions/ingres.sql +9 -0
  27. data/test/fixtures/db_definitions/mysql.drop.sql +1 -0
  28. data/test/fixtures/db_definitions/mysql.sql +21 -12
  29. data/test/fixtures/db_definitions/oracle_odbc.drop.sql +4 -0
  30. data/test/fixtures/db_definitions/oracle_odbc.sql +29 -1
  31. data/test/fixtures/db_definitions/postgresql.drop.sql +3 -1
  32. data/test/fixtures/db_definitions/postgresql.sql +13 -3
  33. data/test/fixtures/db_definitions/progress.drop.sql +2 -0
  34. data/test/fixtures/db_definitions/progress.sql +11 -0
  35. data/test/fixtures/db_definitions/sqlserver.drop.sql +3 -0
  36. data/test/fixtures/db_definitions/sqlserver.sql +35 -0
  37. data/test/fixtures/db_definitions/sybase.drop.sql +2 -0
  38. data/test/fixtures/db_definitions/sybase.sql +16 -7
  39. data/test/fixtures/db_definitions/virtuoso.drop.sql +1 -0
  40. data/test/fixtures/db_definitions/virtuoso.sql +10 -0
  41. metadata +6 -3
@@ -232,3 +232,14 @@ create table topics (
232
232
  "type" varchar(50)
233
233
  );
234
234
  create sequence topics_seq minvalue 10000;
235
+
236
+ create table numeric_data (
237
+ id integer not null primary key,
238
+ bank_balance decimal(10,2),
239
+ big_bank_balance decimal(15,2),
240
+ world_population decimal(10),
241
+ my_house_population decimal(2),
242
+ decimal_number_with_default decimal(3,2) default 2.78
243
+ );
244
+ create sequence numeric_data_seq minvalue 10000;
245
+
@@ -10,6 +10,7 @@ DROP TABLE orders;
10
10
  DROP TABLE movies;
11
11
  DROP TABLE subscribers;
12
12
  DROP TABLE booleantests;
13
+ DROP TABLE defaults;
13
14
  DROP TABLE auto_id_tests;
14
15
  DROP TABLE entrants;
15
16
  DROP TABLE colnametests;
@@ -28,3 +29,5 @@ DROP TABLE fk_test_has_fk;
28
29
  DROP TABLE fk_test_has_pk;
29
30
  DROP TABLE keyboards;
30
31
  DROP TABLE legacy_things;
32
+ DROP TABLE numeric_data;
33
+ DROP TABLE [order];
@@ -88,6 +88,24 @@ CREATE TABLE booleantests (
88
88
  value bit default NULL
89
89
  );
90
90
 
91
+ CREATE TABLE defaults (
92
+ id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
93
+ -- these brought from the PostgreSQL defaults_test.rb but
94
+ -- tests only exist for integers and decimals, currently
95
+ -- modified_date date default CURRENT_DATE,
96
+ -- modified_date_function date default now(),
97
+ -- fixed_date date default '2004-01-01',
98
+ -- modified_time timestamp default CURRENT_TIMESTAMP,
99
+ -- modified_time_function timestamp default now(),
100
+ -- fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
101
+ -- char1 char(1) default 'Y',
102
+ -- char2 character varying(50) default 'a varchar field',
103
+ -- char3 text default 'a text field',
104
+ positive_integer integer default 1,
105
+ negative_integer integer default -1,
106
+ decimal_number decimal(3,2) default 2.78
107
+ );
108
+
91
109
  CREATE TABLE auto_id_tests (
92
110
  auto_id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
93
111
  value int default NULL
@@ -201,3 +219,20 @@ CREATE TABLE legacy_things (
201
219
  version int default 0,
202
220
  PRIMARY KEY (id)
203
221
  );
222
+
223
+ CREATE TABLE numeric_data (
224
+ id int NOT NULL IDENTITY(1, 1),
225
+ bank_balance decimal(10,2),
226
+ big_bank_balance decimal(15,2),
227
+ world_population decimal(10),
228
+ my_house_population decimal(2),
229
+ decimal_number_with_default decimal(3,2) DEFAULT 2.78
230
+ );
231
+
232
+ CREATE TABLE [order] (
233
+ id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
234
+ color varchar(255),
235
+ fruit_size varchar(255),
236
+ texture varchar(255),
237
+ flavor varchar(255)
238
+ );
@@ -28,4 +28,6 @@ DROP TABLE fk_test_has_fk
28
28
  DROP TABLE fk_test_has_pk
29
29
  DROP TABLE keyboards
30
30
  DROP TABLE legacy_things
31
+ DROP TABLE numeric_data
32
+ DROP TABLE schema_info
31
33
  go
@@ -26,8 +26,8 @@ CREATE TABLE topics (
26
26
  author_name varchar(255) NULL,
27
27
  author_email_address varchar(255) NULL,
28
28
  written_on datetime NULL,
29
- bonus_time time NULL,
30
- last_read date NULL,
29
+ bonus_time datetime NULL,
30
+ last_read datetime NULL,
31
31
  content varchar(255) NULL,
32
32
  approved bit default 1,
33
33
  replies_count int default 0,
@@ -118,7 +118,7 @@ CREATE TABLE mixins (
118
118
 
119
119
  CREATE TABLE people (
120
120
  id int IDENTITY PRIMARY KEY,
121
- first_name varchar(40) NOT NULL,
121
+ first_name varchar(40) NULL,
122
122
  lock_version int DEFAULT 0
123
123
  )
124
124
 
@@ -181,8 +181,8 @@ CREATE TABLE fk_test_has_pk (
181
181
  )
182
182
 
183
183
  CREATE TABLE fk_test_has_fk (
184
- id int PRIMARY KEY,
185
- fk_id int NOT NULL,
184
+ id numeric(9,0) PRIMARY KEY,
185
+ fk_id numeric(9,0) NOT NULL,
186
186
 
187
187
  FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
188
188
  )
@@ -197,8 +197,17 @@ CREATE TABLE keyboards (
197
197
  CREATE TABLE legacy_things (
198
198
  id int IDENTITY PRIMARY KEY,
199
199
  tps_report_number int default NULL,
200
- version int default 0,
200
+ version int default 0
201
201
  )
202
202
 
203
- go
204
203
 
204
+ CREATE TABLE numeric_data (
205
+ id int IDENTITY PRIMARY KEY,
206
+ bank_balance numeric(10,2),
207
+ big_bank_balance numeric(15,2),
208
+ world_population numeric(10),
209
+ my_house_population numeric(2),
210
+ decimal_number_with_default numeric(3,2) DEFAULT 2.78
211
+ )
212
+
213
+ go
@@ -28,3 +28,4 @@ DROP TABLE fk_test_has_fk;
28
28
  DROP TABLE fk_test_has_pk;
29
29
  DROP TABLE keyboards;
30
30
  DROP TABLE legacy_things;
31
+ DROP TABLE numeric_data;
@@ -198,3 +198,13 @@ CREATE TABLE legacy_things (
198
198
  tps_report_number int default NULL,
199
199
  version int default 0
200
200
  );
201
+
202
+ create table numeric_data (
203
+ id INTEGER NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
204
+ bank_balance decimal(10,2),
205
+ big_bank_balance decimal(15,2),
206
+ world_population decimal(10,0),
207
+ my_house_population decimal(2,0),
208
+ decimal_number_with_default decimal(3,2) DEFAULT 2.78
209
+ );
210
+
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: odbc-rails
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.3"
7
- date: 2007-01-09 00:00:00 +01:00
6
+ version: "1.4"
7
+ date: 2007-02-27 00:00:00 +01:00
8
8
  summary: ODBC Data Adapter for ActiveRecord.
9
9
  require_paths:
10
10
  - lib
@@ -97,12 +97,15 @@ files:
97
97
  - support/odbc_rails.diff
98
98
  - support/pack_odbc.rb
99
99
  - support/rake
100
+ - support/rake_fixes
100
101
  - support/test
101
102
  - support/lib/active_record
102
103
  - support/lib/active_record/connection_adapters
103
104
  - support/lib/active_record/connection_adapters/abstract
104
105
  - support/lib/active_record/connection_adapters/abstract/schema_definitions.rb
105
106
  - support/rake/rails_plugin_package_task.rb
107
+ - support/rake_fixes/databases.dif
108
+ - support/rake_fixes/README
106
109
  - support/test/base_test.rb
107
110
  - support/test/migration_test.rb
108
111
  - AUTHORS
@@ -149,5 +152,5 @@ dependencies:
149
152
  requirements:
150
153
  - - ">="
151
154
  - !ruby/object:Gem::Version
152
- version: "1.11"
155
+ version: "1.15"
153
156
  version: