Hey there, I've just started using this plugin myself, and I do all of my drupal stuff with postgres.

I'd really like to see postgres support upstream for this, so below is the code I wrote to make it work.

I'd be happy for you to contact me in the future if you want help writing upgrades for postgres too.

(note that I removed the PK off the insert statements to ensure that postgres incremented the sequence properly).

--
db_query("CREATE TABLE {wymeditor_classes} (
cid SERIAL NOT NULL,
gid INTEGER NOT NULL default '1',
name varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
allowed varchar(255) NOT NULL default '',
incompatible varchar(255) NOT NULL default '',
compatible varchar(255) NOT NULL default '',
weight INTEGER NOT NULL default '0',
PRIMARY KEY (cid)
);");

db_query("CREATE TABLE {wymeditor_profiles} (
pid SERIAL NOT NULL,
name varchar(64) NOT NULL default '',
settings text NOT NULL,
PRIMARY KEY (pid)
);");

// Insert the sample data
// Containers
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Paragraph', 'P', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Heading 1', 'H1', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Heading 2', 'H2', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Heading 3', 'H3', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Heading 4', 'H4', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Heading 5', 'H5', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Heading 6', 'H6', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Preformatted', 'PRE', 0);");
db_query("INSERT INTO {wymeditor_containers} (description, tagname, weight) VALUES ('Blockquote', 'BLOCKQUOTE', 0);");

// Classes
db_query("INSERT INTO {wymeditor_classes} (gid,name,description,allowed,incompatible,compatible,weight) VALUES (1, 'hidden-note', 'note (hidden)', '*', '*', '', 0);");
db_query("INSERT INTO {wymeditor_classes} (gid,name,description,allowed,incompatible,compatible,weight) VALUES (1, 'date', 'Date', 'P', '*', '', 0);");
db_query("INSERT INTO {wymeditor_classes} (gid,name,description,allowed,incompatible,compatible,weight) VALUES (1, 'important', 'Important', 'P', '', '*', 0);");
db_query("INSERT INTO {wymeditor_classes} (gid,name,description,allowed,incompatible,compatible,weight) VALUES (1, 'block', 'Side Block', 'P', '', 'important', 0);");
db_query("INSERT INTO {wymeditor_classes} (gid,name,description,allowed,incompatible,compatible,weight) VALUES (1, 'border', 'Border', 'IMG', '', '*', 0);");

CommentFileSizeAuthor
#1 wymeditor.install.patch4.69 KBwedge

Comments

wedge’s picture

Status: Active » Needs review
StatusFileSize
new4.69 KB

converted to a patch. very lightly tested. someone else should probably also look at this.

magico’s picture

Status: Needs review » Closed (duplicate)