• I get the Failed to create table error when trying to apply the following sql statement:

    CREATE TABLE wp_actionlist (
    task_id int(11) NOT NULL AUTO_INCREMENT,
    task_name longtext NOT NULL,
    urgency int(11) NOT NULL DEFAULT 0,
    importance int(11) NOT NULL DEFAULT 0,
    who text NOT NULL DEFAULT ‘0’,
    due date NOT NULL DEFAULT ‘0’,
    created datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’ COMMENT ‘Created Datetime’,
    updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘Updated Datetime’,
    PRIMARY KEY(task_id) )
    ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=’actionlist’ AUTO_INCREMENT=1;

    https://www.ads-software.com/plugins/custom-database-tables/

Viewing 3 replies - 1 through 3 (of 3 total)
  • In the SQL statement who and due doesn’t except DEFAULT ‘0’ please try this statement

    CREATE TABLE wp_actionlist (
    task_id int(11) NOT NULL AUTO_INCREMENT,
    task_name longtext NOT NULL,
    urgency int(11) NOT NULL DEFAULT 0,
    importance int(11) NOT NULL DEFAULT 0,
    who text NOT NULL ,
    due date NOT NULL ,
    created datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’ COMMENT ‘Created Datetime’,
    updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘Updated Datetime’,
    PRIMARY KEY(task_id) )
    ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=’actionlist’ AUTO_INCREMENT=1

    Same problem with Failed to Create.

    CREATE TABLE wpxq_gratitude (
    Name char(12) ASCII NOT NULL DEFAULT ‘NAME’ COMMENT ‘Name of Member’,
    Date date BINARY NOT NULL DEFAULT ‘TODAY’ COMMENT ‘Date You’re Grateful’,
    Greatful text NOT NULL COMMENT ‘greatful’,
    PRIMARY KEY(Name) ,
    INDEX(Date) )
    ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=’Greatfulness’;

    Plugin Author ka2

    (@ka2)

    Thank you for your inquiry.

    You have mistaken the “Date” column definition. In the column of date type cannot have a binary attribute and strings like “TODAY” as default value. You should modify the “Date” column definition as follows.

    If “Date” is date type:

    Date date NOT NULL COMMENT 'Date You''re Grateful',

    If “Date” is binary type:

    Date binary(n) NOT NULL DEFAULT 'TODAY' COMMENT 'Date You''re Grateful',

    Note: the “n” of the binary(n) is any integer

    Thank you,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Failed to create table.’ is closed to new replies.