public override void AddForeignKey(
     string name,
     SchemaQualifiedObjectName primaryTable,
     string[] primaryColumns,
     SchemaQualifiedObjectName refTable,
     string[] refColumns,
     ForeignKeyConstraint onDeleteConstraint = ForeignKeyConstraint.NoAction,
     ForeignKeyConstraint onUpdateConstraint = ForeignKeyConstraint.NoAction)
 {
     throw new NotSupportedException("SQLite does not support foreign keys");
 }
Exemplo n.º 2
0
 public void AddForeignKey(string name,
                           SchemaQualifiedObjectName primaryTable, string primaryColumn,
                           SchemaQualifiedObjectName refTable, string refColumn,
                           ForeignKeyConstraint onDeleteConstraint = ForeignKeyConstraint.NoAction,
                           ForeignKeyConstraint onUpdateConstraint = ForeignKeyConstraint.NoAction)
 {
     AddForeignKey(name,
                   primaryTable, new[] { primaryColumn },
                   refTable, new[] { refColumn },
                   onDeleteConstraint, onUpdateConstraint);
 }
Exemplo n.º 3
0
        public virtual void AddForeignKey(string name,
                                          SchemaQualifiedObjectName primaryTable, string[] primaryColumns,
                                          SchemaQualifiedObjectName refTable, string[] refColumns,
                                          ForeignKeyConstraint onDeleteConstraint = ForeignKeyConstraint.NoAction,
                                          ForeignKeyConstraint onUpdateConstraint = ForeignKeyConstraint.NoAction)
        {
            string onDeleteConstraintResolved = fkActionMap.GetSqlOnDelete(onDeleteConstraint);
            string onUpdateConstraintResolved = fkActionMap.GetSqlOnUpdate(onUpdateConstraint);

            string sql = GetSqlAddForeignKey(name, primaryTable, primaryColumns, refTable, refColumns, onUpdateConstraintResolved, onDeleteConstraintResolved);

            ExecuteNonQuery(sql);
        }
Exemplo n.º 4
0
        public override void AddForeignKey(string name, SchemaQualifiedObjectName primaryTable, string[] primaryColumns, SchemaQualifiedObjectName refTable, string[] refColumns, ForeignKeyConstraint onDeleteConstraint = ForeignKeyConstraint.NoAction, ForeignKeyConstraint onUpdateConstraint = ForeignKeyConstraint.NoAction)
        {
            if (onUpdateConstraint != ForeignKeyConstraint.NoAction)
            {
                throw new NotSupportedException("Oracle does not support actions when updating a foreign key");
            }

            if (onDeleteConstraint == ForeignKeyConstraint.SetDefault)
            {
                throw new NotSupportedException("Oracle does not support SET DEFAULT when deleting a record referenced by a foreign key");
            }

            base.AddForeignKey(name, primaryTable, primaryColumns, refTable, refColumns, onDeleteConstraint, onUpdateConstraint);
        }