Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pls guide me with this error .... follwing are the error details.
- When run this url "http://localhost/ci_doctrine/doctrine_tools/create_tables"
- The errors i am getting is
- "( ! ) Fatal error: Uncaught exception 'Doctrine_Export_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'ph_user' doesn't exist in table. Failing Query: CREATE TABLE phone (id INT UNSIGNED NOT NULL AUTO_INCREMENT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX ph_user_idx (ph_user), INDEX ph_type_idx (ph_type), PRIMARY KEY(id)) ENGINE = INNODB' in C:\xampp\htdocs\ci_doctrine\application\plugins\doctrine\lib\Doctrine\Export.php on line 1210"
- ( ! ) Doctrine_Export_Exception: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'ph_user' doesn't exist in table. Failing Query: CREATE TABLE phone (id INT UNSIGNED NOT NULL AUTO_INCREMENT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX ph_user_idx (ph_user), INDEX ph_type_idx (ph_type), PRIMARY KEY(id)) ENGINE = INNODB in C:\xampp\htdocs\ci_doctrine\application\plugins\doctrine\lib\Doctrine\Export.php on line 1210
- Follwing are the files
- country.php
- <?php
- class Country extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('c_name', 'string', 100);
- $this->hasColumn('c_idd','integer');
- $this->hasColumn('c_cc','integer');
- $this->hasColumn('c_details', 'string', 5000);
- }
- public function setUp()
- {
- $this->setTableName('country');
- $this->actAs('Timestampable');
- $this->hasMany('State as State', array(
- 'local' => 'id',
- 'foreign' => 'c_id'
- )
- );
- }
- }
- ?>
- state.php
- <?php
- class State extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('c_id', 'integer',4);
- $this->hasColumn('s_name', 'string', 100);
- $this->hasColumn('s_details', 'string', 5000);
- }
- public function setUp()
- {
- $this->setTableName('state');
- $this->actAs('Timestampable');
- $this->hasOne('Country as Country', array(
- 'local' => 'c_id',
- 'foreign' => 'id'
- )
- );
- $this->hasMany('Destination as Destination', array(
- 'local' => 'id',
- 'foreign' => 's_id'
- )
- );
- }
- }
- ?>
- destination.php
- <?php
- class Destination extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('s_id', 'integer',4);
- $this->hasColumn('d_name', 'string', 100);
- $this->hasColumn('d_std','integer');
- $this->hasColumn('d_details', 'string', 5000);
- }
- public function setUp()
- {
- $this->setTableName('destination');
- $this->actAs('Timestampable');
- $this->hasOne('State as State', array(
- 'local' => 's_id',
- 'foreign' => 'id'
- )
- );
- $this->hasMany('Area as Area',array(
- 'local' => 'id',
- 'foreign' => 'd_id',
- )
- );
- $this->hasMany('Pic as Pic',array(
- 'local' => 'id',
- 'foreign' => 'd_id',
- )
- );
- $this->hasMany('Tourpackage as Tourpackage',array(
- 'local' => 'id',
- 'foreign' => 'tp_startplace',
- )
- );
- $this->hasMany('Tourpackage as Tourpackage',array(
- 'local' => 'id',
- 'foreign' => 'tp_endplace',
- )
- );
- }
- }
- ?>
- area.php
- <?php
- class Area extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('d_id', 'integer',4);
- $this->hasColumn('a_name', 'string', 100);
- $this->hasColumn('a_pin','integer');
- $this->hasColumn('a_details', 'string', 5000);
- }
- public function setUp()
- {
- $this->setTableName('area');
- $this->actAs('Timestampable');
- $this->hasOne('Destination as Destination', array(
- 'local' => 'd_id',
- 'foreign' => 'id'
- )
- );
- $this->hasmany('Address as Address',array(
- 'local' => 'id',
- 'foreign' => 'adr_area',
- ));
- }
- }
- ?>
- address.php
- <?php
- class Address extends Doctrine_record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('adr_user','integer',4);
- $this->hasColumn('adr_firstline','string',1000);
- $this->hasColumn('adr_secondline','string',1000);
- $this->hasColumn('adr_area','integer',4);
- }
- public function setUp()
- {
- $this->setTableName('address');
- $this->actAs('Timestampable');
- $this->hasOne('Users as Users',array(
- 'local' => 'adr_user',
- 'foreign' => 'id',
- )
- );
- $this->hasOne('Area as Area',array(
- 'local' => 'adr_area',
- 'foreign' => 'id',
- ));
- }
- }
- ?>
- users.php
- <?php
- class Users extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('u_username', 'string',100);
- $this->hasColumn('u_pass','string',100);
- $this->hasColumn('u_regtype','integer',4);
- $this->hasColumn('u_access','integer',4);
- $this->hasColumn('u_name','string',100);
- $this->hasColumn('u_pic','string',1000);
- $this->hasColumn('u_company','integer',4);
- $this->hasColumn('u_details', 'string',5000);
- }
- public function setUp()
- {
- $this->setTableName('users');
- $this->actAs('Timestampable');
- $this->hasOne('Regtype as Regtype',array(
- 'local' => 'u_regtype',
- 'foreign' => 'id',
- ));
- $this->hasOne('Useraccess as Useraccess',array(
- 'local' => 'u_access',
- 'foreign' => 'id',
- ));
- $this->hasMany('Address as Address',array(
- 'local' => 'id',
- 'foreign' => 'adr_user',
- ));
- $this->hasMany('Phone as Phone',array(
- 'local' => 'id',
- 'foreign' => 'ph_user',
- ));
- /*$this->hasMany('Website as Website',array(
- 'local' => 'id',
- 'foreign' => 'webs_user',
- ));
- $this->hasMany('Skype as Skype',array(
- 'local' => 'id',
- 'foreign' => 'skype_user',
- ));
- $this->hasMany('Invoice as Invoice',array(
- 'local' => 'id',
- 'foreign' => 'inv_user',
- ));
- $this->hasMany('Enquiry as Enquiry',array(
- 'local' => 'id',
- 'foreign' => 'enquiry_user',
- ));
- $this->hasmany('Users as Users',array(
- 'local' => 'id',
- 'foreign' => 'u_company',
- ));
- $this->hasOne('Users as Users',array(
- 'local' => 'u_company',
- 'foreign' => 'id',
- ));*/
- }
- }
- ?>
- useraccess.php
- <?php
- class Useraccess extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('ua_name', 'string',100);
- $this->hasColumn('ua_details', 'string',5000);
- }
- public function setUp()
- {
- $this->setTableName('useraccess');
- $this->actAs('Timestampable');
- $this->hasMany('Users as Users',array(
- 'local' => 'id',
- 'foreign' => 'u_access',
- ));
- }
- }
- ?>
- tourpackagecost.php
- <?php
- class Tourpackagecost extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('tp_id','integer',4);
- $this->hasColumn('tpcost_perperson','float');
- $this->hasColumn('tpcost_percouple','float');
- $this->hasColumn('tpcost_extraadult','float' );
- $this->hasColumn('tpcost_extrachild', 'float');
- $this->hasColumn('tpcost_conditions', 'string',1000);
- }
- public function setUp()
- {
- $this->setTableName('tourpackagecost');
- $this->actAs('Timestampable');
- $this->hasOne('Tourpackage as Tourpackage',array(
- 'local' => 'tp_id',
- 'foreign' => 'id',
- )
- );
- }
- }
- ?>
- tourpackage.php
- <?php
- class Tourpackage extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('tp_name', 'string', 100);
- $this->hasColumn('tp_startplace','integer',4);
- $this->hasColumn('tp_endplace','integer',4);
- $this->hasColumn('tp_enroute', 'string',1000);
- $this->hasColumn('tp_days', 'integer');
- $this->hasColumn('tp_nights', 'integer');
- $this->hasColumn('tp_details', 'string',5000);
- }
- public function setUp()
- {
- $this->setTableName('tourpackage');
- $this->actAs('Timestampable');
- $this->hasOne('Destination as Destination',array(
- 'local' => 'tp_startplace',
- 'foreign' => 'id',
- )
- );
- $this->hasOne('Destination as Destination',array(
- 'local' => 'tp_endplace',
- 'foreign' => 'id',
- )
- );
- $this->hasMany('Tourpackagecost as Tourpackagecost',array(
- 'local' => 'id',
- 'foreign' => 'tp_id'
- )
- );
- /*$this->hasMany('Packagetype as Packagetype',array(
- 'local' => 'id',
- 'foreign' => 'tp_id',
- )
- );
- $this->hasMany('Packagehighlight as Packagehighlight',array(
- 'local' => 'id',
- 'foreign' => 'tp_id',
- )
- );*/
- }
- }
- ?>
- touristspot.php
- <?php
- class Touristspot extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('a_id', 'integer',4);
- $this->hasColumn('ts_name', 'string', 100);
- $this->hasColumn('a_details', 'string', 5000);
- }
- public function setUp()
- {
- $this->setTableName('touristspot');
- $this->actAs('Timestampable');
- $this->hasOne('Area as Area', array(
- 'local' => 'a_id',
- 'foreign' => 'id'
- )
- );
- $this->hasMany('Pic as Pic',array(
- 'local' => 'id',
- 'foreign' => 'ts_id',
- )
- );
- }
- }
- ?>
- regtype.php
- <?php
- class Regtype extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('rgt_name', 'string',100);
- $this->hasColumn('rgt_details','string',5000);
- }
- public function setUp()
- {
- $this->setTableName('regtype');
- $this->actAs('Timestampable');
- $this->hasMany('Users as Users',array(
- 'local' => 'id',
- 'foreign' => 'u_regtype',
- ));
- }
- }
- ?>
- pic.php
- <?php
- class Pic extends Doctrine_Record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('d_id', 'integer',4);
- $this->hasColumn('ts_id', 'integer',4);
- $this->hasColumn('pic_name', 'string', 100);
- $this->hasColumn('pic_path','string',100);
- $this->hasColumn('pic_details', 'string', 5000);
- }
- public function setUp()
- {
- $this->setTableName('pic');
- $this->actAs('Timestampable');
- $this->hasOne('Destination as Destination', array(
- 'local' => 'd_id',
- 'foreign' => 'id'
- )
- );
- $this->hasOne('Touristspot as Touristspot',array(
- 'local' => 'ts_id',
- 'foreign' => 'id'
- )
- );
- }
- }
- ?>
- phonetype.php
- <?php
- class Phonetype extends Doctrine_record
- {
- public function setTableDefinition()
- {
- $this->hasColumn('pt_name','string',100);
- $this->hasColumn('pt_details','string',5000);
- }
- public function setUp()
- {
- $this->setTableName('phonetype');
- $this->actAs('Timestampable');
- $this->hasMany('Phone as Phone',array(
- 'local' => 'id',
- 'foreign' => 'ph_type',
- ));
- }
- }
- ?>
- phone.php
- <?php
- class Phone extends Doctrine_record
- {
- public function setTableDefination()
- {
- $this->hasColumn('ph_user','integer',4);
- $this->hasColumn('ph_type','integer',4);
- $this->hasColumn('ph_num','integer');
- }
- public function setUp()
- {
- $this->setTableName('phone');
- $this->actAs('Timestampable');
- $this->hasOne('Users as Users',array(
- 'local' => 'ph_user',
- 'foreign' => 'id',
- ));
- $this->hasOne('Phonetype as Phonetype',array(
- 'local' => 'ph_type',
- 'foreign' => 'id',
- ));
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement