예제 #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"));
 }