Latest Database design for ccTiddly

erm2.jpg

and the sql :

-- phpMyAdmin SQL Dump
-- version 2.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 09, 2007 at 01:32 PM
-- Server version: 5.0.41
-- PHP Version: 5.2.2

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `permissions`
--

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

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

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

--
-- Dumping data for table `admin_of_instance`
--

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

--
-- Table structure for table `group`
--

CREATE TABLE `group` (
`name` varchar(50) NOT NULL,
`desc` mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `group`
--

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

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

CREATE TABLE `group_membership` (
`user_id` varchar(255) NOT NULL,
`group_name` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `group_membership`
--

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

--
-- 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,
`session_expire` int(10) 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,
`tiddlywiki_type` varchar(30) NOT NULL,
`default_anonymous_perm` varchar(4) NOT NULL,
`default_user_perm` varchar(4) NOT NULL,
`rss_group` varchar(50) NOT NULL,
`markup_group` varchar(50) NOT NULL,
PRIMARY KEY  (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `instance`
--

INSERT INTO `instance` (`name`, `lang`, `keep_revision`, `require_login`, `session_expire`, `tag_tiddler_with_modifier`, `char_set`, `hashseed`, `debug`, `status`, `tiddlywiki_type`, `default_anonymous_perm`, `default_user_perm`, `rss_group`, `markup_group`) VALUES
('permissions', 'en', 1, 0, 0, 0, 'utf8', '', 0, '', 'TiddlyWiki', '', '', '', '');

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

--
-- Table structure for table `login_session`
--

CREATE TABLE `login_session` (
`user_id` varchar(255) NOT NULL,
`session_token` varchar(150) NOT NULL COMMENT 'username+password+time',
`expire` int(20) NOT NULL,
`ip` varchar(15) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `login_session`
--

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

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
`read` int(1) NOT NULL,
`insert` int(1) NOT NULL,
`edit` int(1) NOT NULL,
`delete` int(1) NOT NULL,
`group_name` varchar(50) NOT NULL,
`instance_name` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permissions`
--

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

--
-- 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(255) NOT NULL,
`creator` varchar(255) NOT NULL,
`modified` varchar(12) NOT NULL,
`created` varchar(12) NOT NULL,
`version` int(11) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tiddler`
--

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

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

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

--
-- Dumping data for table `tiddler_revision`
--

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

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

CREATE TABLE `user` (
`id` varchar(255) NOT NULL,
`password` varchar(50) NOT NULL,
`short_name` varchar(50) NOT NULL,
`long_name` varchar(100) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `user`
--

Advertisements

4 thoughts on “Latest Database design for ccTiddly

  1. I can’t spot any field for a tiddler revision’s edit summary (to specify what’s been changed).
    This sort of thing proved to be very helpful (e.g. in SVN or MediaWiki) so you don’t have to call up the diff for every single edit…

  2. Thanks Fred,

    Great to get some feedback, we already have the tiddler_revision table which stores the previous versions, are you asking for an additional field on that table which stores the changes between the stored revision and the one previous to that?

    If you could clarify slightly I will try to incorporate the changes into the next database design. Its actually already changed quite a bit since publishing to accommodate some pretty cool functionality that I am working on at the second.

    In short we are going to introduce something called master instances, which are going to be like templates that can persist across all instances.

    I am hoping to get a blog post out describing the details in the next few weeks.

  3. What I meant was an additional field for the user to summarize (or comment on) the respective revision’s changes.
    For example, take a look at TWo’s list of recent changes:
    http://www.tiddlywiki.org/wiki/Special:Recentchanges
    It works similarly on Wikipedia (since both are powered by the MediaWiki engine):
    http://en.wikipedia.org/wiki/Special:Recentchanges
    Each individual page’s history also shows the respective edit summaries:
    http://en.wikipedia.org/w/index.php?title=TiddlyWiki&action=history

    On another note, I really like that you’re sharing these details for this project.
    However, I’d love to see is a more general description of the overall concept – e.g. a feature list, whether it will all be server-side or require a (non-invasive?) plugin etc.

    By the way: Saq has quite a lot of experience with this kinda stuff (due to his work on MTS); he could probably provide a lot of good ideas, and probably also some “best practices”.

Comments are closed.