add the identity property to all the primary keys

This commit is contained in:
Andreas Zweili 2017-07-09 18:57:47 +02:00
parent 7db40baaaa
commit 48c795939c
1 changed files with 14 additions and 14 deletions

View File

@ -11,7 +11,7 @@
use marketdb;
if not exists (select * from sysobjects where name='commercials')
CREATE TABLE commercials (
commercial_id int not null,
commercial_id int identity not null,
date_since_last_change date not null,
member_id int not null,
constraint commercial_pk primary key (commercial_id)
@ -20,7 +20,7 @@ if not exists (select * from sysobjects where name='commercials')
use marketdb;
if not exists (select * from sysobjects where name='member_status')
CREATE TABLE member_status (
member_status_id int not null,
member_status_id int identity not null,
status_name varchar(50) not null,
constraint member_status_pk primary key (member_status_id)
);
@ -28,7 +28,7 @@ if not exists (select * from sysobjects where name='member_status')
use marketdb;
if not exists (select * from sysobjects where name='salutations')
CREATE TABLE salutations (
salutation_id int not null,
salutation_id int identity not null,
salutation_name varchar(50) not null,
constraint salutation_pk primary key (salutation_id)
);
@ -36,7 +36,7 @@ if not exists (select * from sysobjects where name='salutations')
use marketdb;
if not exists (select * from sysobjects where name='subscriptions')
CREATE TABLE subscriptions (
subscription_id int not null,
subscription_id int identity not null,
max_rented_locations int not null,
subscription_price money not null,
subscription_name varchar(50) not null,
@ -47,7 +47,7 @@ if not exists (select * from sysobjects where name='subscriptions')
use marketdb;
if not exists (select * from sysobjects where name='subscption_orders')
CREATE TABLE subscption_orders (
subscription_order_id int not null,
subscription_order_id int identity not null,
running_subscription bit,
subscription_order_date date not null,
subscription_id int not null,
@ -59,7 +59,7 @@ if not exists (select * from sysobjects where name='subscption_orders')
use marketdb;
if not exists (select * from sysobjects where name='members')
CREATE TABLE members (
member_id int not null,
member_id int identity not null,
email_address varchar(50) not null,
password varchar(50) not null,
member_status_id int not null,
@ -72,7 +72,7 @@ if not exists (select * from sysobjects where name='members')
use marketdb;
if not exists (select * from sysobjects where name='persons')
CREATE TABLE persons (
person_id int not null,
person_id int identity not null,
salutation_id int not null,
firstname varchar(50) not null,
lastname varchar(50) not null,
@ -87,7 +87,7 @@ if not exists (select * from sysobjects where name='persons')
use marketdb;
if not exists (select * from sysobjects where name='trial_periods')
CREATE TABLE trial_periods (
trial_period_id int not null,
trial_period_id int identity not null,
duration_in_seconds int not null,
constraint trial_period_pk primary key (trial_period_id)
);
@ -95,7 +95,7 @@ if not exists (select * from sysobjects where name='trial_periods')
use marketdb;
if not exists (select * from sysobjects where name='quality_checks')
CREATE TABLE quality_checks (
quality_check_id int not null,
quality_check_id int identity not null,
check_passed bit,
due_date date not null,
checking_member_id int not null,
@ -106,7 +106,7 @@ if not exists (select * from sysobjects where name='quality_checks')
use marketdb;
if not exists (select * from sysobjects where name='cities')
CREATE TABLE cities (
city_id int not null,
city_id int identity not null,
city_name varchar(50) not null,
zip_code int not null,
constraint city_pk primary key (city_id)
@ -115,7 +115,7 @@ if not exists (select * from sysobjects where name='cities')
use marketdb;
if not exists (select * from sysobjects where name='countries')
CREATE TABLE countries (
country_id int not null,
country_id int identity not null,
country_name varchar(50) not null,
constraint country_pk primary key (country_id)
);
@ -123,7 +123,7 @@ if not exists (select * from sysobjects where name='countries')
use marketdb;
if not exists (select * from sysobjects where name='rents')
CREATE TABLE rents (
rent_id int not null,
rent_id int identity not null,
rent_date date not null,
payment_date date not null,
member_id int not null,
@ -134,7 +134,7 @@ if not exists (select * from sysobjects where name='rents')
use marketdb;
if not exists (select * from sysobjects where name='locations')
CREATE TABLE locations (
location_id int not null,
location_id int identity not null,
streetname varchar(50) not null,
location_capacity int not null,
location_name varchar(50) not null,
@ -146,7 +146,7 @@ if not exists (select * from sysobjects where name='locations')
use marketdb;
if not exists (select * from sysobjects where name='rent_prices')
CREATE TABLE rent_prices (
rent_price_id int not null,
rent_price_id int identity not null,
location_id int not null,
rent_price money not null,
constraint rent_price_pk primary key (rent_price_id)