Exemple #1
0
        protected override SqlCreate[] GetCreateSchemaScript()
        {
            var t1 = new SqlCreate.Table("jabber_room", true)
                .AddColumn(new SqlCreate.Column("jid", DbType.String, 255).NotNull(true).PrimaryKey(true))
                .AddColumn("title", DbType.String, 255)
                .AddColumn("description", DbType.String, UInt16.MaxValue)
                .AddColumn("subject", DbType.String, 255)
                .AddColumn("instructions", DbType.String, 255)
                .AddColumn("pwd", DbType.String, 255)
                .AddColumn("pwdprotect", DbType.Int32)
                .AddColumn("visible", DbType.Int32)
                .AddColumn("members", DbType.String, UInt16.MaxValue)
                .AddColumn("maxoccupant", DbType.Int32)
                .AddColumn("historycountonenter", DbType.Int32)
                .AddColumn("anonymous", DbType.Int32)
                .AddColumn("logging", DbType.Int32)
                .AddColumn("membersonly", DbType.Int32)
                .AddColumn("usernamesonly", DbType.Int32)
                .AddColumn("moderated", DbType.Int32)
                .AddColumn("persistent", DbType.Int32)
                .AddColumn("presencebroadcastedfrom", DbType.Int32)
                .AddColumn("canchangesubject", DbType.Int32)
                .AddColumn("caninvite", DbType.Int32)
                .AddColumn("canseememberlist", DbType.Int32);

            var t2 = new SqlCreate.Table("jabber_room_history", true)
                .AddColumn(new SqlCreate.Column("id", DbType.Int32).NotNull(true).Autoincrement(true).PrimaryKey(true))
                .AddColumn("jid", DbType.String, 255, true)
                .AddColumn("stamp", DbType.DateTime, true)
                .AddColumn("message", DbType.String, MESSAGE_COLUMN_LEN, true)
                .AddIndex("jabber_room_history_jid", "jid");

            return new[] { t1, t2 };
        }
 protected override SqlCreate[] GetCreateSchemaScript()
 {
     var t1 = new SqlCreate.Table("jabber_vcard", true)
         .AddColumn("jid", DbType.String, 255, true)
         .AddColumn("vcard", DbType.String, UInt16.MaxValue, true)
         .PrimaryKey("jid");
     return new[] { t1 };
 }
 protected override SqlCreate[] GetCreateSchemaScript()
 {
     var t1 = new SqlCreate.Table("jabber_user", true)
         .AddColumn("jid", DbType.String, 255, true)
         .AddColumn("pwd", DbType.String, 255)
         .AddColumn(new SqlCreate.Column("admin", DbType.Int32).NotNull(true).Default(0))
         .PrimaryKey("jid");
     return new[] { t1 };
 }
 protected override SqlCreate[] GetCreateSchemaScript()
 {
     var t1 = new SqlCreate.Table("jabber_private", true)
         .AddColumn("jid", DbType.String, 255, true)
         .AddColumn("tag", DbType.String, 255, true)
         .AddColumn("namespace", DbType.String, 255, true)
         .AddColumn("element", DbType.String, UInt16.MaxValue)
         .PrimaryKey("jid", "tag", "namespace");
     return new[] { t1 };
 }
 protected override SqlCreate[] GetCreateSchemaScript()
 {
     var t1 = new SqlCreate.Table("jabber_roster", true)
         .AddColumn("jid", DbType.String, 255, true)
         .AddColumn("item_jid", DbType.String, 255, true)
         .AddColumn("name", DbType.String, 512)
         .AddColumn(new SqlCreate.Column("subscription", DbType.Int32).NotNull(true).Default(0))
         .AddColumn(new SqlCreate.Column("ask", DbType.Int32).NotNull(true).Default(0))
         .AddColumn("groups", DbType.String, UInt16.MaxValue)
         .PrimaryKey("jid", "item_jid");
     return new[] { t1 };
 }
        protected override SqlCreate[] GetCreateSchemaScript()
        {
            var t1 = new SqlCreate.Table("jabber_archive", true)
                .AddColumn(new SqlCreate.Column("id", DbType.Int32).NotNull(true).PrimaryKey(true).Autoincrement(true))
                .AddColumn("jid", DbType.String, 255, true)
                .AddColumn("stamp", DbType.DateTime, true)
                .AddColumn("message", DbType.String, MESSAGE_COLUMN_LEN)
                .AddIndex("jabber_archive_jid", "jid");

            var t2 = new SqlCreate.Table("jabber_archive_switch", true)
                .AddColumn(new SqlCreate.Column("id", DbType.String, 255).NotNull(true).PrimaryKey(true));

            return new[] { t1, t2 };
        }
        protected override SqlCreate[] GetCreateSchemaScript()
        {
            var t1 = new SqlCreate.Table("jabber_offmessage", true)
                .AddColumn(new SqlCreate.Column("id", DbType.Int32).NotNull(true).Autoincrement(true).PrimaryKey(true))
                .AddColumn("jid", DbType.String, 255, true)
                .AddColumn("message", DbType.String, MESSAGE_COLUMN_LEN)
                .AddIndex("jabber_offmessage_jid", "jid");

            var t2 = new SqlCreate.Table("jabber_offpresence", true)
                .AddColumn(new SqlCreate.Column("id", DbType.Int32).NotNull(true).Autoincrement(true).PrimaryKey(true))
                .AddColumn("jid_to", DbType.String, 255, true)
                .AddColumn("jid_from", DbType.String, 255, false)
                .AddColumn(new SqlCreate.Column("type", DbType.Int32).NotNull(true).Default(0))
                .AddIndex("jabber_offpresence_to", "jid_to");

            var t3 = new SqlCreate.Table("jabber_offactivity", true)
                .AddColumn(new SqlCreate.Column("jid", DbType.String, 255).NotNull(true).PrimaryKey(true))
                .AddColumn("logout", DbType.DateTime)
                .AddColumn("status", DbType.String, 255);

            return new[] { t1, t2, t3 };
        }
Exemple #8
0
 public void SqlCreateTableTest()
 {
     var q = new SqlCreate.Table("t1")
             .AddColumn("c1", DbType.String, 255);
     Assert.AreEqual("create table t1 (c1 string(255) null);\r\n", q.ToString());
 }