Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv10393
Modified Files:
db.sql serendipity_db_mysql.inc.php
serendipity_db_postgres.inc.php serendipity_db_sqlite.inc.php
Log Message:
Fixed the database by separating primary key from {AUTOINCREMENT}
Index: db.sql
===================================================================
RCS file: /cvsroot/php-blog/serendipity/db.sql,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- db.sql 7 Jul 2003 12:23:44 -0000 1.18
+++ db.sql 25 Jul 2003 01:03:18 -0000 1.19
@@ -5,7 +5,7 @@
create table {PREFIX}authors (
username varchar(20) default null,
password varchar(32) default null,
- authorid {AUTOINCREMENT},
+ authorid {AUTOINCREMENT} {PRIMARY},
mail_comments int(1) default '1',
mail_trackbacks int(1) default '1',
email varchar(128) not null default ''
@@ -16,7 +16,7 @@
#
create table {PREFIX}comments (
- id {AUTOINCREMENT},
+ id {AUTOINCREMENT} {PRIMARY},
entry_id int(10) {UNSIGNED} not null default '0',
timestamp int(10) {UNSIGNED} default null,
title varchar(150) default null,
@@ -35,7 +35,7 @@
#
create table {PREFIX}entries (
- id {AUTOINCREMENT},
+ id {AUTOINCREMENT} {PRIMARY},
title varchar(200) default null,
timestamp int(10) {UNSIGNED} default null,
body text,
@@ -55,8 +55,8 @@
#
create table {PREFIX}references (
- id {AUTOINCREMENT},
- entry_id int(10) {UNSIGNED} not null default '0',
+ id {AUTOINCREMENT} {PRIMARY},
+ entry_id {AUTOINCREMENT},
link text,
name text
);
@@ -66,6 +66,7 @@
#
CREATE TABLE {PREFIX}exits (
+ entry_id {AUTOINCREMENT},
day date NOT NULL,
count int(11) NOT NULL default '0',
scheme varchar(5),
@@ -73,7 +74,6 @@
port varchar(5),
path varchar(255),
query varchar(255),
- entry_id int(11) not null,
PRIMARY KEY (host,day,entry_id)
);
@@ -82,6 +82,7 @@
#
CREATE TABLE {PREFIX}referrers (
+ entry_id {AUTOINCREMENT},
day date NOT NULL,
count int(11) NOT NULL default '0',
scheme varchar(5),
@@ -89,7 +90,6 @@
port varchar(5),
path varchar(255),
query varchar(255),
- entry_id int(11) not null,
PRIMARY KEY (host,day,entry_id)
);
@@ -98,7 +98,7 @@
#
CREATE TABLE {PREFIX}css (
- cssid {AUTOINCREMENT},
+ cssid {AUTOINCREMENT} {PRIMARY},
name varchar(40) default NULL,
data text
);
@@ -132,7 +132,7 @@
);
CREATE TABLE {PREFIX}category (
- categoryid {AUTOINCREMENT},
+ categoryid {AUTOINCREMENT} {PRIMARY},
category_name varchar(255) default NULL,
category_description text,
authorid int(11) default NULL
Index: serendipity_db_mysql.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_db_mysql.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serendipity_db_mysql.inc.php 8 Jul 2003 12:04:22 -0000 1.9
+++ serendipity_db_mysql.inc.php 25 Jul 2003 01:03:18 -0000 1.10
@@ -90,8 +90,10 @@
function serendipity_db_schema_import($query)
{
- static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}');
- static $replace = array('int(11) not null auto_increment primary key', 'unsigned' , 'FULLTEXT' );
+ static $search = array('{AUTOINCREMENT}', '{PRIMARY}',
+ '{UNSIGNED}', '{FULLTEXT}');
+ static $replace = array('int(11) not null auto_increment', 'primary key',
+ 'unsigned' , 'FULLTEXT');
return serendipity_db_query(str_replace($search, $replace, $query));
}
Index: serendipity_db_postgres.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_db_postgres.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- serendipity_db_postgres.inc.php 8 Jul 2003 12:04:22 -0000 1.6
+++ serendipity_db_postgres.inc.php 25 Jul 2003 01:03:18 -0000 1.7
@@ -91,8 +91,10 @@
function serendipity_db_schema_import($query)
{
- static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}', 'int(1)', 'int(10)', 'int(11)', 'int(4)');
- static $replace = array('SERIAL primary key', '' , '' , 'int2' , 'int4' , 'int4' , 'int4' );
+ static $search = array('{AUTOINCREMENT}', '{PRIMARY}', '{UNSIGNED}',
+ '{FULLTEXT}', 'int(1)', 'int(10)', 'int(11)', 'int(4)');
+ static $replace = array('SERIAL', 'primary key', '', '', 'int2',
+ 'int4', 'int4', 'int4');
return serendipity_db_query(str_replace($search, $replace, $query));
}
Index: serendipity_db_sqlite.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_db_sqlite.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- serendipity_db_sqlite.inc.php 8 Jul 2003 12:04:22 -0000 1.5
+++ serendipity_db_sqlite.inc.php 25 Jul 2003 01:03:18 -0000 1.6
@@ -119,8 +119,8 @@
function serendipity_db_schema_import($query)
{
- static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}');
- static $replace = array('INTEGER PRIMARY KEY', '' , '' );
+ static $search = array('{AUTOINCREMENT}', '{PRIMARY}', '{UNSIGNED}', '{FULLTEXT}');
+ static $replace = array('INTEGER', 'PRIMARY KEY', '', '');
return serendipity_db_query(str_replace($search, $replace, $query));
}
|