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

            Database.MigrationSteps.EnqueueBefore(c, (e => e == this));
            return(c);
        }
Beispiel #2
0
        /// <summary>
        /// Drops the <see cref="DefaultConstraint"/> of the specified <paramref name="columnName"/>.
        /// </summary>
        /// <param name="columnName">Name of the column.</param>
        /// <returns>The constraint.</returns>
        public DefaultConstraint DropDefaultConstraintByColumnName(string columnName)
        {
            var c = new DefaultConstraint(this, null, Modifier.Drop)
            {
                ColumnName = columnName
            };

            Database.MigrationSteps.EnqueueBefore(c, (e => e == this));
            return(c);
        }
Beispiel #3
0
        /// <summary>
        /// Adds the default <see cref="Constraint"/> to this <see cref="Table"/>.
        /// </summary>
        /// <param name="name">The constraint name.</param>
        /// <param name="columnName">The name of the column that has the defaul constraint.</param>
        /// <param name="value">The default value.</param>
        /// <returns>The default constraint.</returns>
        public DefaultConstraint AddDefaultConstraint(string name, string columnName, object value)
        {
            var c = new DefaultConstraint(this, name, Modifier.Add)
            {
                ColumnName = columnName,
                Value      = value
            };

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