Browse Source

Normalize syntax in example schema

David Ginzberg 7 years ago
parent
commit
a71312f1e8
1 changed files with 11 additions and 7 deletions
  1. 11
    7
      src/main/resources/schema-h2.sql

+ 11
- 7
src/main/resources/schema-h2.sql View File

18
 );
18
 );
19
 
19
 
20
 
20
 
21
-DROP TABLE CAR;
21
+-- Tables for in-class example
22
 
22
 
23
-CREATE TABLE CAR (
24
-  ID INT NOT NULL AUTO_INCREMENT,
25
-  MAKE VARCHAR2(255) not null default '',
26
-  MODEL varchar2(255) NOT NULL DEFAULT '',
27
-  YEAR VARCHAR2(5) NOT NULL DEFAULT '01907',
28
-  PRIMARY KEY (ID),
23
+DROP TABLE cars;
24
+
25
+CREATE TABLE cars (
26
+  id INT NOT NULL AUTO_INCREMENT,
27
+  make VARCHAR2(50) NOT NULL DEFAULT '',
28
+  model VARCHAR2(50) NOT NULL DEFAULT '',
29
+  year VARCHAR2(5) NOT NULL DEFAULT '01907',
30
+  PRIMARY KEY (id),
29
   CONSTRAINT 'unique_make_model_year' UNIQUE (make, model, year)
31
   CONSTRAINT 'unique_make_model_year' UNIQUE (make, model, year)
30
 );
32
 );
31
 
33
 
34
+DROP TABLE auto_prices;
35
+
32
 CREATE TABLE auto_prices (
36
 CREATE TABLE auto_prices (
33
   id INT PRIMARY KEY AUTO_INCREMENT,
37
   id INT PRIMARY KEY AUTO_INCREMENT,
34
   car_id INT REFERENCES car(id),
38
   car_id INT REFERENCES car(id),