Skip to content

mediumint and mediumserial do not exist #127

@mattbucci

Description

@mattbucci

WP Version: 6.6.2
PG4WP Version: 3.3.1

Attempted to install gravity forms

Error:

----> ERROR:  type "mediumserial" does not exist
LINE 2:               id mediumserial,
                         ^
CREATE INDEX IF NOT EXISTS wp_gf_draft_submissions_form_id ON wp_gf_draft_submissions (form_id);
----> ERROR:  type "mediumint" does not exist
LINE 4:               form_id mediumint  not null,

RAW SQL

            CREATE TABLE wp_gf_form (
              id mediumint(10) unsigned not null auto_increment,
              title varchar(150) not null,
              date_created datetime not null,
              date_updated datetime,
              is_active tinyint(10) not null default 1,
              is_trash tinyint(10) not null default 0,
              PRIMARY KEY  (id)
            ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
            
           CREATE TABLE wp_gf_draft_submissions (
              uuid char(32) not null,
              email varchar(255),
              form_id mediumint(10) unsigned not null,
              date_created datetime not null,
              ip varchar(45) not null,
              source_url longtext not null,
              submission longtext not null,
              PRIMARY KEY  (uuid),
              KEY form_id (form_id)
            ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci

Expected Rewritten SQL

            CREATE TABLE IF NOT EXISTS wp_gf_form (
              id serial,
              title varchar(150) not null,
              date_created timestamp not null,
              date_updated timestamp,
              is_active smallint not null default 1,
              is_trash smallint not null default 0,
              PRIMARY KEY  (id)
            );
            CREATE TABLE IF NOT EXISTS wp_gf_draft_submissions (
              uuid char(32) not null,
              email varchar(255),
              form_id int  not null,
              date_created timestamp not null,
              ip varchar(45) not null,
              source_url text not null,
              submission text not null,
              PRIMARY KEY  (uuid)
            );

Actual Rewritten SQL

           CREATE TABLE IF NOT EXISTS wp_gf_form (
              id mediumserial,
              title varchar(150) not null,
              date_created timestamp not null,
              date_updated timestamp,
              is_active smallint not null default 1,
              is_trash smallint not null default 0,
              PRIMARY KEY  (id)
            );
            
            CREATE TABLE IF NOT EXISTS wp_gf_draft_submissions (
              uuid char(32) not null,
              email varchar(255),
              form_id mediumint  not null,
              date_created timestamp not null,
              ip varchar(45) not null,
              source_url text not null,
              submission text not null,
              PRIMARY KEY  (uuid)
            );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions