From a5708b4c1f137baba8510ca1e1985bd1f878604b Mon Sep 17 00:00:00 2001
From: Marcel Molina <marcel@vernix.org>
Date: Wed, 4 Jan 2006 04:17:23 +0000
Subject: Multiple enhancements and adjustments to DB2 adaptor. Closes #3377.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
---
 activerecord/test/fixtures/db_definitions/db2.sql | 200 +++++++++++-----------
 1 file changed, 100 insertions(+), 100 deletions(-)

(limited to 'activerecord/test/fixtures/db_definitions/db2.sql')

diff --git a/activerecord/test/fixtures/db_definitions/db2.sql b/activerecord/test/fixtures/db_definitions/db2.sql
index 49f31aba67..c50e7178f8 100644
--- a/activerecord/test/fixtures/db_definitions/db2.sql
+++ b/activerecord/test/fixtures/db_definitions/db2.sql
@@ -1,196 +1,196 @@
 CREATE TABLE accounts (
-  id int generated by default as identity (start with +10000),
-  firm_id int default NULL,
-  credit_limit int default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  firm_id INT DEFAULT NULL,
+  credit_limit INT DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE companies (
-  id int generated by default as identity (start with +10000),
-  type varchar(50) default NULL,
-  ruby_type varchar(50) default NULL,
-  firm_id int default NULL,
-  name varchar(50) default NULL,
-  client_of int default NULL,
-  rating int default 1,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  type VARCHAR(50) DEFAULT NULL,
+  ruby_type VARCHAR(50) DEFAULT NULL,
+  firm_id INT DEFAULT NULL,
+  name VARCHAR(50) DEFAULT NULL,
+  client_of INT DEFAULT NULL,
+  rating INT DEFAULT 1,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE topics (
-  id int generated by default as identity (start with +10000),
-  title varchar(255) default NULL,
-  author_name varchar(255) default NULL,
-  author_email_address varchar(255) default NULL,
-  written_on timestamp default NULL,
-  bonus_time time default NULL,
-  last_read date default NULL,
-  content varchar(3000),
-  approved smallint default 1,
-  replies_count int default 0,
-  parent_id int default NULL,
-  type varchar(50) default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  title VARCHAR(255) DEFAULT NULL,
+  author_name VARCHAR(255) DEFAULT NULL,
+  author_email_address VARCHAR(255) DEFAULT NULL,
+  written_on TIMESTAMP DEFAULT NULL,
+  bonus_time TIME DEFAULT NULL,
+  last_read DATE DEFAULT NULL,
+  content VARCHAR(3000),
+  approved SMALLINT DEFAULT 1,
+  replies_count INT DEFAULT 0,
+  parent_id INT DEFAULT NULL,
+  type VARCHAR(50) DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE developers (
-  id int generated by default as identity (start with +10000),
-  name varchar(100) default NULL,
-  salary int default 70000,
-  created_at timestamp default NULL,
-  updated_at timestamp default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  name VARCHAR(100) DEFAULT NULL,
+  salary INT DEFAULT 70000,
+  created_at TIMESTAMP DEFAULT NULL,
+  updated_at TIMESTAMP DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE projects (
-  id int generated by default as identity (start with +10000),
-  name varchar(100) default NULL,
-  type varchar(255) default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  name VARCHAR(100) DEFAULT NULL,
+  type VARCHAR(255) DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE developers_projects (
-  developer_id int NOT NULL,
-  project_id int NOT NULL,
-  joined_on date default NULL,
-  access_level smallint default 1
+  developer_id INT NOT NULL,
+  project_id INT NOT NULL,
+  joined_on DATE DEFAULT NULL,
+  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,
+  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,
-  balance int default 0,
-  address_street varchar(100) default NULL,
-  address_city varchar(100) default NULL,
-  address_country varchar(100) default NULL,
-  gps_location varchar(100) default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  name VARCHAR(100) DEFAULT NULL,
+  balance INT DEFAULT 0,
+  address_street VARCHAR(100) DEFAULT NULL,
+  address_city VARCHAR(100) DEFAULT NULL,
+  address_country VARCHAR(100) DEFAULT NULL,
+  gps_location VARCHAR(100) DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE movies (
-  movieid int generated by default as identity (start with +10000),
-  name varchar(100) default NULL,
+  movieid INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  name VARCHAR(100) DEFAULT NULL,
   PRIMARY KEY (movieid)
 );
 
 CREATE TABLE subscribers (
-  nick varchar(100) NOT NULL,
-  name varchar(100) default NULL,
+  nick VARCHAR(100) NOT NULL,
+  name VARCHAR(100) DEFAULT NULL,
   PRIMARY KEY (nick)
 );
 
 CREATE TABLE booleantests (
-  id int generated by default as identity (start with +10000),
-  value int default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  value INT DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE auto_id_tests (
-  auto_id int generated by default as identity (start with +10000),
-  value int default NULL,
+  auto_id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  value INT DEFAULT NULL,
   PRIMARY KEY (auto_id)
 );
 
 CREATE TABLE entrants (
-  id int NOT NULL PRIMARY KEY,
-  name varchar(255) NOT NULL,
-  course_id int NOT NULL
+  id INT NOT NULL PRIMARY KEY,
+  name VARCHAR(255) NOT NULL,
+  course_id INT NOT NULL
 );
 
 CREATE TABLE colnametests (
-  id int generated by default as identity (start with +10000),
-  references int NOT NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  references INT NOT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE mixins (
-  id int generated by default as identity (start with +10000),
-  parent_id int default NULL,
-  pos int default NULL,
-  created_at timestamp default NULL,
-  updated_at timestamp default NULL,
-  lft int default NULL,
-  rgt int default NULL,
-  root_id int default NULL,
-  type varchar(40) default NULL,
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  parent_id INT DEFAULT NULL,
+  pos INT DEFAULT NULL,
+  created_at TIMESTAMP DEFAULT NULL,
+  updated_at TIMESTAMP DEFAULT NULL,
+  lft INT DEFAULT NULL,
+  rgt INT DEFAULT NULL,
+  root_id INT DEFAULT NULL,
+  type VARCHAR(40) DEFAULT NULL,
   PRIMARY KEY (id)
 );
 
 CREATE TABLE people (
-  id int generated by default as identity (start with +10000),
-  first_name varchar(40) NOT NULL,
-  lock_version int default 0,
-  PRIMARY KEY  (id)
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  first_name VARCHAR(40) NOT NULL,
+  lock_version INT DEFAULT 0,
+  PRIMARY KEY (id)
 );
 
 CREATE TABLE binaries (
-  id int generated by default as identity (start with +10000),
-  data blob(50000),
-  PRIMARY KEY  (id)
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  data BLOB(50000),
+  PRIMARY KEY (id)
 );
 
 CREATE TABLE computers (
-  id int generated by default as identity (start with +10000),
-  developer int NOT NULL,
-  extendedWarranty int NOT NULL
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  developer INT NOT NULL,
+  extendedWarranty INT NOT NULL
 );
 
 CREATE TABLE posts (
-  id int generated by default as identity (start with +10000),
-  author_id int default NULL,
-  title varchar(255) default NULL,
-  type varchar(255) default NULL,
-  body varchar(3000) default NULL
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  author_id INT DEFAULT NULL,
+  title VARCHAR(255) DEFAULT NULL,
+  type VARCHAR(255) DEFAULT NULL,
+  body VARCHAR(3000) DEFAULT NULL
 );
 
 CREATE TABLE comments (
-  id int generated by default as identity (start with +10000),
-  post_id int default NULL,
-  type varchar(255) default NULL,
-  body varchar(3000) default NULL
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  post_id INT DEFAULT NULL,
+  type VARCHAR(255) DEFAULT NULL,
+  body VARCHAR(3000) DEFAULT NULL
 );
 
 CREATE TABLE authors (
-  id int generated by default as identity (start with +10000),
-  name varchar(255) default NULL
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  name VARCHAR(255) DEFAULT NULL
 );
 
 CREATE TABLE tasks (
-  id int generated by default as identity (start with +10000),
-  starting timestamp default NULL,
-  ending timestamp default NULL
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  starting TIMESTAMP DEFAULT NULL,
+  ending TIMESTAMP DEFAULT NULL
 );
 
 CREATE TABLE categories (
-  id int generated by default as identity (start with +10000),
-  name varchar(255) NOT NULL,
-  type varchar(40) default NULL
+  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
+  name VARCHAR(255) NOT NULL,
+  type VARCHAR(40) DEFAULT NULL
 );
 
 CREATE TABLE categories_posts (
-  category_id int NOT NULL,
-  post_id int NOT NULL
+  category_id INT NOT NULL,
+  post_id INT NOT NULL
 );
 
 CREATE TABLE keyboards (
-  key_number int generated by default as identity (start with +10000),
+  key_number INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
   name VARCHAR(255)
 );
 
 CREATE TABLE fk_test_has_pk (
-  id INTEGER NOT NULL PRIMARY KEY
+  id INT NOT NULL PRIMARY KEY
 );
 
 CREATE TABLE fk_test_has_fk (
-  id    INTEGER NOT NULL PRIMARY KEY,
-  fk_id INTEGER NOT NULL,
+  id    INT NOT NULL PRIMARY KEY,
+  fk_id INT NOT NULL,
 
   FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
 );
-- 
cgit v1.2.3

