@@ -343,17 +343,6 @@ public virtual void AddTable(string name, params IDbField[] columns)
343343 /// </example>
344344 public virtual void AddTable ( string name , string engine , params IDbField [ ] fields )
345345 {
346- if ( TableExists ( name ) )
347- {
348- Logger . Warn ( "Table {0} already exists" , name ) ;
349- return ;
350- }
351-
352- if ( name . Length > 30 )
353- {
354- Logger . Warn ( "Tablename {0} is bigger then 30 char's This is a Problem if you want to use Oracle!" , name ) ;
355- }
356-
357346 var columns = fields . Where ( x => x is Column ) . Cast < Column > ( ) . ToArray ( ) ;
358347
359348 List < string > pks = GetPrimaryKeys ( columns ) ;
@@ -482,12 +471,6 @@ public virtual void ChangeColumn(string table, Column column)
482471
483472 column . ColumnProperty = column . ColumnProperty . Clear ( ColumnProperty . Unique ) ;
484473
485- if ( ! ColumnExists ( table , column . Name ) )
486- {
487- Logger . Warn ( "Column {0}.{1} does not exist" , table , column . Name ) ;
488- return ;
489- }
490-
491474 ColumnPropertiesMapper mapper = _dialect . GetAndMapColumnProperties ( column ) ;
492475
493476 ChangeColumn ( table , mapper . ColumnSql ) ;
@@ -588,17 +571,6 @@ public void AddColumn(string table, string column, DbType type, int size, Column
588571 public virtual void AddColumn ( string table , string column , MigratorDbType type , int size , ColumnProperty property ,
589572 object defaultValue )
590573 {
591- if ( ColumnExists ( table , column ) )
592- {
593- Logger . Warn ( "Column {0}.{1} already exists" , table , column ) ;
594- return ;
595- }
596-
597- if ( column . Length > 30 )
598- {
599- Logger . Warn ( "Columnname {0} is bigger then 30 char's This is a Problem if you want to use Oracle!" , column ) ;
600- }
601-
602574 ColumnPropertiesMapper mapper =
603575 _dialect . GetAndMapColumnProperties ( new Column ( column , type , size , property , defaultValue ) ) ;
604576
@@ -652,12 +624,6 @@ public virtual void AddColumn(string table, string column, DbType type, object d
652624
653625 public virtual void AddColumn ( string table , string column , MigratorDbType type , object defaultValue )
654626 {
655- if ( ColumnExists ( table , column ) )
656- {
657- Logger . Warn ( "Column {0}.{1} already exists" , table , column ) ;
658- return ;
659- }
660-
661627 ColumnPropertiesMapper mapper =
662628 _dialect . GetAndMapColumnProperties ( new Column ( column , type , defaultValue ) ) ;
663629
@@ -712,12 +678,6 @@ public virtual void AddColumn(string table, string column, MigratorDbType type,
712678 /// <param name="columns">Primary column names</param>
713679 public virtual void AddPrimaryKey ( string name , string table , params string [ ] columns )
714680 {
715- if ( ConstraintExists ( table , name ) )
716- {
717- Logger . Warn ( "Primary key {0} already exists" , name ) ;
718- return ;
719- }
720-
721681 ExecuteNonQuery (
722682 String . Format ( "ALTER TABLE {0} ADD CONSTRAINT {1} PRIMARY KEY ({2}) " , table , name ,
723683 String . Join ( "," , QuoteColumnNamesIfRequired ( columns ) ) ) ) ;
@@ -728,12 +688,6 @@ public virtual void AddPrimaryKeyNonClustered(string name, string table, params
728688 }
729689 public virtual void AddUniqueConstraint ( string name , string table , params string [ ] columns )
730690 {
731- if ( ConstraintExists ( table , name ) )
732- {
733- Logger . Warn ( "Constraint {0} already exists" , name ) ;
734- return ;
735- }
736-
737691 QuoteColumnNames ( columns ) ;
738692
739693 table = QuoteTableNameIfRequired ( table ) ;
@@ -743,12 +697,6 @@ public virtual void AddUniqueConstraint(string name, string table, params string
743697
744698 public virtual void AddCheckConstraint ( string name , string table , string checkSql )
745699 {
746- if ( ConstraintExists ( table , name ) )
747- {
748- Logger . Warn ( "Constraint {0} already exists" , name ) ;
749- return ;
750- }
751-
752700 table = QuoteTableNameIfRequired ( table ) ;
753701
754702 ExecuteNonQuery ( String . Format ( "ALTER TABLE {0} ADD CONSTRAINT {1} CHECK ({2}) " , table , name , checkSql ) ) ;
@@ -830,12 +778,6 @@ public virtual void AddForeignKey(string name, string primaryTable, string prima
830778 public virtual void AddForeignKey ( string name , string primaryTable , string [ ] primaryColumns , string refTable ,
831779 string [ ] refColumns , ForeignKeyConstraintType constraint )
832780 {
833- if ( ConstraintExists ( primaryTable , name ) )
834- {
835- Logger . Warn ( "Constraint {0} already exists" , name ) ;
836- return ;
837- }
838-
839781 refTable = QuoteTableNameIfRequired ( refTable ) ;
840782 primaryTable = QuoteTableNameIfRequired ( primaryTable ) ;
841783 QuoteColumnNames ( primaryColumns ) ;
@@ -1969,12 +1911,6 @@ public virtual void AddIndex(string table, Index index)
19691911
19701912 public virtual void AddIndex ( string name , string table , params string [ ] columns )
19711913 {
1972- if ( IndexExists ( table , name ) )
1973- {
1974- Logger . Warn ( "Index {0} already exists" , name ) ;
1975- return ;
1976- }
1977-
19781914 name = QuoteConstraintNameIfRequired ( name ) ;
19791915
19801916 table = QuoteTableNameIfRequired ( table ) ;
0 commit comments