 
 CREATE TABLE customer_order
 (
-   order_id       integer not null,
+   order_id       integer not null auto_increment,
    customer_id    integer not null,
    shipping_id    integer not null,
    timestamp      date    not null,
-   staus          varchar(255) not null,
+   status          varchar(255) not null,
    full_price     integer(11) not null,
-   FOREIGN KEY (order_id) REFERENCES ordered_products(order_id),
    FOREIGN KEY (customer_id) REFERENCES customer(customer_id),
    FOREIGN KEY (shipping_id) REFERENCES shipping(shipping_id),
-   PRIMARY KEY (order_id, customer_id, shipping_id)
+   PRIMARY KEY (order_id)
+);
+
+CREATE TABLE ordered_products
+(
+   product_id     integer not null,
+   order_id       integer not null,
+   quantity       integer not null,
+   FOREIGN KEY (product_id) REFERENCES product(product_id),
+   FOREIGN KEY (order_id) REFERENCES customer_order(order_id),
+   PRIMARY KEY (order_id, product_id)
 );
 
 CREATE TABLE settings

(2, 2, 'je to somarina', 10, '2015-09-06 07:14:31'); 







(
   product_id    integer not null auto_increment,
   name          varchar(255)  not null,
   slug          varchar(255)  not null,
   description   varchar(1000) not null,
   price         numeric(19,4) not null,
   image         varchar(255)  not null,
