Skip to content

Support Database Default values specified using a custom attribute #85

Description

@msallin

It should be possible to set a default attribute on the database level, specified with a custom attribute.

The attribute should be named "SqlDefaultValueAttribute" and take a string representing the SQL statement.

  1. Create a new Attribute "SqlDefaultValueAttribute" in "SQLite.CodeFirst/Public/Attributes". The attribute should take a string in the ctor and initialize a property, named "DefaultValue"
  2. Create a new ColumnConstraint "DefaultValueConstraint" in "SQLite.CodeFirst/Internal/Statement/ColumnConstraint" (Cover this with a Unit Test)
  3. Extend the ColumnStatementCollectionBuilder to support the "SqlDefaultValueAttribute" and add the corresponding constraint
  4. Extend the sample code to use the "SqlDefaultValueAttribute"
  5. Extend the integration test SqlGenerationTest.cs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions