Jason (squeaky19) wrote in lj_dev,
Jason
squeaky19
lj_dev

Problem with SQL in update-db-general.pl



In the insert command

# global
register_tablecreate("usertrans", <<'EOC');
CREATE TABLE usertrans (
  userid INT UNSIGNED NOT NULL,
  time INT UNSIGNED NOT NULL,
  what VARCHAR(25) NOT NULL,
  before VARCHAR(25) NOT NULL,
  after VARCHAR(25) NOT NULL,
  KEY (userid),
  KEY (time)
)
EOC


I am getting an error when it tries to use "before" as a column name as that is a reserved word. If there is something I need to do to get this table in let me know, but for now running update-db.pl -r -p gives me the following

./update-db.pl -r -p
Updating cluster: 0
# Warning: unknown live table: events
# Warning: unknown live table: userupdate
CREATE TABLE usertrans (
  userid INT UNSIGNED NOT NULL,
  time INT UNSIGNED NOT NULL,
  what VARCHAR(25) NOT NULL,
  before VARCHAR(25) NOT NULL,
  after VARCHAR(25) NOT NULL,
  KEY (userid),
  KEY (time)
);
# Running...
#  ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before VARCHAR(25) NOT NULL,
  after VARCHAR(25) NOT NULL,
  KEY (userid),
  KEY' at line 5
Subscribe

  • cl-journal livejournal client

    Hey everyone, I'd like to present a livejournal client that I wrote to fulfill my needs but maybe there are other people that can find it…

  • SessionGenerate and ljloggedin

    Are there any information after release 86 and changes in cookies scheme to use sessiongenerate? It returns ljsession key, but this key is not enough…

  • Retrieving comments

    Hi, Is there a way to retrieve a list of comments made by user XXX (which may or may be not the currently logged in user) in the journals of users…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 6 comments