diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-08-10 11:14:22 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-08-10 11:14:22 +0000 |
commit | 36cf32247911fb16f70a2d39dc759d8669ce4ad2 (patch) | |
tree | 658bb93c78bf3542dbf0f998890559a85f46d6f2 /modules | |
parent | 87bdc95bff527771e82986fdfb96b2d0e9a4af99 (diff) | |
download | brdo-36cf32247911fb16f70a2d39dc759d8669ce4ad2.tar.gz brdo-36cf32247911fb16f70a2d39dc759d8669ce4ad2.tar.bz2 |
#165766 by hswong3i: node SQL fixes - primary keys have indexes themselfs, unique columns should not allow NULL
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.schema | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 4a9e2aa2c..d7fe1681a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -719,7 +719,7 @@ function node_save(&$node) { //Generate the node table query and the //the node_revisions table query if ($node->is_new) { - $node_query = 'INSERT INTO {node} (vid, '. implode(', ', array_keys($node_table_types)) .') VALUES (NULL, '. implode(', ', $node_table_types) .')'; + $node_query = 'INSERT INTO {node} ('. implode(', ', array_keys($node_table_types)) .') VALUES ('. implode(', ', $node_table_types) .')'; db_query($node_query, $node_table_values); $node->nid = db_last_insert_id('node', 'nid'); $revisions_query = 'INSERT INTO {node_revisions} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')'; diff --git a/modules/node/node.schema b/modules/node/node.schema index aa6d3343c..30e70bf9c 100644 --- a/modules/node/node.schema +++ b/modules/node/node.schema @@ -5,7 +5,7 @@ function node_schema() { $schema['node'] = array( 'fields' => array( 'nid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), + 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), @@ -21,7 +21,6 @@ function node_schema() { 'translate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), ), 'indexes' => array( - 'nid' => array('nid'), 'node_changed' => array('changed'), 'node_created' => array('created'), 'node_moderate' => array('moderate'), |