Esempio n. 1
0
        /// <summary>
        /// Drops the <see cref="PrimaryKeyConstraint"/> with the specified <paramref name="name"/>.
        /// </summary>
        /// <param name="name">The constraint's name.</param>
        /// <returns>The constraint.</returns>
        public PrimaryKeyConstraint DropPrimaryKeyConstraint(string name)
        {
            var c = new PrimaryKeyConstraint(this, name, Modifier.Drop);

            Database.MigrationSteps.Enqueue(c);
            return(c);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a primary key <see cref="Constraint"/> to this <see cref="Table"/>.
        /// </summary>
        /// <param name="name">The name of the constraint.</param>
        /// <param name="columnNames">The column name(s) that make(s) up the primary key.</param>
        /// <returns>The primary key constraint.</returns>
        public PrimaryKeyConstraint AddPrimaryKeyConstraint(string name, string[] columnNames)
        {
            var c = new PrimaryKeyConstraint(this, name, Modifier.Add)
            {
                ColumnNames = columnNames
            };

            Database.MigrationSteps.Enqueue(c);
            return(c);
        }
Esempio n. 3
0
 /// <summary>
 /// Drops the <see cref="PrimaryKeyConstraint"/> with the specified <paramref name="name"/>.
 /// </summary>
 /// <param name="name">The constraint's name.</param>
 /// <returns>The constraint.</returns>
 public PrimaryKeyConstraint DropPrimaryKeyConstraint(string name)
 {
     var c = new PrimaryKeyConstraint(this, name, Modifier.Drop);
     Database.MigrationSteps.Enqueue(c);
     return c;
 }
Esempio n. 4
0
        /// <summary>
        /// Adds a primary key <see cref="Constraint"/> to this <see cref="Table"/>.
        /// </summary>
        /// <param name="name">The name of the constraint.</param>
        /// <param name="columnNames">The column name(s) that make(s) up the primary key.</param>
        /// <returns>The primary key constraint.</returns>
        public PrimaryKeyConstraint AddPrimaryKeyConstraint(string name, string[] columnNames)
        {
            var c = new PrimaryKeyConstraint(this, name, Modifier.Add)
            {
                ColumnNames = columnNames
            };

            Database.MigrationSteps.Enqueue(c);
            return c;
        }