From: Dan F. <dfr...@cs...> - 2004-07-13 17:21:11
|
Folks, A user of mine accidentally blew away his Wiki, and was sad. Long story, but suffice it to say that mysql -u user -D db -p password < mysql.sql doesn't apply mysql.sql to the "db" database, it applies it to the "password" database!! There are, of course, several safeguards one could take (e.g., don't have a database called "password"). However, another safeguard would be to separate the DROP statements and CREATE statements. Then he would've just applied the CREATE statements, it wouldn't have worked, and he'd have been puzzled but not sad. Thus, he submitted the attached files for phpwiki/schemas. I hope you will take these changes. If you do, then also cd phpwiki/schemas rm minisql.sql mysql.sql psql.sql sqlite.sql cvs rm minisql.sql mysql.sql psql.sql sqlite.sql cvs commit minisql.sql mysql.sql psql.sql sqlite.sql Dan |
From: Reini U. <ru...@x-...> - 2004-07-14 10:38:51
|
More opinions on the sql separation into <backend>-initialize.sql and <backend>-destroy.sql? looks fine to me. almost no costs and quite useful. on the hand the separation is not used anywhere else, and this might have a good reason. Dan Frankowski schrieb: > A user of mine accidentally blew away his Wiki, and was sad. Long story, > but suffice it to say that > > mysql -u user -D db -p password < mysql.sql no space after the -u and -p options!!! > doesn't apply mysql.sql to the "db" database, it applies it to the > "password" database!! > > There are, of course, several safeguards one could take (e.g., don't > have a database called "password"). However, another safeguard would be > to separate the DROP statements and CREATE statements. Then he would've > just applied the CREATE statements, it wouldn't have worked, and he'd > have been puzzled but not sad. > > Thus, he submitted the attached files for phpwiki/schemas. I hope you > will take these changes. If you do, then also > > cd phpwiki/schemas > rm minisql.sql mysql.sql psql.sql sqlite.sql > cvs rm minisql.sql mysql.sql psql.sql sqlite.sql > cvs commit minisql.sql mysql.sql psql.sql sqlite.sql > > Dan > ------------------------------------------------------------------------ > -- $Id: mysql-destroy.sql,v 1.1 2004/07/12 15:24:24 riedl Exp $ > > drop table if exists page; > drop table if exists version; > drop table if exists recent; > drop table if exists nonempty; > drop table if exists link; > drop table if exists session; > > -- upgrade from 1.3.7: > > drop table if exists pref; > drop table if exists user; > drop table if exists member; > > -- if you plan to use the wikilens theme > drop table if exists rating; > > ------------------------------------------------------------------------ > -- $Id: mysql-initialize.sql,v 1.1 2004/07/12 15:24:24 riedl Exp $ > > CREATE TABLE page ( > id INT NOT NULL, > pagename VARCHAR(100) BINARY NOT NULL, > hits INT NOT NULL DEFAULT 0, > pagedata MEDIUMTEXT NOT NULL DEFAULT '', > PRIMARY KEY (id), > UNIQUE KEY (pagename) > ); ... -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Dan F. <dfr...@cs...> - 2004-07-20 12:37:36
|
Reini Urban wrote: > More opinions on the sql separation into > <backend>-initialize.sql and <backend>-destroy.sql? > > looks fine to me. almost no costs and quite useful. > on the hand the separation is not used anywhere else, > and this might have a good reason. Reini, Since you are to be gone and it's been a week with no reply, I will assume I can make these changes. Thanks. Dan > > Dan Frankowski schrieb: > >> A user of mine accidentally blew away his Wiki, and was sad. Long >> story, but suffice it to say that >> >> mysql -u user -D db -p password < mysql.sql > > > no space after the -u and -p options!!! > >> doesn't apply mysql.sql to the "db" database, it applies it to the >> "password" database!! >> >> There are, of course, several safeguards one could take (e.g., don't >> have a database called "password"). However, another safeguard would >> be to separate the DROP statements and CREATE statements. Then he >> would've just applied the CREATE statements, it wouldn't have worked, >> and he'd have been puzzled but not sad. >> >> Thus, he submitted the attached files for phpwiki/schemas. I hope you >> will take these changes. If you do, then also >> >> cd phpwiki/schemas >> rm minisql.sql mysql.sql psql.sql sqlite.sql >> cvs rm minisql.sql mysql.sql psql.sql sqlite.sql >> cvs commit minisql.sql mysql.sql psql.sql sqlite.sql >> >> Dan >> ------------------------------------------------------------------------ >> -- $Id: mysql-destroy.sql,v 1.1 2004/07/12 15:24:24 riedl Exp $ >> >> drop table if exists page; >> drop table if exists version; >> drop table if exists recent; >> drop table if exists nonempty; >> drop table if exists link; >> drop table if exists session; >> >> -- upgrade from 1.3.7: >> >> drop table if exists pref; >> drop table if exists user; >> drop table if exists member; >> >> -- if you plan to use the wikilens theme >> drop table if exists rating; >> >> ------------------------------------------------------------------------ >> -- $Id: mysql-initialize.sql,v 1.1 2004/07/12 15:24:24 riedl Exp $ >> >> CREATE TABLE page ( >> id INT NOT NULL, >> pagename VARCHAR(100) BINARY NOT NULL, >> hits INT NOT NULL DEFAULT 0, >> pagedata MEDIUMTEXT NOT NULL DEFAULT '', >> PRIMARY KEY (id), >> UNIQUE KEY (pagename) >> ); > > ... |
From: Reini U. <ru...@x-...> - 2004-07-21 07:04:00
|
Dan Frankowski schrieb: > Reini Urban wrote: >> More opinions on the sql separation into >> <backend>-initialize.sql and <backend>-destroy.sql? >> >> looks fine to me. almost no costs and quite useful. >> on the hand the separation is not used anywhere else, >> and this might have a good reason. > > Reini, > Since you are to be gone and it's been a week with no reply, I will > assume I can make these changes. Thanks. ok from me. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |