On peux stocker et éditer des tableau dans la table des variables ! Et meme qu'on peut mettre un label ! Yepee !
This commit is contained in:
parent
6c8d5fa88d
commit
ee832a9386
|
@ -13,6 +13,7 @@ $fields = array (
|
|||
"var" => array ("get", "string", null),
|
||||
"var_id" => array ("post", "integer", null),
|
||||
"var_value" => array ("post", "string", null),
|
||||
"var_value_arr" => array ("post", "array", null),
|
||||
"var_name" => array ("post", "string", null),
|
||||
"strata" => array ("post", "string", null),
|
||||
"strata_id" => array ("post", "integer", null),
|
||||
|
@ -20,17 +21,27 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
|
||||
variable_get("aaa_test2", array("ns"=>"", "enabled"=>""), "This is a test!", array("ns"=>"ns name", "ip"=>"ip address", "enabled"=>"enabled"));
|
||||
|
||||
|
||||
if (empty($var)) {
|
||||
echo "<p class='error'>";__("Missing var name");echo "</p>";
|
||||
include_once("foot.php");
|
||||
}
|
||||
|
||||
// Which one between var_value and var_value_arr ?
|
||||
$var_v = null;
|
||||
if (!is_null($var_value)) $var_v = $var_value;
|
||||
if (!is_null($var_value_arr)) $var_v = $var_value_arr;
|
||||
|
||||
|
||||
if ( $var_id && $delete ) {
|
||||
$variables->del($var_id);
|
||||
} else if ( $strata && $var_name && $var_value ) {
|
||||
$variables->variable_update_or_create($var_name, $var_value, $strata, $strata_id);
|
||||
} else if ( $var_id && $var_value ) {
|
||||
$variables->variable_update_or_create($var_name, $var_value, null, null, $var_id);
|
||||
} else if ( $strata && $var_name && $var_v ) {
|
||||
$variables->variable_update_or_create($var_name, $var_v, $strata, $strata_id);
|
||||
} else if ( $var_id && $var_v ) {
|
||||
$variables->variable_update_or_create($var_name, $var_v, null, null, $var_id);
|
||||
}
|
||||
|
||||
echo "<h3>";echo sprintf(_("Edition of var %s"), $var); echo "</h3>";
|
||||
|
@ -57,9 +68,22 @@ echo "</fieldset>";
|
|||
echo "<br/>";
|
||||
|
||||
function edit_var($var_arr) {
|
||||
global $allvars;
|
||||
echo "<div id='edit_var_div_{$var_arr['id']}'><form method=post>";
|
||||
echo "<input type='hidden' name='var_id' value='";ehe($var_arr['id']);echo "' />";
|
||||
echo "<input type='text' class='int' name='var_value' value='";ehe($var_arr['value']); echo "' size='30' />";
|
||||
if (is_array( $allvars['DEFAULT'][null][$var_arr['name']]['type'] )) {
|
||||
echo "<ul>";
|
||||
foreach ($allvars['DEFAULT'][null][$var_arr['name']]['type'] as $kk => $vv) {
|
||||
echo "<li>";
|
||||
echo "<label for='edit_for_${var_arr['id']}'>".$vv."</label>";
|
||||
echo "<input type='text' class='int' id='edit_for_${var_arr['id']}' name='var_value_arr[$kk]' value='";ehe($var_arr['value'][$kk]); echo "' size='30' />";
|
||||
echo "</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
} else {
|
||||
echo "<input type='text' class='int' name='var_value' value='";ehe($var_arr['value']); echo "' size='30' />";
|
||||
}
|
||||
|
||||
echo "<br/>";
|
||||
echo "<input type='button' class='inb cancel' name='cancel' value='"._('Cancel')."' onclick=\"$('#edit_var_div_{$var_arr['id']}').toggle();\" />";
|
||||
echo "<input type='submit' class='inb delete' name='delete' value='"._("Delete")."' onclick=\"return confirm('"; ehe(_("Are you sure you want to delete it.")); echo "')\" />";
|
||||
|
@ -70,7 +94,7 @@ function edit_var($var_arr) {
|
|||
}
|
||||
|
||||
function add_var($stratatata, $stratatata_arr=null) {
|
||||
global $var;
|
||||
global $var, $allvars;
|
||||
echo "<div id='add_var_div_$stratatata'><form method=post>";
|
||||
echo "<input type='hidden' name='strata' value='";ehe($stratatata);echo "' />";
|
||||
echo "<input type='hidden' name='var_name' value='";ehe($var);echo "' />";
|
||||
|
@ -79,7 +103,18 @@ function add_var($stratatata, $stratatata_arr=null) {
|
|||
eoption($stratatata_arr, null);
|
||||
echo "</select> ";
|
||||
}
|
||||
echo "<input type='text' class='int' name='var_value' value='' size='30' />";
|
||||
if (is_array( $allvars['DEFAULT'][null][$var]['type'] )) {
|
||||
echo "<ul>";
|
||||
foreach ($allvars['DEFAULT'][null][$var]['type'] as $kk => $vv) {
|
||||
echo "<li>";
|
||||
echo "<label for='add_for_$var'>$vv</label>";
|
||||
echo "<input type='text' class='int' id='add_for_$var' name='var_value_arr[$kk]' value='' size='30' />";
|
||||
echo "</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
} else {
|
||||
echo "<input type='text' class='int' name='var_value' value='' size='30' />";
|
||||
}
|
||||
echo "<br/>";
|
||||
echo "<input type='button' class='inb cancel' name='cancel' value='"._('Cancel')."' onclick=\"$('#add_var_div_$stratatata').toggle();\" />";
|
||||
echo "<input type='submit' class='inb ok' value='"._("Apply")."'/>";
|
||||
|
@ -95,12 +130,12 @@ foreach ( $variables->strata_order as $strata) {
|
|||
echo "<td>"; __($strata); echo "</td>";
|
||||
switch($strata) {
|
||||
case 'DEFAULT':
|
||||
echo "<td>".$allvars['DEFAULT'][null][$var]['value']."</td>";
|
||||
echo "<td>"; $variables->display_value_html($allvars, 'DEFAULT', null, $var); echo "</td>";
|
||||
break;
|
||||
case 'GLOBAL':
|
||||
echo "<td>";
|
||||
if ( isset($allvars['GLOBAL'][null][$var]) && is_array($allvars['GLOBAL'][null][$var])){
|
||||
echo "<a href='javascript:edit_var(".$allvars['GLOBAL'][null][$var]['id'].");'>".$allvars['GLOBAL'][null][$var]['value']."</a>";
|
||||
echo "<a href='javascript:edit_var(".$allvars['GLOBAL'][null][$var]['id'].");'>"; $variables->display_value_html($allvars, 'GLOBAL', null, $var); echo "</a>";
|
||||
edit_var($allvars['GLOBAL'][null][$var]);
|
||||
} else {
|
||||
echo "<a href='javascript:add_var(\"$strata\");'>"._("Add")."</a>";
|
||||
|
@ -114,7 +149,7 @@ foreach ( $variables->strata_order as $strata) {
|
|||
foreach ($allvars['FQDN_CREATOR'] as $ttk => $ttv ) {
|
||||
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
|
||||
echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → ";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>".$ttv[$var]['value']."</a>";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
|
||||
edit_var($ttv[$var]);
|
||||
}
|
||||
echo "<br/>";
|
||||
|
@ -130,7 +165,7 @@ foreach ( $variables->strata_order as $strata) {
|
|||
foreach ($allvars['FQDN'] as $ttk => $ttv ) {
|
||||
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
|
||||
echo sprintf(_("Overwritted by %s"), $panel_url[$ttk])." → ";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>".$ttv[$var]['value']."</a>";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
|
||||
edit_var($ttv[$var]);
|
||||
}
|
||||
echo "<br/>";
|
||||
|
@ -146,7 +181,7 @@ foreach ( $variables->strata_order as $strata) {
|
|||
foreach ($allvars['CREATOR'] as $ttk => $ttv ) {
|
||||
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
|
||||
echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → ";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>".$ttv[$var]['value']."</a>";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
|
||||
edit_var($ttv[$var]);
|
||||
}
|
||||
echo "<br/>";
|
||||
|
@ -162,7 +197,7 @@ foreach ( $variables->strata_order as $strata) {
|
|||
foreach ($allvars['MEMBER'] as $ttk => $ttv ) {
|
||||
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
|
||||
echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → ";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>".$ttv[$var]['value']."</a>";
|
||||
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
|
||||
edit_var($ttv[$var]);
|
||||
}
|
||||
echo "<br/>";
|
||||
|
|
|
@ -69,9 +69,9 @@ foreach( $variables->variables_list_name() as $varname => $varcomment) { ?>
|
|||
<tr class="lst">
|
||||
<td><a href='adm_var_edit.php?var=<?php echo urlencode($varname)?>'><?php echo $varname; ?></a></td>
|
||||
<td><?php echo $varcomment; ?></td>
|
||||
<td><?php echo $allvars['DEFAULT'][NULL][$varname]['value']; ?></td>
|
||||
<td><?php if (isset($allvars['GLOBAL'][NULL][$varname]['value'])) { echo $allvars['GLOBAL'][NULL][$varname]['value']; } ?></td>
|
||||
<td><?php echo $global_conf[$varname]['value']; ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'DEFAULT', NULL, $varname);?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'GLOBAL', NULL, $varname);?></td>
|
||||
<td><?php if (isset($global_conf[$varname]['value'])) { $variables->display_valueraw_html($global_conf[$varname]['value'], $varname); } ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
@ -117,14 +117,14 @@ echo "</tr></thead>";
|
|||
foreach( $variables->variables_list_name() as $varname => $varcomment) { ?>
|
||||
<tr class="lst">
|
||||
<td><a href='adm_var_edit.php?var=<?php echo urlencode($varname); ?>'><?php echo $varname; ?></a></td>
|
||||
<td><?php echo $allvars['DEFAULT'][NULL][$varname]['value']; ?></td>
|
||||
<td><?php if (isset($allvars['GLOBAL'][NULL][$varname]['value'])) { echo $allvars['GLOBAL'][NULL][$varname]['value']; } ?></td>
|
||||
<td><?php if (isset($allvars['FQDN_CREATOR'][$sub_infos['member_id']][$varname]['value'])) { echo $allvars['FQDN_CREATOR'][$sub_infos['member_id']][$varname]['value']; } ?></td>
|
||||
<td><?php if (isset($allvars['FQDN'][$sub_infos['id']][$varname]['value'])) { echo $allvars['FQDN'][$sub_infos['id']][$varname]['value']; } ?></td>
|
||||
<td><?php if (isset($allvars['CREATOR'][$creator][$varname]['value'])) { echo $allvars['CREATOR'][$creator][$varname]['value']; } ?></td>
|
||||
<td><?php if (isset($allvars['MEMBER'][$member_id][$varname]['value'])) { echo $allvars['MEMBER'][$member_id][$varname]['value']; } ?></td>
|
||||
<td><?php if (isset($allvars['DOMAIN']['FIXME'][$varname]['value'])) { echo $allvars['DOMAIN']['FIXME'][$varname]['value']; } ?></td>
|
||||
<td><?php echo $impersonated_conf[$varname]['value']; ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'DEFAULT', NULL, $varname); ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'GLOBAL', NULL, $varname); ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'FQDN_CREATOR', $sub_infos['member_id'], $varname); ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'FQDN', $sub_infos['id'], $varname); ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'CREATOR', $creator, $varname); ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'MEMBER', $member_id, $varname); ?></td>
|
||||
<td><?php $variables->display_value_html($allvars, 'DOMAIN', 'FIXME', $varname); ?></td>
|
||||
<td><?php $variables->display_valueraw_html($impersonated_conf[$varname]['value'], $varname); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
} //foreach
|
||||
|
|
|
@ -35,9 +35,9 @@ function compare_logname($a, $b) {
|
|||
return strcmp($a['name'],$b['name']);
|
||||
}
|
||||
|
||||
function variable_get($name, $default = null, $createit_comment = null) {
|
||||
function variable_get($name, $default = null, $createit_comment = null, $type=null) {
|
||||
global $variables;
|
||||
return $variables->variable_get($name, $default, $createit_comment);
|
||||
return $variables->variable_get($name, $default, $createit_comment, $type);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
class m_variables {
|
||||
var $strata_order = array('DEFAULT','GLOBAL','FQDN_CREATOR','FQDN','CREATOR','MEMBER','DOMAIN');
|
||||
var $cache_variable_list = false;
|
||||
|
||||
// used by get_impersonated to merge array. Son value overwrite father's value
|
||||
private function variable_merge($father, $son) {
|
||||
|
@ -59,6 +60,8 @@ class m_variables {
|
|||
} else {
|
||||
$mid = null;
|
||||
}
|
||||
|
||||
// In case we launch it in a script, there is no $_SERVER
|
||||
if (isset($_SERVER['HTTP_HOST'])) {
|
||||
$host=$_SERVER['HTTP_HOST'];
|
||||
} else {
|
||||
|
@ -67,7 +70,15 @@ class m_variables {
|
|||
return $this->get_impersonated($host, $mid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the var for a specific environnement :
|
||||
* * logged via $fqdn url
|
||||
* * the user is $uid
|
||||
* * $var if we want only 1 var instead of all of them
|
||||
*
|
||||
* If $fqdn and $uid aren't specified, return the default value
|
||||
*
|
||||
*/
|
||||
function get_impersonated($fqdn=null, $uid=null, $var=null) {
|
||||
global $db, $err;
|
||||
|
||||
|
@ -140,6 +151,7 @@ class m_variables {
|
|||
function variable_init_maybe($force=false) {
|
||||
global $conf;
|
||||
if ($force || !isset($conf)) {
|
||||
$this->cache_variable_list = false;
|
||||
$conf = $this->variable_init();
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +171,7 @@ class m_variables {
|
|||
* @global $conf
|
||||
* A cache of the configuration.
|
||||
*/
|
||||
function variable_get($name, $default = null, $createit_comment = null) {
|
||||
function variable_get($name, $default = null, $createit_comment = null, $type=null) {
|
||||
global $conf;
|
||||
|
||||
$this->variable_init_maybe();
|
||||
|
@ -167,48 +179,21 @@ class m_variables {
|
|||
if (isset($conf[$name])) {
|
||||
return $conf[$name]['value'];
|
||||
} elseif (!is_null($createit_comment)) {
|
||||
$this->variable_update_or_create($name, $default, 'DEFAULT', 'null', 'null', $createit_comment);
|
||||
$this->variable_update_or_create($name, $default, 'DEFAULT', 'null', 'null', $createit_comment, $type);
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a persistent variable.
|
||||
*
|
||||
* @param $name
|
||||
* The name of the variable to set.
|
||||
* @param $value
|
||||
* The value to set. This can be any PHP data type; these functions take care
|
||||
* of serialization as necessary.
|
||||
*/
|
||||
function variable_set($name, $value, $comment=null) {
|
||||
global $conf, $db, $err;
|
||||
$err->log('variable', 'variable_set', '+'.serialize($value).'+'.$comment.'+');
|
||||
|
||||
$conf[$name] = $value;
|
||||
if (is_object($value) || is_array($value)) {
|
||||
$value = serialize($value);
|
||||
}
|
||||
|
||||
if ( empty($comment) ) {
|
||||
$query = "INSERT INTO variable (name, value) values ('".$name."', '".$value."') on duplicate key update name='$name', value='$value';";
|
||||
} else {
|
||||
$comment=mysql_real_escape_string($comment);
|
||||
$query = "INSERT INTO variable (name, value, comment) values ('".$name."', '".$value."', '$comment') on duplicate key update name='$name', value='$value', comment='$comment';";
|
||||
}
|
||||
|
||||
# $db->query("$query");
|
||||
printvar($query);
|
||||
|
||||
$this->variable_init();
|
||||
}
|
||||
|
||||
function variable_update_or_create($var_name, $var_value, $strata=null, $strata_id=null, $var_id=null, $comment=null) {
|
||||
// Create or update a variable.
|
||||
function variable_update_or_create($var_name, $var_value, $strata=null, $strata_id=null, $var_id=null, $comment=null, $type=null) {
|
||||
global $db, $err;
|
||||
$err->log('variable', 'variable_update_or_create');
|
||||
if ( strtolower($var_id) == 'null' ) $var_id = null;
|
||||
if ( strtolower($strata_id) == 'null' ) $strata_id = null;
|
||||
|
||||
if (is_object($type) || is_array($type)) {
|
||||
$type = serialize($type);
|
||||
}
|
||||
if (is_object($var_value) || is_array($var_value)) {
|
||||
$var_value = serialize($var_value);
|
||||
}
|
||||
|
@ -221,13 +206,14 @@ class m_variables {
|
|||
return false;
|
||||
}
|
||||
$sql="INSERT INTO
|
||||
variable (name, value, strata, strata_id, comment)
|
||||
variable (name, value, strata, strata_id, comment, type)
|
||||
VALUES (
|
||||
'".mysql_real_escape_string($var_name)."',
|
||||
'".mysql_real_escape_string($var_value)."',
|
||||
'".mysql_real_escape_string($strata)."',
|
||||
".( is_null($strata_id)?'NULL':"'".mysql_real_escape_string($strata_id)."'").",
|
||||
'".mysql_real_escape_string($comment)."' );";
|
||||
'".mysql_real_escape_string($comment)."',
|
||||
'".mysql_real_escape_string($type)."' );";
|
||||
}
|
||||
|
||||
$db->query("$sql");
|
||||
|
@ -248,6 +234,45 @@ class m_variables {
|
|||
$this->variable_init_maybe(true);
|
||||
}
|
||||
|
||||
// echo HTML code to display a variable passed in parameters
|
||||
function display_valueraw_html($v,$varname) {
|
||||
if (is_array($v)) {
|
||||
if (empty($v)) {
|
||||
echo "<em>"._("Empty array")."</em>";
|
||||
} else {
|
||||
echo "<ul>";
|
||||
foreach ( $v as $k=>$l) {
|
||||
echo "<li>";
|
||||
if (! is_numeric($k)) {
|
||||
if (is_null($varname)) {
|
||||
echo "$k =>";
|
||||
} else {
|
||||
echo $this->variables_list()['DEFAULT'][null][$varname]['type'][$k]. " => ";
|
||||
}
|
||||
}
|
||||
echo "$l</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
} // empty $v
|
||||
} else if (empty($v)) {
|
||||
echo "<em>"._("Empty")."</em>";
|
||||
} else {
|
||||
echo $v;
|
||||
}
|
||||
}
|
||||
|
||||
// Display a variable if is set
|
||||
function display_value_html($tab, $strata, $id, $varname) {
|
||||
if (isset($tab[$strata][$id][$varname]['value'])) {
|
||||
$v = $tab[$strata][$id][$varname]['value'];
|
||||
$this->display_valueraw_html($v, $varname);
|
||||
} else {
|
||||
echo "<em>"._("None defined")."</em>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// return hashtable with variable_name => comment for all the vars
|
||||
function variables_list_name() {
|
||||
global $db;
|
||||
|
||||
|
@ -263,21 +288,28 @@ class m_variables {
|
|||
return $t;
|
||||
}
|
||||
|
||||
// return a multidimensionnal array used to build vars
|
||||
function variables_list() {
|
||||
global $db;
|
||||
if ( ! $this->cache_variable_list ) {
|
||||
|
||||
$result = $db->query('SELECT * FROM `variable`');
|
||||
$result = $db->query('SELECT * FROM `variable`');
|
||||
|
||||
$arr_var=array();
|
||||
while ($db->next_record($result)) {
|
||||
// Unserialize value if needed
|
||||
if ( ($value = @unserialize($db->f('value'))) === FALSE) {
|
||||
$value=$db->f('value');
|
||||
$arr_var=array();
|
||||
while ($db->next_record($result)) {
|
||||
// Unserialize value if needed
|
||||
if ( ($value = @unserialize($db->f('value'))) === FALSE) {
|
||||
$value=$db->f('value');
|
||||
}
|
||||
if ( ($type = @unserialize($db->f('type'))) === FALSE) {
|
||||
$type=$db->f('type');
|
||||
}
|
||||
$arr_var[$db->f('strata')][$db->f('strata_id')][$db->f('name')] = array('id'=>$db->f('id') ,'name'=>$db->f('name'), 'value'=>$value, 'comment'=>$db->f('comment'), 'type'=>$type);
|
||||
}
|
||||
$arr_var[$db->f('strata')][$db->f('strata_id')][$db->f('name')] = array('id'=>$db->f('id') ,'name'=>$db->f('name'), 'value'=>$value, 'comment'=>$db->f('comment'));
|
||||
$this->cache_variable_list = $arr_var;
|
||||
}
|
||||
|
||||
return $arr_var;
|
||||
|
||||
return $this->cache_variable_list;
|
||||
}
|
||||
|
||||
} /* Class m_variables */
|
||||
|
|
|
@ -393,6 +393,7 @@ CREATE TABLE `variable` (
|
|||
`comment` mediumtext,
|
||||
`strata` enum('DEFAULT','GLOBAL','FQDN','FQDN_CREATOR','CREATOR','MEMBER','DOMAIN') NOT NULL DEFAULT 'DEFAULT',
|
||||
`strata_id` bigint(20) DEFAULT NULL,
|
||||
`type` text,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_2` (`name`,`strata`,`strata_id`),
|
||||
KEY `name` (`name`)
|
||||
|
|
|
@ -3,6 +3,7 @@ ALTER TABLE variable DROP PRIMARY KEY;
|
|||
ALTER TABLE variable ADD id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
|
||||
ALTER TABLE variable ADD strata enum('DEFAULT','GLOBAL','FQDN', 'FQDN_CREATOR', 'CREATOR', 'MEMBER', 'DOMAIN') NOT NULL DEFAULT 'DEFAULT';
|
||||
ALTER TABLE variable ADD strata_id bigint DEFAULT NULL;
|
||||
ALTER TABLE variable ADD type text DEFAULT '';
|
||||
ALTER TABLE variable ADD UNIQUE (name, strata, strata_id);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue