/** * @param Schema $Schema * * @return Table */ private function setTestPicture(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblTestPicture'); if (!$this->Connection->hasColumn('tblTestPicture', 'Name')) { $Table->addColumn('Name', 'string'); } if (!$this->Connection->hasColumn('tblTestPicture', 'FileName')) { $Table->addColumn('FileName', 'string'); } if (!$this->Connection->hasColumn('tblTestPicture', 'Extension')) { $Table->addColumn('Extension', 'string'); } if (!$this->Connection->hasColumn('tblTestPicture', 'ImgData')) { $Table->addColumn('ImgData', 'blob'); } if (!$this->Connection->hasColumn('tblTestPicture', 'ImgType')) { $Table->addColumn('ImgType', 'string'); } if (!$this->Connection->hasColumn('tblTestPicture', 'Size')) { $Table->addColumn('Size', 'integer'); } if (!$this->Connection->hasColumn('tblTestPicture', 'Width')) { $Table->addColumn('Width', 'integer'); } if (!$this->Connection->hasColumn('tblTestPicture', 'Height')) { $Table->addColumn('Height', 'integer'); } return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableResponsibility(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblResponsibility'); if (!$this->Connection->hasColumn('tblResponsibility', 'serviceTblCompany')) { $Table->addColumn('serviceTblCompany', 'bigint'); } return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableCompany(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblCompany'); if (!$this->Connection->hasColumn('tblCompany', 'Name')) { $Table->addColumn('Name', 'string'); } return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableSponsorAssociation(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblSponsorAssociation'); if (!$this->Connection->hasColumn('tblSponsorAssociation', 'serviceTblCompany')) { $Table->addColumn('serviceTblCompany', 'bigint'); } return $Table; }
/** * @param Schema $Schema * @param Table $tblGroup * * @return Table */ private function setTableMember(Schema &$Schema, Table $tblGroup) { $Table = $this->Connection->createTable($Schema, 'tblMember'); if (!$this->Connection->hasColumn('tblMember', 'serviceTblCompany')) { $Table->addColumn('serviceTblCompany', 'bigint', array('notnull' => false)); } $this->Connection->addForeignKey($Table, $tblGroup); return $Table; }
/** * @param Schema $Schema * @param $tblType * * @return Table */ private function setTableSchool(Schema &$Schema, $tblType) { $Table = $this->Connection->createTable($Schema, 'tblSchool'); if (!$this->Connection->hasColumn('tblSchool', 'serviceTblCompany')) { $Table->addColumn('serviceTblCompany', 'bigint'); } $this->Connection->addForeignKey($Table, $tblType); return $Table; }
/** * @param Schema $Schema * @param Table $tblItem * * @return Table */ private function setTableItemAccount(Schema &$Schema, Table $tblItem) { $Table = $this->Connection->createTable($Schema, 'tblItemAccount'); if (!$this->Connection->hasColumn('tblItemAccount', 'serviceBilling_Account')) { $Table->addColumn('serviceBilling_Account', 'bigint'); } $this->Connection->addForeignKey($Table, $tblItem); return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableScoreTypes(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblScoreType'); if (!$this->Connection->hasColumn('tblScoreType', 'Name')) { $Table->addColumn('Name', 'string'); } if (!$this->Connection->hasColumn('tblScoreType', 'Short')) { $Table->addColumn('Short', 'string'); } return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableType(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblType'); if (!$this->Connection->hasColumn('tblType', 'Name')) { $Table->addColumn('Name', 'string'); } if (!$this->Connection->hasColumn('tblType', 'Description')) { $Table->addColumn('Description', 'string'); } return $Table; }
/** * @param Schema $Schema * @param Table $tblBalance * * @return Table */ private function setTablePayment(Schema &$Schema, Table $tblBalance) { $Table = $this->Connection->createTable($Schema, 'tblPayment'); if (!$this->Connection->hasColumn('tblPayment', 'Value')) { $Table->addColumn('Value', 'decimal', array('precision' => 14, 'scale' => 4)); } if (!$this->Connection->hasColumn('tblPayment', 'Date')) { $Table->addColumn('Date', 'date'); } $this->Connection->addForeignKey($Table, $tblBalance); return $Table; }
/** * @param bool $Simulate * * @return string */ public function setupDatabaseSchema($Simulate = true) { /** * Table */ $Schema = clone $this->Connection->getSchema(); /** * Migration & Protocol */ $this->Connection->addProtocol(__CLASS__); $this->Connection->setMigration($Schema, $Simulate); return $this->Connection->getProtocol($Simulate); }
/** * @param Schema $Schema * * @return Table */ private function setTableConsumer(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblConsumer'); if (!$this->Connection->hasColumn('tblConsumer', 'Acronym')) { $Table->addColumn('Acronym', 'string'); } if (!$this->Connection->hasIndex($Table, array('Acronym'))) { $Table->addUniqueIndex(array('Acronym')); } if (!$this->Connection->hasColumn('tblConsumer', 'Name')) { $Table->addColumn('Name', 'string'); } return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableCommodityItem(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblCommodityItem'); if (!$this->Connection->hasColumn('tblCommodityItem', 'Quantity')) { $Table->addColumn('Quantity', 'decimal', array('precision' => 14, 'scale' => 4)); } if (!$this->Connection->hasColumn('tblCommodityItem', 'tblItem')) { $Table->addColumn('tblItem', 'bigint'); } if (!$this->Connection->hasColumn('tblCommodityItem', 'tblCommodity')) { $Table->addColumn('tblCommodity', 'bigint'); } return $Table; }
/** * @param Schema $Schema * @param Table $tblCategory * @param Table $tblSubject * * @return Table */ private function setTableCategorySubject(Schema &$Schema, Table $tblCategory, Table $tblSubject) { $Table = $this->Connection->createTable($Schema, 'tblCategorySubject'); $this->Connection->addForeignKey($Table, $tblCategory); $this->Connection->addForeignKey($Table, $tblSubject); return $Table; }
/** * @param Schema $Schema * @param Table $tblRole * @param Table $tblLevel * * @return Table */ private function setTableRoleLevel(Schema &$Schema, Table $tblRole, Table $tblLevel) { $Table = $this->Connection->createTable($Schema, 'tblRoleLevel'); $this->Connection->addForeignKey($Table, $tblRole); $this->Connection->addForeignKey($Table, $tblLevel); return $Table; }
/** * @param Schema $Schema * * @param Table $tblAccount * @param Table $tblIdentification * * @return Table */ private function setTableAuthentication(Schema &$Schema, Table $tblAccount, Table $tblIdentification) { $Table = $this->Connection->createTable($Schema, 'tblAuthentication'); $this->Connection->addForeignKey($Table, $tblAccount); $this->Connection->addForeignKey($Table, $tblIdentification); return $Table; }
/** * @param Schema $Schema * @param Table $tblTempInvoice * * @return Table */ private function setTableTempInvoiceCommodity(Schema &$Schema, Table $tblTempInvoice) { $Table = $this->Connection->createTable($Schema, 'tblTempInvoiceCommodity'); if (!$this->Connection->hasColumn('tblTempInvoiceCommodity', 'serviceBilling_Commodity')) { $Table->addColumn('serviceBilling_Commodity', 'bigint'); } $this->Connection->addForeignKey($Table, $tblTempInvoice); return $Table; }
/** * @param Schema $Schema * @param Table $tblAccount * * @return Table */ private function setTableUser(Schema &$Schema, Table $tblAccount) { $Table = $this->Connection->createTable($Schema, 'tblUser'); if (!$this->Connection->hasColumn('tblUser', 'serviceTblPerson')) { $Table->addColumn('serviceTblPerson', 'bigint', array('notnull' => false)); } $this->Connection->addForeignKey($Table, $tblAccount); return $Table; }
/** * @param Schema $Schema * @param Table $tblBasketCommodity * * @return Table */ private function setTableBasketCommodityDebtor(Schema &$Schema, Table $tblBasketCommodity) { $Table = $this->Connection->createTable($Schema, 'tblBasketCommodityDebtor'); if (!$this->Connection->hasColumn('tblBasketCommodityDebtor', 'serviceBilling_Debtor')) { $Table->addColumn('serviceBilling_Debtor', 'bigint'); } $this->Connection->addForeignKey($Table, $tblBasketCommodity); return $Table; }
/** * @param Schema $Schema * @param Table $tblStudentMedicalRecord * @param Table $tblStudentTransport * @param Table $tblStudentTransfer * * @return Table */ private function setTableStudent(Schema &$Schema, Table $tblStudentMedicalRecord, Table $tblStudentTransport, Table $tblStudentTransfer) { $Table = $this->Connection->createTable($Schema, 'tblStudent'); if (!$this->Connection->hasColumn('tblStudent', 'serviceTblPerson')) { $Table->addColumn('serviceTblPerson', 'bigint', array('notnull' => false)); } $this->Connection->addForeignKey($Table, $tblStudentMedicalRecord); $this->Connection->addForeignKey($Table, $tblStudentTransport); $this->Connection->addForeignKey($Table, $tblStudentTransfer); return $Table; }
/** * @param Schema $Schema * @param Table $tblCommonBirthDates * @param Table $tblCommonInformation * * @return Table */ private function setTableCommon(Schema &$Schema, Table $tblCommonBirthDates, Table $tblCommonInformation) { $Table = $this->Connection->createTable($Schema, 'tblCommon'); if (!$this->Connection->hasColumn('tblCommon', 'serviceTblPerson')) { $Table->addColumn('serviceTblPerson', 'bigint', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblCommon', 'Remark')) { $Table->addColumn('Remark', 'text'); } $this->Connection->addForeignKey($Table, $tblCommonBirthDates); $this->Connection->addForeignKey($Table, $tblCommonInformation); return $Table; }
/** * @param Schema $Schema * @param Table $tblAddress * @param Table $tblType * * @return Table */ private function setTableToCompany(Schema &$Schema, Table $tblAddress, Table $tblType) { $Table = $this->Connection->createTable($Schema, 'tblToCompany'); if (!$this->Connection->hasColumn('tblToCompany', 'Remark')) { $Table->addColumn('Remark', 'text'); } if (!$this->Connection->hasColumn('tblToCompany', 'serviceTblCompany')) { $Table->addColumn('serviceTblCompany', 'bigint', array('notnull' => false)); } $this->Connection->addForeignKey($Table, $tblAddress); $this->Connection->addForeignKey($Table, $tblType); return $Table; }
/** * @param Schema $Schema * @param Table $tblProspectAppointment * @param Table $tblProspectReservation * * @return Table */ private function setTableProspect(Schema &$Schema, Table $tblProspectAppointment, Table $tblProspectReservation) { $Table = $this->Connection->createTable($Schema, 'tblProspect'); if (!$this->Connection->hasColumn('tblProspect', 'serviceTblPerson')) { $Table->addColumn('serviceTblPerson', 'bigint', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblProspect', 'Remark')) { $Table->addColumn('Remark', 'text'); } $this->Connection->addForeignKey($Table, $tblProspectAppointment); $this->Connection->addForeignKey($Table, $tblProspectReservation); return $Table; }
/** * @param Schema $Schema * @param Table $tblAccountType * @param Table $tblAccountKey * * @return Table */ private function setTableAccount(Schema &$Schema, Table $tblAccountType, Table $tblAccountKey) { $Table = $this->Connection->createTable($Schema, 'tblAccount'); if (!$this->Connection->hasColumn('tblAccount', 'Number')) { $Table->addColumn('Number', 'string'); } if (!$this->Connection->hasColumn('tblAccount', 'Description')) { $Table->addColumn('Description', 'string'); } if (!$this->Connection->hasColumn('tblAccount', 'IsActive')) { $Table->addColumn('IsActive', 'boolean'); } $this->Connection->addForeignKey($Table, $tblAccountType); $this->Connection->addForeignKey($Table, $tblAccountKey); return $Table; }
/** * @param Schema $Schema * @param Table $tblDebtor * * @return Table */ private function setTableReference(Schema &$Schema, Table $tblDebtor) { $Table = $this->Connection->createTable($Schema, 'tblReference'); if (!$this->Connection->hasColumn('tblReference', 'Reference')) { $Table->addColumn('Reference', 'string'); } if (!$this->Connection->hasColumn('tblReference', 'isVoid')) { $Table->addColumn('isVoid', 'boolean'); } if (!$this->Connection->hasColumn('tblReference', 'ReferenceDate')) { $Table->addColumn('ReferenceDate', 'date', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblReference', 'serviceBilling_Commodity')) { $Table->addColumn('serviceBilling_Commodity', 'bigint'); } $this->Connection->addForeignKey($Table, $tblDebtor); return $Table; }
/** * @param Schema $Schema * @param Table $tblSalutation * * @return Table */ private function setTablePerson(Schema &$Schema, Table $tblSalutation) { $Table = $this->Connection->createTable($Schema, 'tblPerson'); if (!$this->Connection->hasColumn('tblPerson', 'Title')) { $Table->addColumn('Title', 'string'); } if (!$this->Connection->hasColumn('tblPerson', 'FirstName')) { $Table->addColumn('FirstName', 'string'); } if (!$this->Connection->hasColumn('tblPerson', 'SecondName')) { $Table->addColumn('SecondName', 'string'); } if (!$this->Connection->hasColumn('tblPerson', 'LastName')) { $Table->addColumn('LastName', 'string'); } $this->Connection->addForeignKey($Table, $tblSalutation); return $Table; }
/** * @param Schema $Schema * @param Table $tblAccountKeyType * * @return Table */ private function setTableAccountKey(Schema &$Schema, Table $tblAccountKeyType) { $Table = $this->Connection->createTable($Schema, 'tblAccountKey'); if (!$this->Connection->hasColumn('tblAccountKey', 'ValidFrom')) { $Table->addColumn('ValidFrom', 'date'); } if (!$this->Connection->hasColumn('tblAccountKey', 'Value')) { $Table->addColumn('Value', 'string'); } if (!$this->Connection->hasColumn('tblAccountKey', 'ValidTo')) { $Table->addColumn('ValidTo', 'date'); } if (!$this->Connection->hasColumn('tblAccountKey', 'Description')) { $Table->addColumn('Description', 'string'); } if (!$this->Connection->hasColumn('tblAccountKey', 'Code')) { $Table->addColumn('Code', 'integer'); } $this->Connection->addForeignKey($Table, $tblAccountKeyType); return $Table; }
/** * @param Schema $Schema * * @return Table */ private function setTableCustody(Schema &$Schema) { $Table = $this->Connection->createTable($Schema, 'tblCustody'); if (!$this->Connection->hasColumn('tblCustody', 'serviceTblPerson')) { $Table->addColumn('serviceTblPerson', 'bigint', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblCustody', 'Remark')) { $Table->addColumn('Remark', 'text'); } if (!$this->Connection->hasColumn('tblCustody', 'Occupation')) { $Table->addColumn('Occupation', 'string'); } if (!$this->Connection->hasColumn('tblCustody', 'Employment')) { $Table->addColumn('Employment', 'string'); } return $Table; }
/** * @return Table * @throws SchemaException */ public function getTableToken() { return $this->Connection->getSchema()->getTable('tblToken'); }
/** * @param Schema $Schema * * @return Table */ private function setTableProtocol(Schema &$Schema) { /** * Install */ $Table = $this->Connection->createTable($Schema, 'tblProtocol'); /** * Upgrade */ // System if (!$this->Connection->hasColumn('tblProtocol', 'ProtocolDatabase')) { $Table->addColumn('ProtocolDatabase', 'string', array('notnull' => false)); } if (!$this->Connection->hasIndex($Table, array('ProtocolDatabase'))) { $Table->addIndex(array('ProtocolDatabase')); } if (!$this->Connection->hasColumn('tblProtocol', 'ProtocolTimestamp')) { $Table->addColumn('ProtocolTimestamp', 'integer', array('notnull' => false)); } if (!$this->Connection->hasIndex($Table, array('ProtocolTimestamp'))) { $Table->addIndex(array('ProtocolTimestamp')); } // Editor if (!$this->Connection->hasColumn('tblProtocol', 'serviceTblAccount')) { $Table->addColumn('serviceTblAccount', 'bigint', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblProtocol', 'AccountUsername')) { $Table->addColumn('AccountUsername', 'string', array('notnull' => false)); } if (!$this->Connection->hasIndex($Table, array('AccountUsername'))) { $Table->addIndex(array('AccountUsername')); } // Consumer if (!$this->Connection->hasColumn('tblProtocol', 'serviceTblConsumer')) { $Table->addColumn('serviceTblConsumer', 'bigint', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblProtocol', 'ConsumerName')) { $Table->addColumn('ConsumerName', 'string', array('notnull' => false)); } if (!$this->Connection->hasIndex($Table, array('ConsumerName'))) { $Table->addIndex(array('ConsumerName')); } if (!$this->Connection->hasColumn('tblProtocol', 'ConsumerAcronym')) { $Table->addColumn('ConsumerAcronym', 'string', array('notnull' => false)); } if (!$this->Connection->hasIndex($Table, array('ConsumerAcronym'))) { $Table->addIndex(array('ConsumerAcronym')); } // Data if (!$this->Connection->hasColumn('tblProtocol', 'EntityFrom')) { $Table->addColumn('EntityFrom', 'text', array('notnull' => false)); } if (!$this->Connection->hasColumn('tblProtocol', 'EntityTo')) { $Table->addColumn('EntityTo', 'text', array('notnull' => false)); } return $Table; }