diff options
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteUserData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserData.cs | 104 |
1 files changed, 1 insertions, 103 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 0fddc42..ae3cb72 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -93,10 +93,6 @@ namespace OpenSim.Data.SQLite | |||
93 | 93 | ||
94 | Assembly assem = GetType().Assembly; | 94 | Assembly assem = GetType().Assembly; |
95 | Migration m = new Migration(g_conn, assem, "UserStore"); | 95 | Migration m = new Migration(g_conn, assem, "UserStore"); |
96 | |||
97 | // TODO: remove this after rev 6000 | ||
98 | TestTables(conn, m); | ||
99 | |||
100 | m.Update(); | 96 | m.Update(); |
101 | 97 | ||
102 | 98 | ||
@@ -114,17 +110,7 @@ namespace OpenSim.Data.SQLite | |||
114 | da.Fill(ds.Tables["users"]); | 110 | da.Fill(ds.Tables["users"]); |
115 | 111 | ||
116 | setupUserFriendsCommands(daf, conn); | 112 | setupUserFriendsCommands(daf, conn); |
117 | try | 113 | daf.Fill(ds.Tables["userfriends"]); |
118 | { | ||
119 | daf.Fill(ds.Tables["userfriends"]); | ||
120 | } | ||
121 | catch (SqliteSyntaxException) | ||
122 | { | ||
123 | m_log.Info("[USER DB]: userfriends table not found, creating.... "); | ||
124 | InitDB(conn); | ||
125 | daf.Fill(ds.Tables["userfriends"]); | ||
126 | } | ||
127 | |||
128 | } | 114 | } |
129 | 115 | ||
130 | return; | 116 | return; |
@@ -920,94 +906,6 @@ namespace OpenSim.Data.SQLite | |||
920 | 906 | ||
921 | } | 907 | } |
922 | 908 | ||
923 | /// <summary> | ||
924 | /// | ||
925 | /// </summary> | ||
926 | /// <param name="conn"></param> | ||
927 | private static void InitDB(SqliteConnection conn) | ||
928 | { | ||
929 | string createUsers = SQLiteUtil.defineTable(createUsersTable()); | ||
930 | string createFriends = SQLiteUtil.defineTable(createUserFriendsTable()); | ||
931 | |||
932 | SqliteCommand pcmd = new SqliteCommand(createUsers, conn); | ||
933 | SqliteCommand fcmd = new SqliteCommand(createFriends, conn); | ||
934 | |||
935 | conn.Open(); | ||
936 | |||
937 | try | ||
938 | { | ||
939 | |||
940 | pcmd.ExecuteNonQuery(); | ||
941 | } | ||
942 | catch (Exception) | ||
943 | { | ||
944 | m_log.Info("[USER DB]: users table already exists"); | ||
945 | } | ||
946 | |||
947 | try | ||
948 | { | ||
949 | fcmd.ExecuteNonQuery(); | ||
950 | } | ||
951 | catch (Exception) | ||
952 | { | ||
953 | m_log.Info("[USER DB]: userfriends table already exists"); | ||
954 | } | ||
955 | |||
956 | conn.Close(); | ||
957 | } | ||
958 | |||
959 | /// <summary> | ||
960 | /// | ||
961 | /// </summary> | ||
962 | /// <param name="conn"></param> | ||
963 | /// <param name="m"></param> | ||
964 | /// <returns></returns> | ||
965 | private static bool TestTables(SqliteConnection conn, Migration m) | ||
966 | { | ||
967 | SqliteCommand cmd = new SqliteCommand(userSelect, conn); | ||
968 | // SqliteCommand fcmd = new SqliteCommand(userFriendsSelect, conn); | ||
969 | SqliteDataAdapter pDa = new SqliteDataAdapter(cmd); | ||
970 | SqliteDataAdapter fDa = new SqliteDataAdapter(cmd); | ||
971 | |||
972 | DataSet tmpDS = new DataSet(); | ||
973 | DataSet tmpDS2 = new DataSet(); | ||
974 | |||
975 | try | ||
976 | { | ||
977 | pDa.Fill(tmpDS, "users"); | ||
978 | fDa.Fill(tmpDS2, "userfriends"); | ||
979 | } | ||
980 | catch (SqliteSyntaxException) | ||
981 | { | ||
982 | m_log.Info("[USER DB]: SQLite Database doesn't exist... creating"); | ||
983 | return false; | ||
984 | } | ||
985 | |||
986 | if (m.Version == 0) | ||
987 | m.Version = 1; | ||
988 | |||
989 | return true; | ||
990 | |||
991 | // conn.Open(); | ||
992 | // try | ||
993 | // { | ||
994 | // cmd = new SqliteCommand("select webLoginKey from users limit 1;", conn); | ||
995 | // cmd.ExecuteNonQuery(); | ||
996 | // } | ||
997 | // catch (SqliteSyntaxException) | ||
998 | // { | ||
999 | // cmd = new SqliteCommand("alter table users add column webLoginKey text default '00000000-0000-0000-0000-000000000000';", conn); | ||
1000 | // cmd.ExecuteNonQuery(); | ||
1001 | // pDa.Fill(tmpDS, "users"); | ||
1002 | // } | ||
1003 | // finally | ||
1004 | // { | ||
1005 | // conn.Close(); | ||
1006 | // } | ||
1007 | |||
1008 | // return true; | ||
1009 | } | ||
1010 | |||
1011 | override public void ResetAttachments(LLUUID userID) | 909 | override public void ResetAttachments(LLUUID userID) |
1012 | { | 910 | { |
1013 | } | 911 | } |