Skip to content

Instantly share code, notes, and snippets.

@diegoicosta
Last active July 11, 2017 12:55
Show Gist options
  • Save diegoicosta/c2ad798dca39b83c81fc44dec8a6422e to your computer and use it in GitHub Desktop.
Save diegoicosta/c2ad798dca39b83c81fc44dec8a6422e to your computer and use it in GitHub Desktop.
create database mini-paycom;
CREATE TABLE mini-paycom.order (
id INT AUTO_INCREMENT NOT NULL,
customer VARCHAR(100) NOT NULL,
amount INT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE TABLE mini-paycom.payment (
id INT AUTO_INCREMENT NOT NULL,
order_id INT NOT NULL,
method VARCHAR(15) NOT NULL,
amount INT NOT NULL,
tax INT NOT NULL,
status SMALLINT(1) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment