--liquibase formatted sql

--changeset mark.gidman:978cd0ed-edf3-43a6-9f57-a5ffcb6cc154
CREATE TABLE api_token (
	id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
	name varchar(200) NOT NULL DEFAULT '',
	token varchar(1200) NOT NULL DEFAULT '',
	created_on datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
	updated_on datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	created_by int(11) UNSIGNED NOT NULL,
	updated_by int(11) UNSIGNED NOT NULL,
	is_deleted tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
	account_id int(11) UNSIGNED NOT NULL,
	account_role tinyint(4) UNSIGNED NOT NULL DEFAULT 0,
	PRIMARY KEY (id),
	KEY fk_api_token_account_id (account_id),
	CONSTRAINT fk_api_token_account_id FOREIGN KEY (account_id) REFERENCES account (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Provides support for system authentication.';
--rollback drop table api_token;
