Improving Things Continues

1245447680|%e %B %Y
tags: api database dump

Today I worked on some really nice thing in Wikidot, which finally makes initial database dump more organized. Instead of one big single-wiki-dump.sql there are 6 files:

  • 0-schema.sql
  • 1-users.sql
  • 2-licenses.sql
  • 3-themes.sql
  • 4-main-site.sql
  • 5-template-site.sql

The fact that they are split is a bit artificial, because they are all executed at once, but still it is nice to have 6 shorter files than one long. In case we want to add a new license to the initial dump, we don't need to search and be really careful to not break anything else. We just edit licenses file.

Even more important thing is removing pages from initial dump. As pages are quite a complex thing in Wikidot removing them from SQL dump decreases the size (and complexness) of it drastically. But we still need to populate the first wiki. And this is done with API methods and a nice directory structure:

  • files/dump/sites
    • www
      • start.page
      • admin.manage.page
      • account.you.page
      • auth.login.page
    • template
      • start.page
      • admin.manage.page

Site is directory, page is a file in such a directory. A special script (that is called by make) browses the files/dump/sites directory and call page.save API method on each page, supplying the content of the file as the wiki source of the page to be saved. Such a one saving creates many database objects:

  • page
  • page_revision
  • page_source
  • page_metadata
  • category (if does not exist yet)

So as you see, we benefit in two ways:

  1. initial database dump is easier to understand and modify
  2. adding pages to initial dump is much much easier

This still needs some polishing, but is a lot better than before.

Previous post: Site Update

Next post: Bug Killing Day

Comments

feature request?
dennyhalimdennyhalim 1247872977|%e %b %Y, %H:%M %Z|agohover

where should we post feature request?
is anything here ever considered:
http://community.wikidot.com/forum/c-11/new-features-and-ideas
??
tia

Reply  |  Options
Unfold feature request? by dennyhalimdennyhalim, 1247872977|%e %b %Y, %H:%M %Z|agohover
Re: feature request?
GabrysGabrys 1247905855|%e %b %Y, %H:%M %Z|agohover

Danny,

We want to finally merge Wikidot.com software and the open source version, so anything added to .com (requested from the community for example) will be included in the open source version (unless it's very very specific).

So yes, you can request features there.


Piotr Gabryjeluk, Wikidot Inc.
visit my blog

Last edited on 1247920604|%e %b %Y, %H:%M %Z|agohover By Gabrys + Show more
Reply  |  Options
Unfold Re: feature request? by GabrysGabrys, 1247905855|%e %b %Y, %H:%M %Z|agohover
pieterhpieterh 1247920261|%e %b %Y, %H:%M %Z|agohover

This is a good question and deserves a response. I'm going to blog about it now.

Thanks.

Reply  |  Options
Unfold by pieterhpieterh, 1247920261|%e %b %Y, %H:%M %Z|agohover
Add a New Comment
Page tags: api database dump
page_revision: 3, last_edited: 1245458379|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License