prefix.DB::$namespace.'_table_ttag'; } public function __construct() { parent::__construct(); $this->table_name = $this->prefix.'_table_ttag'; $this->primary_key = 'id'; $this->version = '1.0'; } public function sql_create() { return "CREATE TABLE {$this->table_name} ( id bigint(20) NOT NULL AUTO_INCREMENT, table_id bigint(20) DEFAULT NULL, ttag_id bigint(20) NOT NULL, PRIMARY KEY (id), KEY `tablettag_table_id_foreign` (`table_id`), CONSTRAINT `tablettag_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `{$this->prefix}_tables` (`id`) ON DELETE CASCADE, KEY `tablettag_ttag_id_foreign` (`ttag_id`), CONSTRAINT `tablettag_ttag_id_foreign` FOREIGN KEY (`ttag_id`) REFERENCES `{$this->prefix}_ttags` (`id`) ON DELETE CASCADE )"; } } SRR_DB_Table_Ttag::init();