Пример #1
0
        public override Column Build(TableBuilder table, ISchemaProvider schemaProvider, IList <PostProcess> posts)
        {
            Column col = base.Build(table, schemaProvider, posts);

            posts.Add(new PostProcess(
                          delegate()
            {
                string fkName = "FK_" +
                                SchemaUtils.Normalize(table.Name) + "_" +
                                SchemaUtils.Normalize(col.Name) + "_" +
                                SchemaUtils.Normalize(targetColName);

                schemaProvider.AddForeignKeyConstraint(
                    table.Name, fkName, col.Name,
                    targetTable, targetColName);
            }));

            return(col);
        }
Пример #2
0
 public void Normalize_RemoveMark()
 {
     Assert.AreEqual("KEY", SchemaUtils.Normalize("`Key`"));
 }
Пример #3
0
 public void Normalize_RemoveBrackets()
 {
     Assert.AreEqual("USER", SchemaUtils.Normalize("[user]"));
 }
Пример #4
0
 public void Normalize_WontChangeValidIdentifier()
 {
     Assert.AreEqual("NAME", SchemaUtils.Normalize("Name"));
 }