BEGIN TRANSACTION;
CREATE TABLE Child (ChildID INTEGER PRIMARY KEY, PersonID numeric, FamilyID numeric, Parent1ID numeric, Parent1Rel TEXT, Parent2ID numeric, Parent2Rel TEXT, NoteID numeric, SourceID numeric);
CREATE TABLE Family (FamilyID INTEGER PRIMARY KEY, UserID numeric, PrimeID numeric, PartnerID numeric, NoteID numeric, SourceID numeric);
CREATE TABLE FamilyAttach (AttachID INTEGER PRIMARY KEY, FamilyID numeric, Filename TEXT, Fileinfo TEXT, Detail TEXT, SourceID numeric);
CREATE TABLE FamilyFact (FactID INTEGER PRIMARY KEY, Type TEXT, FamilyID numeric, Detail TEXT, Place TEXT, Date TEXT, Calendar TEXT, Surety TEXT, NoteID numeric, SourceID numeric);
CREATE TABLE Name (NameID INTEGER PRIMARY KEY, Type TEXT, DisplayAs TEXT, IsPreferred TEXT, PersonID numeric, Given TEXT, Surname TEXT, Title TEXT, Suffix TEXT, Familiar TEXT, Surety TEXT, Date TEXT, Calendar TEXT, NoteID numeric, SourceID numeric);
CREATE TABLE Note (NoteID INTEGER PRIMARY KEY, Detail TEXT, Date TEXT, Calendar TEXT);
CREATE TABLE Person (PersonID INTEGER PRIMARY KEY, UserID numeric, BirthSex TEXT, NoteID numeric, SourceID numeric, IsPrivate TEXT);
CREATE TABLE PersonalAttach (AttachID INTEGER PRIMARY KEY, PersonID numeric, Filename TEXT, Fileinfo TEXT, Detail TEXT, SourceID numeric);
CREATE TABLE PersonalFact (FactID INTEGER PRIMARY KEY, Type TEXT, PersonID numeric, Detail TEXT, Place TEXT, Date TEXT, Calendar TEXT, Surety TEXT, NoteID numeric, SourceID numeric);
CREATE TABLE Source (SourceID INTEGER PRIMARY KEY, Title TEXT, Location TEXT, Author TEXT, Detail TEXT, Date TEXT, Calendar TEXT);
CREATE INDEX NoteIndex ON Note(Detail ASC);
CREATE INDEX SourceIndex ON Source(Detail ASC);
COMMIT;
