diff options
author | Jamis Buck <jamis@37signals.com> | 2005-08-23 11:05:04 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-08-23 11:05:04 +0000 |
commit | dfe1aeb776ed9a7da8b431c7933c858d155a13c7 (patch) | |
tree | 11593565c25ad674b9fbaf7d9d17e313f0c4198c /activerecord/test/fixtures/db_definitions | |
parent | 211617191ed9e6bc9da1cee1bdd134c9b8c3cdfd (diff) | |
download | rails-dfe1aeb776ed9a7da8b431c7933c858d155a13c7.tar.gz rails-dfe1aeb776ed9a7da8b431c7933c858d155a13c7.tar.bz2 rails-dfe1aeb776ed9a7da8b431c7933c858d155a13c7.zip |
Saving a record with two unsaved belongs_to associations pointing to the same object fails #2023 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2040 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures/db_definitions')
6 files changed, 51 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/db_definitions/db2.sql b/activerecord/test/fixtures/db_definitions/db2.sql index 5977dc4bb2..9c41f7eede 100644 --- a/activerecord/test/fixtures/db_definitions/db2.sql +++ b/activerecord/test/fixtures/db_definitions/db2.sql @@ -55,6 +55,14 @@ CREATE TABLE developers_projects ( access_level smallint default 1 ); +CREATE TABLE orders ( + id int generated by default as identity (start with +10000), + name varchar(100) default NULL, + billing_customer_id int default NULL, + shipping_customer_id int default NULL, + PRIMARY KEY (id) +); + CREATE TABLE customers ( id int generated by default as identity (start with +10000), name varchar(100) default NULL, diff --git a/activerecord/test/fixtures/db_definitions/mysql.sql b/activerecord/test/fixtures/db_definitions/mysql.sql index 1400f1608b..d581ee3ae8 100755 --- a/activerecord/test/fixtures/db_definitions/mysql.sql +++ b/activerecord/test/fixtures/db_definitions/mysql.sql @@ -56,6 +56,14 @@ CREATE TABLE `developers_projects` ( `access_level` smallint default 1 ) TYPE=InnoDB; +CREATE TABLE `orders` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(100) default NULL, + `billing_customer_id` int(11) default NULL, + `shipping_customer_id` int(11) default NULL, + PRIMARY KEY (`id`) +) TYPE=InnoDB; + CREATE TABLE `customers` ( `id` int(11) NOT NULL auto_increment, `name` varchar(100) default NULL, @@ -182,4 +190,4 @@ CREATE TABLE `fk_test_has_fk` ( `fk_id` INTEGER NOT NULL, FOREIGN KEY (`fk_id`) REFERENCES `fk_test_has_pk`(`id`) -) TYPE=InnoDB; +) TYPE=InnoDB;
\ No newline at end of file diff --git a/activerecord/test/fixtures/db_definitions/oci.sql b/activerecord/test/fixtures/db_definitions/oci.sql index 8abdc0e6ae..f6e958d7c2 100644 --- a/activerecord/test/fixtures/db_definitions/oci.sql +++ b/activerecord/test/fixtures/db_definitions/oci.sql @@ -89,6 +89,15 @@ create table developers_projects ( ); create sequence developers_projects_seq minvalue 10000; +create table orders ( + id integer not null, + name varchar(100) default null, + billing_customer_id integer default null, + shipping_customer_id integer default null, + primary key (id) +); +create sequence orders_seq minvalue 10000; + create table customers ( id integer not null, name varchar(100) default null, diff --git a/activerecord/test/fixtures/db_definitions/postgresql.sql b/activerecord/test/fixtures/db_definitions/postgresql.sql index 9d2e50132a..21ca82a4ab 100644 --- a/activerecord/test/fixtures/db_definitions/postgresql.sql +++ b/activerecord/test/fixtures/db_definitions/postgresql.sql @@ -72,6 +72,15 @@ CREATE TABLE customers ( ); SELECT setval('customers_id_seq', 100); +CREATE TABLE orders ( + id serial, + name character varying, + billing_customer_id integer, + shipping_customer_id integer, + PRIMARY KEY (id) +); +SELECT setval('orders_id_seq', 100); + CREATE TABLE movies ( movieid serial, name text, diff --git a/activerecord/test/fixtures/db_definitions/sqlite.sql b/activerecord/test/fixtures/db_definitions/sqlite.sql index 2ffe91324c..d5879c31d8 100644 --- a/activerecord/test/fixtures/db_definitions/sqlite.sql +++ b/activerecord/test/fixtures/db_definitions/sqlite.sql @@ -51,6 +51,14 @@ CREATE TABLE 'developers_projects' ( 'access_level' INTEGER DEFAULT 1 ); + +CREATE TABLE 'orders' ( + 'id' INTEGER PRIMARY KEY NOT NULL, + 'name' VARCHAR(255) DEFAULT NULL, + 'billing_customer_id' INTEGER DEFAULT NULL, + 'shipping_customer_id' INTEGER DEFAULT NULL +); + CREATE TABLE 'customers' ( 'id' INTEGER PRIMARY KEY NOT NULL, 'name' VARCHAR(255) DEFAULT NULL, diff --git a/activerecord/test/fixtures/db_definitions/sqlserver.sql b/activerecord/test/fixtures/db_definitions/sqlserver.sql index e5123ccef0..76ec7aabf3 100644 --- a/activerecord/test/fixtures/db_definitions/sqlserver.sql +++ b/activerecord/test/fixtures/db_definitions/sqlserver.sql @@ -50,6 +50,14 @@ CREATE TABLE developers_projects ( access_level int default 1 ); +CREATE TABLE orders ( + id int NOT NULL IDENTITY(1, 1) PRIMARY KEY, + name varchar(100) default NULL, + billing_customer_id int default NULL, + shipping_customer_id int default NULL +); + + CREATE TABLE customers ( id int NOT NULL IDENTITY(1, 1) PRIMARY KEY, name varchar(100) default NULL, |