CREATE TABLE tx_post (id INT AUTO_INCREMENT NOT NULL, tx_usr_id INT DEFAULT NULL, pst_status TINYINT(1) DEFAULT NULL, pst_created_at DATETIME DEFAULT NULL, pst_updated_at DATETIME DEFAULT NULL, INDEX IDX_A3B74F615CC5E754 (tx_usr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE tx_post_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, pst_title VARCHAR(255) NOT NULL, pst_content LONGTEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_AD9014B62C2AC5D3 (translatable_id), UNIQUE INDEX tx_post_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE tx_post ADD CONSTRAINT FK_A3B74F615CC5E754 FOREIGN KEY (tx_usr_id) REFERENCES tx_user (id) ON DELETE CASCADE;
ALTER TABLE tx_post_translation ADD CONSTRAINT FK_AD9014B62C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES tx_post (id) ON DELETE CASCADE;