Przeglądaj źródła

Normalize syntax in example schema

David Ginzberg 7 lat temu
rodzic
commit
a71312f1e8
1 zmienionych plików z 11 dodań i 7 usunięć
  1. 11
    7
      src/main/resources/schema-h2.sql

+ 11
- 7
src/main/resources/schema-h2.sql Wyświetl plik

@@ -18,17 +18,21 @@ CREATE TABLE HOME (
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 31
   CONSTRAINT 'unique_make_model_year' UNIQUE (make, model, year)
30 32
 );
31 33
 
34
+DROP TABLE auto_prices;
35
+
32 36
 CREATE TABLE auto_prices (
33 37
   id INT PRIMARY KEY AUTO_INCREMENT,
34 38
   car_id INT REFERENCES car(id),