summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Component.php3
-rw-r--r--src/Components/FieldDefinition.php2
-rw-r--r--src/Statement.php3
-rw-r--r--src/Utils/Table.php5
4 files changed, 11 insertions, 2 deletions
diff --git a/src/Component.php b/src/Component.php
index 599784a..cd77982 100644
--- a/src/Component.php
+++ b/src/Component.php
@@ -65,7 +65,8 @@ abstract class Component
*
* @return string
*/
- public function __toString() {
+ public function __toString()
+ {
return static::build($this);
}
}
diff --git a/src/Components/FieldDefinition.php b/src/Components/FieldDefinition.php
index 22719eb..0217964 100644
--- a/src/Components/FieldDefinition.php
+++ b/src/Components/FieldDefinition.php
@@ -53,6 +53,8 @@ class FieldDefinition extends Component
'AS' => array(2, 'expr', array('bracketsDelimited' => true)),
'VIRTUAL' => 3,
'PERSISTENT' => 3,
+ // 'UNIQUE' => 4, // common
+ // 'UNIQUE KEY' => 4, // common
);
/**
diff --git a/src/Statement.php b/src/Statement.php
index f2d72b3..3739310 100644
--- a/src/Statement.php
+++ b/src/Statement.php
@@ -300,7 +300,8 @@ abstract class Statement
*
* @return string
*/
- public function __toString() {
+ public function __toString()
+ {
return static::build($this);
}
}
diff --git a/src/Utils/Table.php b/src/Utils/Table.php
index aa8cea6..6b17457 100644
--- a/src/Utils/Table.php
+++ b/src/Utils/Table.php
@@ -122,6 +122,11 @@ class Table
$ret[$field->name]['on_update_current_timestamp'] = true;
}
}
+
+ if (($option = $field->options->has('AS'))) {
+ $ret[$field->name]['generated'] = true;
+ $ret[$field->name]['expr'] = $option->expr;
+ }
}
}