From 171c239dc64b6d78c02fdf2f6316d607b2a4d6dc Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 28 Jul 2006 12:34:38 +0000 Subject: add sqlite mapping --- .../protected/App_Data/Sqlite/category.xml | 109 ++++++++++++++ .../protected/App_Data/Sqlite/projects.xml | 159 +++++++++++++++++++++ .../protected/App_Data/Sqlite/reports.xml | 87 +++++++++++ .../protected/App_Data/Sqlite/time-entry.xml | 100 +++++++++++++ .../protected/App_Data/Sqlite/time-tracker.db | Bin 0 -> 32768 bytes .../protected/App_Data/Sqlite/time-tracker.db.bak | Bin 0 -> 32768 bytes .../protected/App_Data/Sqlite/users.xml | 137 ++++++++++++++++++ 7 files changed, 592 insertions(+) create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/category.xml create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/projects.xml create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/reports.xml create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/time-entry.xml create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db.bak create mode 100644 demos/time-tracker/protected/App_Data/Sqlite/users.xml (limited to 'demos/time-tracker/protected/App_Data/Sqlite') diff --git a/demos/time-tracker/protected/App_Data/Sqlite/category.xml b/demos/time-tracker/protected/App_Data/Sqlite/category.xml new file mode 100644 index 00000000..d89a517f --- /dev/null +++ b/demos/time-tracker/protected/App_Data/Sqlite/category.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + INSERT INTO categories + (Name, ProjectID, Abbreviation, EstimateDuration) + VALUES(#Name#, #ProjectID#, #Abbreviation#, #EstimateDuration#) + + select LAST_INSERT_ROWID() as value + + + + + + + + + DELETE FROM categories WHERE CategoryID = #value# + + + + + + + + UPDATE categories SET + Abbreviation = #Abbreviation#, + EstimateDuration = #EstimateDuration#, + Name = #Name#, + ProjectId = #ProjectID# + WHERE + CategoryID = #ID# + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/Sqlite/projects.xml b/demos/time-tracker/protected/App_Data/Sqlite/projects.xml new file mode 100644 index 00000000..e5f52887 --- /dev/null +++ b/demos/time-tracker/protected/App_Data/Sqlite/projects.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + INSERT INTO projects + (Name, Description, CreationDate, EstimateDuration, CompletionDate, CreatorID, ManagerID) + VALUES + (#Name#, #Description#, php('date', 'Y-m-d H:i:s'), #EstimateDuration#, + #CompletionDate, typeHandler=DateTime#, + #CreatorUserName#, #ManagerUserName#) + + select LAST_INSERT_ROWID() as value + + + + + + + + + + + + + + + UPDATE projects SET Disabled = 1 WHERE ProjectID = #value# + + + + + + INSERT INTO project_members (UserID, ProjectID) + VALUES(#username#, #project#) + + + + DELETE FROM project_members WHERE ProjectID = #project# AND UserID = #username# + + + + UPDATE projects + SET + CompletionDate = #CompletionDate, typeHandler=DateTime#, + Description = #Description#, + EstimateDuration = #EstimateDuration#, + ManagerId =#ManagerUserName#, + Name = #Name# + WHERE + ProjectID = #ID# + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/Sqlite/reports.xml b/demos/time-tracker/protected/App_Data/Sqlite/reports.xml new file mode 100644 index 00000000..b5997f1f --- /dev/null +++ b/demos/time-tracker/protected/App_Data/Sqlite/reports.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/Sqlite/time-entry.xml b/demos/time-tracker/protected/App_Data/Sqlite/time-entry.xml new file mode 100644 index 00000000..1d7fec37 --- /dev/null +++ b/demos/time-tracker/protected/App_Data/Sqlite/time-entry.xml @@ -0,0 +1,100 @@ + + + + + INSERT INTO time_entry( + EntryCreated, + Duration, + Description, + CategoryID, + EntryDate, + CreatorID, + UserID + ) + VALUES( + php('date', 'Y-m-d H:i:s'), + #Duration#, + #Description#, + #Category.ID#, + #ReportDate, typeHandler=DateTime#, + #CreatorUserName#, + #Username# + ) + + select LAST_INSERT_ROWID() as value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM time_entry WHERE EntryID = #value# + + + + + + UPDATE time_entry SET + Duration = #Duration#, + Description = #Description#, + CategoryID = #Category.ID#, + EntryDate = #ReportDate, typeHandler=DateTime#, + UserID = #Username# + WHERE + EntryID = #ID# + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db b/demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db new file mode 100644 index 00000000..124bbeba Binary files /dev/null and b/demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db differ diff --git a/demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db.bak b/demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db.bak new file mode 100644 index 00000000..124bbeba Binary files /dev/null and b/demos/time-tracker/protected/App_Data/Sqlite/time-tracker.db.bak differ diff --git a/demos/time-tracker/protected/App_Data/Sqlite/users.xml b/demos/time-tracker/protected/App_Data/Sqlite/users.xml new file mode 100644 index 00000000..74b33b2c --- /dev/null +++ b/demos/time-tracker/protected/App_Data/Sqlite/users.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + users (Username, Password, EmailAddress) + VALUES + (#user.Name#, #password#, #user.EmailAddress#) + + + + UPDATE users SET Disabled = 1 WHERE username = #value# + + + + INSERT INTO + signon (SessionToken, Username, LastSignOnDate) + VALUES + (#token#, #username#, php('date', 'Y-m-d H:i:s')) + + + + + + UPDATE signon SET LastSignOnDate = php('date', 'Y-m-d H:i:s') + WHERE SessionToken = #value# + + + + DELETE FROM user_roles WHERE UserID = #Name# + + + + INSERT INTO user_roles (UserID, RoleType) + VALUES(#username#, #role#) + + + + UPDATE users + SET EmailAddress = #EmailAddress# + WHERE Username = #Name# + + + + UPDATE users + SET EmailAddress = #user.EmailAddress#, Password=#password# + WHERE Username = #user.Name# + + + + DELETE FROM signon WHERE Username = #value# + + + + DELETE FROM signon + + + \ No newline at end of file -- cgit v1.2.3