anshuwap / mollify

Automatically exported from code.google.com/p/mollify
0 stars 0 forks source link

Share plugin SQLite error: expiration NOT NULL #414

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. click share on a file
2. add an optional name (not necessary)
3. click 'save'

What is the expected output? What do you see instead?

Should create a new share, instead it shows a JS alert "unexpected server error"

What version of the product are you using? On what operating system?
Mollify 1.8.8.3 on Debian Squeeze Server, Firefox 12 on Ubuntu 12.04 client

Any idea?

Original issue reported on code.google.com by hanta...@gmail.com on 12 Jul 2012 at 5:33

Attachments:

GoogleCodeExporter commented 9 years ago
It seems sqlite database has expiration field marked as NOT NULL, when it 
should be nullable. I guess I have to release an update for the share plugin 
that corrects this.

If you have sqlite manager etc where you can make this change, you can do it 
right away.

Original comment by samuli.j...@gmail.com on 12 Jul 2012 at 6:48

GoogleCodeExporter commented 9 years ago
You could try running this sqlite script (although I haven't yet tested it):

CREATE TEMPORARY TABLE share_backup(id,item_id,name,user_id,expiration,created, 
active);
INSERT INTO share_backup SELECT id,item_id,name,user_id,expiration,created, 
active FROM share;
DROP TABLE share;

CREATE TABLE share (
  id char(32) PRIMARY KEY,
  item_id char(255) NOT NULL,
  name varchar(255) NOT NULL,
  user_id INTEGER NOT NULL,
  expiration bigint(11) NULL,
  created bigint(11) NOT NULL,
  active TINYINT(1) NOT NULL
);

INSERT INTO share SELECT id,item_id,name,user_id,expiration,created, active 
FROM share_backup;
DROP TABLE share_backup;

Original comment by samuli.j...@gmail.com on 12 Jul 2012 at 7:34

GoogleCodeExporter commented 9 years ago
Fixed in 1.8.9

Original comment by samuli.j...@gmail.com on 22 Jul 2012 at 12:18