summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Neves2012-01-26 14:55:59 +0100
committerMichael Neves2012-01-26 14:55:59 +0100
commit780cacfe78e3191e09328f15bc6e4687ac83b0a5 (patch)
tree8ef5fc76016e1ad67a170d76240f5dce6bc1ef3e
parentadjusted Bootiso in pbs.sql and pbs_newdata.sql (diff)
downloadpbs2-780cacfe78e3191e09328f15bc6e4687ac83b0a5.tar.gz
pbs2-780cacfe78e3191e09328f15bc6e4687ac83b0a5.tar.xz
pbs2-780cacfe78e3191e09328f15bc6e4687ac83b0a5.zip
Added Preboottype Model, changed bootiso and preboot model
-rw-r--r--application/models/BootIso.php16
-rw-r--r--application/models/BootIsoMapper.php8
-rw-r--r--application/models/DbTable/PreBootType.php19
-rw-r--r--application/models/PreBoot.php17
-rw-r--r--application/models/PreBootMapper.php8
-rw-r--r--application/models/PreBootType.php101
-rw-r--r--application/models/PreBootTypeMapper.php140
-rw-r--r--setup/pbs-newdata.sql4
-rw-r--r--setup/pbs-newdata.sql~8
-rw-r--r--setup/pbs.sql12
-rw-r--r--setup/pbs.sql~12
11 files changed, 311 insertions, 34 deletions
diff --git a/application/models/BootIso.php b/application/models/BootIso.php
index 8041fa2..e1c9bd8 100644
--- a/application/models/BootIso.php
+++ b/application/models/BootIso.php
@@ -14,9 +14,9 @@ class Application_Model_BootIso {
protected $_bootisoID;
protected $_title;
protected $_description;
- protected $_prebootID;
protected $_membershipID;
protected $_groupID;
+ protected $_typeID;
protected $_serialnumber;
protected $_created;
protected $_expires;
@@ -87,22 +87,22 @@ class Application_Model_BootIso {
$this->_title = $_title;
return $this;
}
- public function getPrebootID() {
- return $this->_prebootID;
+
+ public function getTypeID() {
+ return $this->_typeID;
}
- public function setPrebootID($_prebootID) {
- $this->_prebootID = $_prebootID;
- return $this;
+ public function setTypeID($_typeID) {
+ $this->_typeID = $_typeID;
+ return $this;
}
+
public function getSerialnumber() {
return $this->_serialnumber;
}
-
public function setSerialnumber($_serialnumber) {
$this->_serialnumber = $_serialnumber;
return $this;
}
-
public function getCreated() {
return $this->_created;
}
diff --git a/application/models/BootIsoMapper.php b/application/models/BootIsoMapper.php
index 35a66d0..dbe1685 100644
--- a/application/models/BootIsoMapper.php
+++ b/application/models/BootIsoMapper.php
@@ -77,7 +77,7 @@ class Application_Model_BootIsoMapper {
public function save(Application_Model_BootIso $botiso) {
- $data = array('bootisoID' => $botiso->getID() , 'membershipID' => $botiso->getMembershipID() , 'title' => $botiso->getTitle(), 'prebootID' => $botiso->getPrebootID() , 'groupID' => $botiso->getGroupID() , 'serialnumber' => $botiso->getSerialnumber() , 'created' => $botiso->getCreated() , 'expires' => $botiso->getExpires() , 'public' => $botiso->getPublic(), 'description' => $botiso->getDescription() );
+ $data = array('bootisoID' => $botiso->getID() , 'membershipID' => $botiso->getMembershipID() , 'title' => $botiso->getTitle() , 'groupID' => $botiso->getGroupID() , 'typeID' => $botiso->getTypeID(), 'serialnumber' => $botiso->getSerialnumber() , 'created' => $botiso->getCreated() , 'expires' => $botiso->getExpires() , 'public' => $botiso->getPublic(), 'description' => $botiso->getDescription() );
if (null === ($id = $botiso->getID()) ) {
unset($data['bootisoID']);
@@ -105,10 +105,10 @@ class Application_Model_BootIsoMapper {
if($botiso == null) {
$botiso = new Application_Model_BootIso();
- $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description);
+ $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setTypeID($row->typeID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description);
return $botiso;
} else {
- $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description);
+ $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setTypeID($row->typeID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description);
}
}
@@ -118,7 +118,7 @@ class Application_Model_BootIsoMapper {
foreach ($resultSet as $row) {
$entry = new Application_Model_BootIso();
- $entry->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description);
+ $entry->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setTypeID($row->typeID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description);
$entries[] = $entry;
}
diff --git a/application/models/DbTable/PreBootType.php b/application/models/DbTable/PreBootType.php
new file mode 100644
index 0000000..f4157a3
--- /dev/null
+++ b/application/models/DbTable/PreBootType.php
@@ -0,0 +1,19 @@
+<?php
+/*
+ * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+* This program is free software distributed under the GPL version 2.
+* See http://gpl.openslx.org/
+*
+* If you have any feedback please consult http://feedback.openslx.org/ and
+* send your suggestions, praise, or complaints to feedback@openslx.org
+*
+* General information about OpenSLX can be found at http://openslx.org/
+*/
+
+class Application_Model_DbTable_PreBootType extends Zend_Db_Table_Abstract {
+
+ protected $_name = 'pbs_preboottype';
+
+
+}
+
diff --git a/application/models/PreBoot.php b/application/models/PreBoot.php
index 8381c84..61cdf93 100644
--- a/application/models/PreBoot.php
+++ b/application/models/PreBoot.php
@@ -15,6 +15,8 @@ class Application_Model_PreBoot {
protected $_title;
protected $_membershipID;
protected $_groupID;
+ protected $_typeID;
+ protected $_serialnumber;
protected $_source;
protected $_created;
protected $_description;
@@ -79,6 +81,21 @@ class Application_Model_PreBoot {
$this->_groupID = $_groupID;
return $this;
}
+ public function getTypeID() {
+ return $this->_typeID;
+ }
+
+ public function setTypeID($_typeID) {
+ $this->_typeID = $_typeID;
+ return $this;
+ }
+ public function getSerialnumber() {
+ return $this->_serialnumber;
+ }
+ public function setSerialnumber($_serialnumber) {
+ $this->_serialnumber = $_serialnumber;
+ return $this;
+ }
public function getTitle() {
return $this->_title;
}
diff --git a/application/models/PreBootMapper.php b/application/models/PreBootMapper.php
index 4a9b039..f0bba2a 100644
--- a/application/models/PreBootMapper.php
+++ b/application/models/PreBootMapper.php
@@ -81,7 +81,7 @@ class Application_Model_PreBootMapper {
public function save(Application_Model_PreBoot $preboot) {
- $data = array('prebootID' => $preboot->getID() , 'membershipID' => $preboot->getMembershipID() , 'title' => $preboot->getTitle() , 'groupID' => $preboot->getGroupID(), 'created' => $preboot->getCreated(), 'source' => $preboot->getSource(), 'description' => $preboot->getDescription());
+ $data = array('prebootID' => $preboot->getID() , 'membershipID' => $preboot->getMembershipID() , 'title' => $preboot->getTitle() , 'groupID' => $preboot->getGroupID(), 'typeID' => $preboot->getTypeID(), 'serialnumber' => $preboot->getSerialnumber(), 'created' => $preboot->getCreated(), 'source' => $preboot->getSource(), 'description' => $preboot->getDescription());
if (null === ($id = $preboot->getID()) ) {
unset($data['prebootID']);
@@ -110,10 +110,10 @@ class Application_Model_PreBootMapper {
if($preboot == null) {
$preboot = new Application_Model_PreBoot();
- $preboot->setID($row->prebootID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setSource($row->source)->setCreated($row->created)->setDescription($row->description);
+ $preboot->setID($row->prebootID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setTypeID($row->typeID)->setSerialnumber($row->serialnumber)->setSource($row->source)->setCreated($row->created)->setDescription($row->description);
return $preboot;
} else {
- $preboot->setID($row->prebootID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setSource($row->source)->setCreated($row->created)->setDescription($row->description);
+ $preboot->setID($row->prebootID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setTypeID($row->typeID)->setSerialnumber($row->serialnumber)->setSource($row->source)->setCreated($row->created)->setDescription($row->description);
}
}
@@ -123,7 +123,7 @@ class Application_Model_PreBootMapper {
foreach ($resultSet as $row) {
$entry = new Application_Model_PreBoot();
- $entry->setID($row->prebootID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setSource($row->source)->setCreated($row->created)->setDescription($row->description);
+ $entry->setID($row->prebootID)->setMembershipID($row->membershipID)->setTitle($row->title)->setGroupID($row->groupID)->setTypeID($row->typeID)->setSerialnumber($row->serialnumber)->setSource($row->source)->setCreated($row->created)->setDescription($row->description);
$entries[] = $entry;
}
diff --git a/application/models/PreBootType.php b/application/models/PreBootType.php
new file mode 100644
index 0000000..3d376d1
--- /dev/null
+++ b/application/models/PreBootType.php
@@ -0,0 +1,101 @@
+<?php
+/*
+ * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+* This program is free software distributed under the GPL version 2.
+* See http://gpl.openslx.org/
+*
+* If you have any feedback please consult http://feedback.openslx.org/ and
+* send your suggestions, praise, or complaints to feedback@openslx.org
+*
+* General information about OpenSLX can be found at http://openslx.org/
+*/
+
+class Application_Model_PreBootType {
+ protected $_preboottypeID;
+ protected $_name;
+
+ public function __construct(array $options = null) {
+ if (is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ public function __set($name, $value) {
+ $method = 'set' . $name;
+ if (('mapper' == $name) || !method_exists($this, $method)) {
+ throw new Exception('Invalid PreBootType property');
+ }
+ $this->$method($value);
+ }
+
+ public function __get($name) {
+ $method = 'get' . $name;
+ if (('mapper' == $name) || !method_exists($this, $method)) {
+ throw new Exception('Invalid PreBootType property');
+ }
+ return $this->$method();
+ }
+
+ public function setOptions(array $options) {
+ $methods = get_class_methods($this);
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (in_array($method, $methods)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ public function getID() {
+ return $this->_preboottypeID;
+ }
+ public function setID($_preboottypeID) {
+ $this->_preboottypeID = $_preboottypeID;
+ return $this;
+ }
+
+ public function getName() {
+ return $this->_name;
+ }
+
+ public function setName($_name) {
+ $this->_name = $_name;
+ return $this;
+ }
+
+ /**
+ * Returns current data as associative array using ReflectionClass
+ *
+ * @return array Returns associative array containing model data
+ * If "get"-method not available (our primary keys) the function getID() is called
+ */
+ public function toArray() {
+ $reflectionClass = new ReflectionClass($this);
+ $properties = $reflectionClass->getProperties();
+ $result = array();
+ foreach ($properties as $property) {
+ $key = $property->name;
+ if (substr($key, 0, 1) != '_' && $this->$key !== null) {
+ $method = 'get' . ucfirst($key);
+ if ($reflectionClass->hasMethod($method)) {
+ $result[$key] = $this->$method();
+ } else {
+ $result[$key] = $this->$key;
+ }
+ }
+ elseif(substr($key, 0, 1) == '_' && $this->$key !== null) {
+ $key = substr($key, 1);
+ $method = 'get' . ucfirst($key);
+ if ($reflectionClass->hasMethod($method)) {
+ $result[$key] = $this->$method();
+ } else {
+ $result[$key] = $this->getID();
+ }
+
+ }
+ }
+ return $result;
+ }
+}
+
diff --git a/application/models/PreBootTypeMapper.php b/application/models/PreBootTypeMapper.php
new file mode 100644
index 0000000..03bed3b
--- /dev/null
+++ b/application/models/PreBootTypeMapper.php
@@ -0,0 +1,140 @@
+<?php
+/*
+ * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+* This program is free software distributed under the GPL version 2.
+* See http://gpl.openslx.org/
+*
+* If you have any feedback please consult http://feedback.openslx.org/ and
+* send your suggestions, praise, or complaints to feedback@openslx.org
+*
+* General information about OpenSLX can be found at http://openslx.org/
+*/
+
+class Application_Model_PreBootTypeMapper {
+
+ protected $_dbTable;
+
+ public function findBy($where, $array = false, $order = false) {
+ foreach($where as $k => $v) {
+ if($v != null)
+ { $where2[] = "$k = '$v'"; }
+ else
+ { $where2[] = "$k IS NULL"; }
+ }
+ $where = implode(" AND " , $where2);
+
+ try {
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $select = $this->getDbTable()->select()
+ ->from($this->_dbTable)
+ ->where($where);
+
+ if(is_array($order)) {
+ foreach ($order as $k => $v)
+ $a[] = "$k $v";
+ $select->order($a);
+ }
+
+ $stmt = $select->query();
+ $result = $stmt->fetchAll();
+
+ if(!$array) {
+ $entries = array();
+ foreach ($result as $row) {
+ $entry = new Application_Model_PreBootType($row);
+ $entry->setID($row['preboottypeID']);
+ $entries[] = $entry;
+ }
+ return $entries;
+ } else {
+ return $result;
+ }
+
+ } catch (Zend_Exception $e) {
+ echo "Error message 2: " . $e->getMessage() . "\n";
+ }
+ }
+ public function setDbTable($dbTable) {
+ if (is_string($dbTable)) {
+ $dbTable = new $dbTable();
+ }
+
+ if (!$dbTable instanceof Zend_Db_Table_Abstract) {
+ throw new Exception('Invalid table data gateway provided');
+ }
+
+ $this->_dbTable = $dbTable;
+
+ return $this;
+ }
+
+ public function getDbTable() {
+ if (null === $this->_dbTable) {
+ $this->setDbTable('Application_Model_DbTable_PreBootType');
+ }
+
+ return $this->_dbTable;
+ }
+
+ public function save(Application_Model_PreBootType $preboottype) {
+
+ $data = array('preboottypeID' => $preboottype->getID() , 'name' => $preboottype->getName() );
+
+ if (null === ($id = $preboottype->getID()) ) {
+ unset($data['preboottypeID']);
+ $this->getDbTable()->insert($data);
+ } else {
+ $this->getDbTable()->update($data, array('preboottypeID = ?' => $id));
+ }
+ }
+
+ public function delete(Application_Model_PreBootType $preboottype) {
+ if (null === ($id = $preboottype->getID()) ) {
+ return;
+ } else {
+ $this->getDbTable()->delete(array('preboottypeID = ?' => $id));
+ }
+ }
+
+ public function find($id, Application_Model_PreBootType $preboottype = null) {
+ $result = $this->getDbTable()->find($id);
+ if (0 == count($result)) {
+ return;
+ }
+
+ $row = $result->current();
+
+ if($preboottype == null) {
+ $preboottype = new Application_Model_PreBootType();
+ $preboottype->setID($row->preboottypeID)->setName($row->name);
+ return $preboottype;
+ } else {
+ $preboottype->setID($row->preboottypeID)->setName($row->name);
+ }
+
+ }
+
+ public function fetchAll() {
+ $resultSet = $this->getDbTable()->fetchAll();
+ $entries = array();
+ foreach ($resultSet as $row) {
+ $entry = new Application_Model_PreBootType();
+
+ $entry->setID($row->preboottypeID)
+ ->setName($row->name);
+
+ $entries[] = $entry;
+ }
+ return $entries;
+ }
+
+ public function compare(Application_Model_PreBootType $v1, Application_Model_PreBootType $v2) {
+ $vv1 = $v1->toArray();
+ $vv2 = $v2->toArray();
+ return array_diff($vv1, $vv2);
+ }
+
+
+
+}
+
diff --git a/setup/pbs-newdata.sql b/setup/pbs-newdata.sql
index e110b43..40b5dff 100644
--- a/setup/pbs-newdata.sql
+++ b/setup/pbs-newdata.sql
@@ -84,13 +84,13 @@ INSERT INTO `pbs_bootosuser` (`bootosuserID`, `configID`, `login`, `password`, `
(5, 2, 'login5', 'password5', null, 1);
-- Adding preboot
-INSERT INTO `pbs_preboot` (`prebootID`, `title`, `membershipID`, `groupID`, `created`, `source`, `description`, `typeID`, `serialnumber`) VALUES
+INSERT INTO `pbs_preboot` (`prebootID`, `title`, `membershipID`, `groupID`, `created`, `source`, `description`, `preboottypeID`, `serialnumber`) VALUES
(1, 'Preboot 1', 1, 1, '1299694422', 'source1', 'Description 1', 0, '10-20-30-40-50'),
(2, 'Preboot 2', 1, 1, '1299694422', 'source1', 'Description 2', 0, '11-20-30-40-50'),
(3, 'Preboot 3', 1, 1, '1299694422', 'source1', 'Description 3', 0, '12-20-30-40-50');
-- Adding bootiso
-INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `typeID`, `serialnumber`, `created`, `expires`, `public`, `description`) VALUES
+INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `preboottypeID`, `serialnumber`, `created`, `expires`, `public`, `description`) VALUES
(1, 'BootMedium 1', 1, 1, 0, '10-20-30-40-50', '123', '2012-03-09', 0, 'Description 1'),
(2, 'BootMedium 2', 1, 1, 0, '11-20-30-40-50', '456', '2012-03-09', 0, 'Description 2'),
(3, 'BootMedium 3', 1, 1, 0, '12-20-30-40-50', '789', '2012-03-09', 0, 'Description 3');
diff --git a/setup/pbs-newdata.sql~ b/setup/pbs-newdata.sql~
index 86b0993..e110b43 100644
--- a/setup/pbs-newdata.sql~
+++ b/setup/pbs-newdata.sql~
@@ -90,10 +90,10 @@ INSERT INTO `pbs_preboot` (`prebootID`, `title`, `membershipID`, `groupID`, `cre
(3, 'Preboot 3', 1, 1, '1299694422', 'source1', 'Description 3', 0, '12-20-30-40-50');
-- Adding bootiso
-INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `prebootID`, `serialnumber`, `created`, `expires`, `public`, `description`) VALUES
-(1, 'BootMedium 1', 1, 1, '1', '10-20-30-40-50', '123', '2012-03-09', 0, 'Description 1'),
-(2, 'BootMedium 2', 1, 1, '2', '11-20-30-40-50', '456', '2012-03-09', 0, 'Description 2'),
-(3, 'BootMedium 3', 1, 1, '3', '12-20-30-40-50', '789', '2012-03-09', 0, 'Description 3');
+INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `typeID`, `serialnumber`, `created`, `expires`, `public`, `description`) VALUES
+(1, 'BootMedium 1', 1, 1, 0, '10-20-30-40-50', '123', '2012-03-09', 0, 'Description 1'),
+(2, 'BootMedium 2', 1, 1, 0, '11-20-30-40-50', '456', '2012-03-09', 0, 'Description 2'),
+(3, 'BootMedium 3', 1, 1, 0, '12-20-30-40-50', '789', '2012-03-09', 0, 'Description 3');
-- Adding Pools
INSERT INTO `pbs_pool` (`poolID`, `groupID`, `title`, `description`, `location`) VALUES
diff --git a/setup/pbs.sql b/setup/pbs.sql
index 6497ba2..296356d 100644
--- a/setup/pbs.sql
+++ b/setup/pbs.sql
@@ -233,12 +233,12 @@ CREATE TABLE IF NOT EXISTS `pbs_preboot` (
`description` varchar(140),
`membershipID` int(11),
`groupID` int(11) NOT NULL,
- `typeID` int(11) NOT NULL,
+ `preboottypeID` int(11) NOT NULL,
`serialnumber` varchar(30) NOT NULL,
`source` varchar(140),
`created` VARCHAR(14) NOT NULL,
PRIMARY KEY (`prebootID`),
- UNIQUE KEY `typeID` (`typeID`,`serialnumber`),
+ UNIQUE KEY `preboottypeID` (`preboottypeID`,`serialnumber`),
KEY `membershipID` (`membershipID`),
KEY `groupID` (`groupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
@@ -246,7 +246,7 @@ CREATE TABLE IF NOT EXISTS `pbs_preboot` (
ALTER TABLE `pbs_preboot`
ADD CONSTRAINT `pbs_preboot_ibfk_1` FOREIGN KEY (`membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE SET NULL,
ADD CONSTRAINT `pbs_preboot_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE,
- ADD CONSTRAINT `pbs_preboot_ibfk_3` FOREIGN KEY (`typeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
+ ADD CONSTRAINT `pbs_preboot_ibfk_3` FOREIGN KEY (`preboottypeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
CREATE TABLE IF NOT EXISTS `pbs_bootiso` (
@@ -256,13 +256,13 @@ CREATE TABLE IF NOT EXISTS `pbs_bootiso` (
`membershipID` int(11),
`groupID` int(11) NOT NULL,
`prebootID` int(11) NOT NULL,
- `typeID` int(11) NOT NULL,
+ `preboottypeID` int(11) NOT NULL,
`serialnumber` varchar(30) NOT NULL,
`created` VARCHAR(14) NOT NULL,
`expires` VARCHAR(14),
`public` int(11) NOT NULL,
PRIMARY KEY (`bootisoID`),
- UNIQUE KEY `typeID` (`typeID`,`serialnumber`),
+ UNIQUE KEY `preboottypeID` (`preboottypeID`,`serialnumber`),
KEY `membershipID` (`membershipID`),
KEY `groupID` (`groupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
@@ -271,7 +271,7 @@ CREATE TABLE IF NOT EXISTS `pbs_bootiso` (
ALTER TABLE `pbs_bootiso`
ADD CONSTRAINT `pbs_bootiso_ibfk_1` FOREIGN KEY (`membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE SET NULL,
ADD CONSTRAINT `pbs_bootiso_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE,
- ADD CONSTRAINT `pbs_bootiso_ibfk_3` FOREIGN KEY (`typeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
+ ADD CONSTRAINT `pbs_bootiso_ibfk_3` FOREIGN KEY (`preboottypeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
CREATE TABLE IF NOT EXISTS `pbs_client` (
`clientID` int(11) NOT NULL AUTO_INCREMENT,
diff --git a/setup/pbs.sql~ b/setup/pbs.sql~
index fa90857..296356d 100644
--- a/setup/pbs.sql~
+++ b/setup/pbs.sql~
@@ -233,12 +233,12 @@ CREATE TABLE IF NOT EXISTS `pbs_preboot` (
`description` varchar(140),
`membershipID` int(11),
`groupID` int(11) NOT NULL,
- `typeID` int(11) NOT NULL,
+ `preboottypeID` int(11) NOT NULL,
`serialnumber` varchar(30) NOT NULL,
`source` varchar(140),
`created` VARCHAR(14) NOT NULL,
PRIMARY KEY (`prebootID`),
- UNIQUE KEY `typeID` (`typeID`,`serialnumber`),
+ UNIQUE KEY `preboottypeID` (`preboottypeID`,`serialnumber`),
KEY `membershipID` (`membershipID`),
KEY `groupID` (`groupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
@@ -246,7 +246,7 @@ CREATE TABLE IF NOT EXISTS `pbs_preboot` (
ALTER TABLE `pbs_preboot`
ADD CONSTRAINT `pbs_preboot_ibfk_1` FOREIGN KEY (`membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE SET NULL,
ADD CONSTRAINT `pbs_preboot_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE,
- ADD CONSTRAINT `pbs_preboot_ibfk_3` FOREIGN KEY (`typeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
+ ADD CONSTRAINT `pbs_preboot_ibfk_3` FOREIGN KEY (`preboottypeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
CREATE TABLE IF NOT EXISTS `pbs_bootiso` (
@@ -256,13 +256,13 @@ CREATE TABLE IF NOT EXISTS `pbs_bootiso` (
`membershipID` int(11),
`groupID` int(11) NOT NULL,
`prebootID` int(11) NOT NULL,
- `typeID` int(11) NOT NULL,
+ `preboottypeID` int(11) NOT NULL,
`serialnumber` varchar(30) NOT NULL,
`created` VARCHAR(14) NOT NULL,
`expires` VARCHAR(14),
`public` int(11) NOT NULL,
PRIMARY KEY (`bootisoID`),
- UNIQUE KEY `typeID` (`typeID`,`serialnumber`),
+ UNIQUE KEY `preboottypeID` (`preboottypeID`,`serialnumber`),
KEY `membershipID` (`membershipID`),
KEY `groupID` (`groupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
@@ -271,7 +271,7 @@ CREATE TABLE IF NOT EXISTS `pbs_bootiso` (
ALTER TABLE `pbs_bootiso`
ADD CONSTRAINT `pbs_bootiso_ibfk_1` FOREIGN KEY (`membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE SET NULL,
ADD CONSTRAINT `pbs_bootiso_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE,
- ADD CONSTRAINT `pbs_bootiso_ibfk_3` FOREIGN KEY (`prebootID`) REFERENCES `pbs_preboot` (`prebootID`) ON DELETE CASCADE;
+ ADD CONSTRAINT `pbs_bootiso_ibfk_3` FOREIGN KEY (`preboottypeID`) REFERENCES `pbs_preboottype` (`preboottypeID`);
CREATE TABLE IF NOT EXISTS `pbs_client` (
`clientID` int(11) NOT NULL AUTO_INCREMENT,