Proposed ccTiddly Database Structure

Over the past few week I have been working with cool cold, Martin and Jeremy to decide where we want to take ccTiddly going forward. The idea is to make ccTiddly completely self service without removing any functionality. In order to do this we need to store what is currently stored in the /config/default.php file and store it in a single database.

This is the currently the proposed design. Any comments and suggestions are welcome. I will be publishing more about road map for this project very soon. erm_summary.jpg

erm1.jpg


Note : I have included the original ccTiddly tables in the below SQL.  They will be removed but are in place so that we can test as we build


-- --------------------------------------------------------

--
-- Table structure for table `admin_of_instance`
--

CREATE TABLE `admin_of_instance` (
`user_username` varchar(50) NOT NULL,
`instance_name` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `group_membership`
--

CREATE TABLE `group_membership` (
`user_username` varchar(50) NOT NULL,
`groupname` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `instance`
--

CREATE TABLE `instance` (
`name` varchar(100) NOT NULL,
`lang` varchar(10) NOT NULL,
`keep_revision` int(1) NOT NULL,
`require_login` int(1) NOT NULL,
`cookie_expire` int(1) NOT NULL,
`tag_tiddler_with_modifier` int(1) NOT NULL,
`char_set` varchar(10) NOT NULL,
`hashseed` varchar(50) NOT NULL,
`debug` int(1) NOT NULL,
`status` varchar(10) NOT NULL,
PRIMARY KEY  (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `privileges`
--

CREATE TABLE `privileges` (
`id` int(11) NOT NULL auto_increment,
`read` int(1) NOT NULL,
`insert` int(1) NOT NULL,
`edit` int(1) NOT NULL,
`delete` int(1) NOT NULL,
`group_membership_groupname` varchar(50) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `tiddler`
--

CREATE TABLE `tiddler` (
`id` int(11) NOT NULL auto_increment,
`instance_name` varchar(100) NOT NULL,
`title` text NOT NULL,
`body` mediumtext NOT NULL,
`fields` text NOT NULL,
`tags` text NOT NULL,
`modifier` varchar(50) NOT NULL,
`creator` varchar(50) NOT NULL,
`modified` varchar(12) NOT NULL,
`created` varchar(12) NOT NULL,
`version` int(11) NOT NULL,
`epoch_modified` int(15) NOT NULL,
`epoch_created` int(15) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `tiddler_revision`
--

CREATE TABLE `tiddler_revision` (
`id` int(11) NOT NULL auto_increment,
`title` text NOT NULL,
`body` text NOT NULL,
`fields` text NOT NULL,
`modified` varchar(12) NOT NULL,
`modifier` varchar(50) NOT NULL,
`revision` int(11) NOT NULL,
`tags` text NOT NULL,
`tiddler_id` int(11) NOT NULL,
`epoch_modified` int(15) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `tiddly_wiki_entry`
--

CREATE TABLE `tiddly_wiki_entry` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`body` text NOT NULL,
`fields` text NOT NULL,
`modified` varchar(128) NOT NULL default '',
`created` varchar(128) NOT NULL default '',
`modifier` varchar(255) NOT NULL default '',
`creator` varchar(255) NOT NULL default '',
`version` int(11) NOT NULL default '0',
`tags` varchar(255) NOT NULL default '',
PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `tiddly_wiki_entry_version`
--

CREATE TABLE `tiddly_wiki_entry_version` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`body` text NOT NULL,
`fields` text NOT NULL,
`modified` varchar(128) NOT NULL default '',
`modifier` varchar(255) NOT NULL default '',
`version` int(11) NOT NULL default '0',
`tags` varchar(255) NOT NULL default '',
`oid` int(11) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`empoyee_id` varchar(200) NOT NULL,
PRIMARY KEY  (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
<code><strong>
</strong></code>

Advertisements