#310 Unique key not dumped correctly

3.6.3
closed-fixed
SQLite (26)
5
2013-04-03
2013-04-01
No

Create table with:

-- Adminer 3.6.3 SQLite 3 dump

DROP TABLE IF EXISTS "sqlite_sequence";
CREATE TABLE sqlite_sequence(name,seq);

DROP TABLE IF EXISTS "posts";
CREATE TABLE "posts" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"thread_id" integer NOT NULL,
"url" text NOT NULL,
"body" text NOT NULL,
"links" text NOT NULL,
"user" text NOT NULL,
FOREIGN KEY ("thread_id") REFERENCES "thread" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);

DROP TABLE IF EXISTS "threads";
CREATE TABLE "threads" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" text NOT NULL,
"url" text NOT NULL
);

-- no such table:

--

Then goto table 'posts' create a unique key over 'url'.

Notice that here no warning is generated about incompatibility with NOT NULL.

Now try to dump table posts and you will see that unique is not respected as it conflicts with NOT NULL.

No warning or anything is generated.

Ideally a warning or error should be given in both situation.s

Discussion

  • Jakub Vrána

    Jakub Vrána - 2013-04-03

    UNIQUE doesn't conflict with NOT NULL. Adminer just didn't export indexes for SQLite.

     
  • Jakub Vrána

    Jakub Vrána - 2013-04-03

    Thank you for the report, I've fixed it in Git. You can download the "Current development version" from http://www.adminer.org/#download

     
  • Jakub Vrána

    Jakub Vrána - 2013-04-03
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks