Thanks. I had mislabeled my code snippets.
In attempting to call "repair database" from the admin section I get an odd error:
Code:
Error creating table: repair_table: Query Failed:CREATE TABLE repair_table (id varchar(36) DEFAULT '' NOT NULL ,song_id varchar(36) DEFAULT '' NULL ,account_id varchar(36) DEFAULT '' NULL ,deleted bool DEFAULT '0' NOT NULL , NULL , NULL ) CHARACTER SET utf8 COLLATE utf8_general_ci::MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL , NULL ) CHARACTER SET utf8 COLLATE utf8_general_ci' at line 1
I have looked over my metadata and vardefs code carefully and I can't see why the repair directive wouldn't recognize the table name correctly.
Code:
$dictionary['accounts_songs'] = array (
'table' => 'accounts_songs'
,
'fields' => array (
array('name' =>'id', 'type' => 'varchar', 'default' => '', 'len'=>'36')
, array('name' =>'song_id', 'type' => 'varchar', 'default' => '', 'len'=>'36')
, array('name' =>'account_id', 'type' => 'varchar', 'default' => '', 'len'=>'36')
, array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'required'=>true, 'default'=>'0')
, 'indices' => array (
array('name' =>'primary', 'type' =>'primary', 'fields'=>array('id'))
)
, 'relationships' => array(
'accounts_songs' => array(
'lhs_module'=> 'Accounts',
'lhs_table'=> 'accounts',
'lhs_key' => 'id',
'rhs_module'=> 'Songs',
'rhs_table'=> 'songs',
'rhs_key' => 'id',
'join_table'=> 'accounts_songs',
'join_key_lhs'=>'account_id',
'join_key_rhs'=>'song_id',
'relationship_type'=>'many-to-many'
)
)
)
) Thanks, Dave
Bookmarks