diff options
author | Sean Dague | 2008-08-27 19:24:46 +0000 |
---|---|---|
committer | Sean Dague | 2008-08-27 19:24:46 +0000 |
commit | 066715415a89cf444ec442c8f5cf82dc65020438 (patch) | |
tree | ef8963c0882bf426b74dc42f6e23171c86ab4c6d /OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |
parent | we are now past change 6000, so getting rid of pre-Migration cruft (diff) | |
download | opensim-SC-066715415a89cf444ec442c8f5cf82dc65020438.zip opensim-SC-066715415a89cf444ec442c8f5cf82dc65020438.tar.gz opensim-SC-066715415a89cf444ec442c8f5cf82dc65020438.tar.bz2 opensim-SC-066715415a89cf444ec442c8f5cf82dc65020438.tar.xz |
getting rid of pre-Migration cruft
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteInventoryStore.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 125b6e7..4c35ac2 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -77,9 +77,6 @@ namespace OpenSim.Data.SQLite | |||
77 | 77 | ||
78 | Assembly assem = GetType().Assembly; | 78 | Assembly assem = GetType().Assembly; |
79 | Migration m = new Migration(conn, assem, "InventoryStore"); | 79 | Migration m = new Migration(conn, assem, "InventoryStore"); |
80 | // TODO: remove this line after changeset 6000 | ||
81 | TestTables(conn, m); | ||
82 | |||
83 | m.Update(); | 80 | m.Update(); |
84 | 81 | ||
85 | SqliteCommand itemsSelectCmd = new SqliteCommand(invItemsSelect, conn); | 82 | SqliteCommand itemsSelectCmd = new SqliteCommand(invItemsSelect, conn); |
@@ -828,113 +825,5 @@ namespace OpenSim.Data.SQLite | |||
828 | row["UUID"] = Util.ToRawUuidString(folder.ID); | 825 | row["UUID"] = Util.ToRawUuidString(folder.ID); |
829 | row["parentID"] = Util.ToRawUuidString(folder.ParentID); | 826 | row["parentID"] = Util.ToRawUuidString(folder.ParentID); |
830 | } | 827 | } |
831 | |||
832 | /*********************************************************************** | ||
833 | * | ||
834 | * Test and Initialization code | ||
835 | * | ||
836 | **********************************************************************/ | ||
837 | |||
838 | /// <summary> | ||
839 | /// | ||
840 | /// </summary> | ||
841 | /// <param name="conn"></param> | ||
842 | // private static void InitDB(SqliteConnection conn) | ||
843 | // { | ||
844 | // string createInventoryItems = defineTable(createInventoryItemsTable()); | ||
845 | // string createInventoryFolders = defineTable(createInventoryFoldersTable()); | ||
846 | |||
847 | // SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn); | ||
848 | // SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn); | ||
849 | |||
850 | // pcmd.ExecuteNonQuery(); | ||
851 | // scmd.ExecuteNonQuery(); | ||
852 | // } | ||
853 | |||
854 | /// <summary> | ||
855 | /// | ||
856 | /// </summary> | ||
857 | /// <param name="conn"></param> | ||
858 | /// <param name="m"></param> | ||
859 | /// <returns></returns> | ||
860 | private static bool TestTables(SqliteConnection conn, Migration m) | ||
861 | { | ||
862 | SqliteCommand invItemsSelectCmd = new SqliteCommand(invItemsSelect, conn); | ||
863 | SqliteDataAdapter pDa = new SqliteDataAdapter(invItemsSelectCmd); | ||
864 | SqliteCommand invFoldersSelectCmd = new SqliteCommand(invFoldersSelect, conn); | ||
865 | SqliteDataAdapter sDa = new SqliteDataAdapter(invFoldersSelectCmd); | ||
866 | |||
867 | DataSet tmpDS = new DataSet(); | ||
868 | try | ||
869 | { | ||
870 | pDa.Fill(tmpDS, "inventoryitems"); | ||
871 | sDa.Fill(tmpDS, "inventoryfolders"); | ||
872 | } | ||
873 | catch (SqliteSyntaxException) | ||
874 | { | ||
875 | m_log.Info("[INVENTORY DB]: SQLite Database doesn't exist... creating"); | ||
876 | return false; | ||
877 | } | ||
878 | |||
879 | if (m.Version == 0) | ||
880 | m.Version = 1; | ||
881 | |||
882 | return true; | ||
883 | |||
884 | // pDa.Fill(tmpDS, "inventoryitems"); | ||
885 | // sDa.Fill(tmpDS, "inventoryfolders"); | ||
886 | |||
887 | // // Very clumsy way of checking whether we need to upgrade the database table version and then updating. Only | ||
888 | // // putting up with this because this code should be blown away soon by nhibernate... | ||
889 | // conn.Open(); | ||
890 | |||
891 | // SqliteCommand cmd; | ||
892 | // try | ||
893 | // { | ||
894 | // cmd = new SqliteCommand("select salePrice from inventoryitems limit 1;", conn); | ||
895 | // cmd.ExecuteNonQuery(); | ||
896 | // } | ||
897 | // catch (SqliteSyntaxException) | ||
898 | // { | ||
899 | // m_log.Info("[INVENTORY DB]: Upgrading sqlite inventory database to version 2"); | ||
900 | |||
901 | // cmd = new SqliteCommand("alter table inventoryitems add column salePrice integer default 99;", conn); | ||
902 | // cmd.ExecuteNonQuery(); | ||
903 | // cmd = new SqliteCommand("alter table inventoryitems add column saleType integer default 0;", conn); | ||
904 | // cmd.ExecuteNonQuery(); | ||
905 | // cmd = new SqliteCommand("alter table inventoryitems add column creationDate integer default 2000;", conn); | ||
906 | // cmd.ExecuteNonQuery(); | ||
907 | // cmd = new SqliteCommand("alter table inventoryitems add column groupID varchar(255) default '00000000-0000-0000-0000-000000000000';", conn); | ||
908 | // cmd.ExecuteNonQuery(); | ||
909 | // cmd = new SqliteCommand("alter table inventoryitems add column groupOwned integer default 0;", conn); | ||
910 | // cmd.ExecuteNonQuery(); | ||
911 | // cmd = new SqliteCommand("alter table inventoryitems add column flags integer default 0;", conn); | ||
912 | // cmd.ExecuteNonQuery(); | ||
913 | |||
914 | // pDa.Fill(tmpDS, "inventoryitems"); | ||
915 | // } | ||
916 | // finally | ||
917 | // { | ||
918 | // conn.Close(); | ||
919 | // } | ||
920 | |||
921 | // foreach (DataColumn col in createInventoryItemsTable().Columns) | ||
922 | // { | ||
923 | // if (! tmpDS.Tables["inventoryitems"].Columns.Contains(col.ColumnName)) | ||
924 | // { | ||
925 | // m_log.Info("[INVENTORY DB]: Missing required column:" + col.ColumnName); | ||
926 | // return false; | ||
927 | // } | ||
928 | // } | ||
929 | // foreach (DataColumn col in createInventoryFoldersTable().Columns) | ||
930 | // { | ||
931 | // if (! tmpDS.Tables["inventoryfolders"].Columns.Contains(col.ColumnName)) | ||
932 | // { | ||
933 | // m_log.Info("[INVENTORY DB]: Missing required column:" + col.ColumnName); | ||
934 | // return false; | ||
935 | // } | ||
936 | // } | ||
937 | // return true; | ||
938 | } | ||
939 | } | 828 | } |
940 | } | 829 | } |