monotone

monotone Mtn Source Tree

Root/schema_migration.hh

1#ifndef __SCHEMA_MIGRATION__
2#define __SCHEMA_MIGRATION__
3
4// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13#include <string>
14#include <vector>
15
16// this file knows how to migrate schema databases. the general strategy is
17// to hash each schema we ever use, and make a list of the SQL commands
18// required to get from one hash value to the next. when you do a
19// migration, the migrator locates your current db's state on the list and
20// then runs all the migration functions between that point and the target
21// of the migration.
22
23struct sqlite3;
24class app_state;
25
26void calculate_schema_id(sqlite3 *sql, std::string & id);
27void migrate_monotone_schema(sqlite3 *sql, app_state *app);
28
29// Local Variables:
30// mode: C++
31// fill-column: 76
32// c-file-style: "gnu"
33// indent-tabs-mode: nil
34// End:
35// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
36
37#endif // __SCHEMA_MIGRATION__

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status