PhpGt / WebEngine

Minimalistic, ergonomic PHP toolkit.
https://www.php.gt/webengine
MIT License
26 stars 6 forks source link

Auto deployment of database tables #43

Closed g105b closed 8 years ago

g105b commented 12 years ago
g105b commented 11 years ago

Example of type of reference that isn't supported yet.

# AppUser #
CREATE  TABLE IF NOT EXISTS `Nomad`.`AppUser` (
  `Id` INT NOT NULL AUTO_INCREMENT ,
  `Uuid` VARCHAR(128) NOT NULL ,
  `Fk_User` INT NULL ,
  `Dt_Created` DATETIME NOT NULL ,
  `Dt_Active` DATETIME NULL ,
  `Fk_Organisation__Selected` INT NULL ,
  PRIMARY KEY (`Id`) ,
  UNIQUE INDEX `Uuid_UNIQUE` (`Uuid` ASC) ,
  INDEX `Fk_AppUser__Organisation__Selected` (`Fk_Organisation__Selected` ASC) ,
  CONSTRAINT `Fk_AppUser__Organisation__Selected`
    FOREIGN KEY (`Fk_Organisation__Selected` )
    REFERENCES `Nomad`.`Organisation` (`Id` )
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB

# Organisation # 
CREATE  TABLE IF NOT EXISTS `Organisation` (
  `Id` INT NOT NULL AUTO_INCREMENT ,
  `Name` VARCHAR(32) NULL ,
  `Dt_Created` DATETIME NOT NULL ,
  `Dt_Deleted` DATETIME NULL ,
  PRIMARY KEY (`Id`)
)
ENGINE = InnoDB;
8w commented 11 years ago

This is what I get when first hitting a page:

[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error' in /home/jamesf/git/RoadTest/PHP.Gt/Framework/Component/DalResult.php:167, referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: Stack trace:, referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #0 /home/jamesf/git/RoadTest/PHP.Gt/Framework/Component/DalResult.php(167): PDOStatement->fetchAll(2), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #1 /home/jamesf/git/RoadTest/PHP.Gt/Framework/Component/DalResult.php(135): DalResult->storeResult(true), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #2 /home/jamesf/git/RoadTest/PageCode/_Common.php(77): DalResult->offsetGet('ID'), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #3 /home/jamesf/git/RoadTest/PageCode/_Common.php(13): _Common_PageCode->checkUser(Object(User_PageTool), Object(ApiEl), Object(Dom)), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #4 [internal function]: _Common_PageCode->go(Object(ApiWrapper), Object(Dom), Object(TemplateWrapper), Object(PageToolWrapper)), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #5 /home/jamesf/git/RoadTest/PHP.Gt/Framework/Response.php(82): call_user_func_array(Array, Array), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #6 /home/jamesf/git/RoadTest/PHP.Gt/Framework/Dispatcher.php(81): Response->dispatch('go', Object(ApiWrapper), Object(Dom), Object(TemplateWrapper), Object(PageToolWrapper)), referer: http://localhost/Gt.html?DbDeploy=/Start.html
[Wed Jan 30 09:55:49 2013] [warn] [client 127.0.0.1] mod_fcgid: stderr: #7 /home/jamesf/git/RoadTest/PHP. in /home/jamesf/git/RoadTest/PHP.Gt/Framework/Component/DalResult.php on line 167, referer: http://localhost/Gt.html?DbDeploy=/Start.html
g105b commented 8 years ago

Composer dependency handles this now. Not the responsibility of PHP.Gt.