Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#353 closed defect (duplicate)

mysql breaks on model sqlite3 likes

Reported by: garthk@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

C:\dev\pytagger-svn>update
At revision 535.
At revision 535.

C:\dev\pytagger-svn>django-admin.cmd sqlall tags

C:\dev\pytagger-svn>python23 c:\dev\django-svn\trunk\django\bin\django-admin.py sqlall tags
BEGIN;
CREATE TABLE tags_tags (
    id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY,
    tag varchar(64) NOT NULL UNIQUE
);
CREATE TABLE tags_destinations (
    id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY,
    url varchar(250) NOT NULL UNIQUE,
    urlhash varchar(32) NOT NULL UNIQUE
);
CREATE TABLE tags_posts (
    id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY,
    user_id integer NOT NULL REFERENCES auth_users (id),
    destination_id integer NULL REFERENCES tags_destinations (id),
    posted datetime NOT NULL,
    title varchar(250) NOT NULL,
    desc varchar(250) NOT NULL
);
CREATE TABLE tags_posts_tags (
    id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY,
    post_id integer NOT NULL REFERENCES tags_posts (id),
    tag_id integer NOT NULL REFERENCES tags_tags (id),
    UNIQUE (post_id, tag_id)
);
INSERT INTO packages (label, name) VALUES ('tags', 'tags');
INSERT INTO content_types (name, package, python_module_name) VALUES ('tag', 'tags', 'tags');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can add tag', 'tags', 'add_tag');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can change tag', 'tags', 'change_tag');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can delete tag', 'tags', 'delete_tag');
INSERT INTO content_types (name, package, python_module_name) VALUES ('destination', 'tags', 'destinations');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can add destination', 'tags', 'add_destination');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can change destination', 'tags', 'change_destination')
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can delete destination', 'tags', 'delete_destination')
INSERT INTO content_types (name, package, python_module_name) VALUES ('post', 'tags', 'posts');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can add post', 'tags', 'add_post');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can change post', 'tags', 'change_post');
INSERT INTO auth_permissions (name, package, codename) VALUES ('Can delete post', 'tags', 'delete_post');
COMMIT;

INFO:flush:Determining the site...
INFO:flush:DJANGO_SETTINGS_MODULE=tagger.settings.main
INFO:flush:Deleting old database...
INFO:flush:Initialising site...
INFO:flush:Finding applications...
INFO:flush:Installing application: accounts
INFO:flush:Installing application: tags
Error: tags couldn't be installed. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the database tables already exists.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlall tags'. That's the SQL this command wasn't able to run.
The full error: (1064, "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 'desc varchar(250) NOT NULL\n)' at line 7")

C:\dev\pytagger-svn>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import _mysql
>>> _mysql.version_info
(1, 2, 0, 'final', 1)
>>> s = _mysql.connect(host='localhost', user='root', passwd='')
>>> s.get_server_info()
'4.1.13a-nt'
>>>

Change History (2)

comment:1 by Jacob, 19 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #121; it's barfing because it doesn't like the field named "desc" (which is also a keyword).

comment:2 by garthk@…, 19 years ago

Oh! Thanks!

Note: See TracTickets for help on using tickets.
Back to Top