Skip to content

Commit a126f33

Browse files
JaBistDuNarrischJaBistDuNarrisch
authored andcommitted
Added some more overrides in SQLite
1 parent 99a623f commit a126f33

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

src/Migrator.Tests/Providers/Generic/TransformationProviderGenericMiscConstraintBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public void CanAddPrimaryKey()
5454
}
5555
}
5656

57-
[Test]
58-
public void AddIndexedColumn()
59-
{
60-
Provider.AddColumn("TestTwo", "Test", DbType.String, 50, ColumnProperty.Indexed);
61-
}
57+
// [Test]
58+
// public void AddIndexedColumn()
59+
// {
60+
// Provider.AddColumn("TestTwo", "Test", DbType.String, 50, ColumnProperty.Indexed);
61+
// }
6262

6363
[Test]
6464
public void AddUniqueColumn()

src/Migrator/Framework/ColumnProperty.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public enum ColumnProperty
3434
/// <summary>
3535
/// Indexed Column
3636
/// </summary>
37+
[Obsolete("Use method 'AddIndex'")]
3738
Indexed = 1 << 4,
3839

3940
/// <summary>

src/Migrator/Providers/Impl/SQLite/SQLiteTransformationProvider.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,20 @@ public override void AddColumn(string table, Column column)
838838
RecreateTable(sqliteInfo);
839839
}
840840

841+
public override void AddColumn(string table, string columnName, DbType type, int size)
842+
{
843+
var column = new Column(columnName, type, size);
844+
845+
AddColumn(table, column);
846+
}
847+
848+
public override void AddColumn(string table, string columnName, MigratorDbType type, int size)
849+
{
850+
var column = new Column(columnName, type, size);
851+
852+
AddColumn(table, column);
853+
}
854+
841855
public override void AddColumn(string table, string columnName, DbType type, ColumnProperty property)
842856
{
843857
var column = new Column(columnName, type, property);
@@ -852,6 +866,14 @@ public override void AddColumn(string table, string columnName, MigratorDbType t
852866
AddColumn(table, column);
853867
}
854868

869+
public override void AddColumn(string table, string columnName, MigratorDbType type, int size, ColumnProperty property,
870+
object defaultValue)
871+
{
872+
var column = new Column(columnName, type, property) { Size = size, DefaultValue = defaultValue };
873+
874+
AddColumn(table, column);
875+
}
876+
855877
public override void AddColumn(string table, string columnName, DbType type)
856878
{
857879
var column = new Column(columnName, type);

src/Migrator/Providers/TransformationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ public virtual void AddColumn(string table, string column, MigratorDbType type)
670670
/// AddColumn(string, string, Type, int, ColumnProperty, object)
671671
/// </see>
672672
/// </summary>
673-
public void AddColumn(string table, string column, DbType type, int size)
673+
public virtual void AddColumn(string table, string column, DbType type, int size)
674674
{
675675
AddColumn(table, column, type, size, ColumnProperty.Null, null);
676676
}

0 commit comments

Comments
 (0)