Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SQL Server memory-optimized tables #6442

Merged
merged 1 commit into from
Sep 2, 2016
Merged

Conversation

AndriySvyryd
Copy link
Member

Add ForSqlServerIsMemoryOptimized() EntityBuilder extension method
Add support for conventions to run on annotation set
Change conventions to not set cascade delete on foreign keys on on memory-optimized tables
Add convention to configure keys and indexes as nonclustered on memory-optimized tables
Change IsClustered extension method on builders to take a bool?

Add AlterDatabaseOperation and AlterTableOperation
Add OldAnnotations to all alter operations
Add migrations annotations providers for IModel and ISequence
Diff migrations annotations for IModel, IEntityType and ISequence
Set migrations annotations on drop operations

Add support for memory-optimized tables to RelationalDatabaseCleaner

Fixes #6405
Fixes #3122

@@ -264,10 +274,12 @@ public virtual IReadOnlyList<MigrationOperation> GetDifferences(IModel source, I
.Concat(dropTableOperations)
.Concat(dropOperations)
.Concat(dropColumnOperations)
.Concat(alterDatabaseOperations)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut feeling is that this should go just before createSequenceOperations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objections

@AndriySvyryd AndriySvyryd force-pushed the InMemory branch 2 times, most recently from bcb1900 to 9e723d8 Compare August 31, 2016 00:05
IEnumerable<IAnnotation> For([NotNull] IIndex index);
IEnumerable<IAnnotation> For([NotNull] IProperty property);
IEnumerable<IAnnotation> For([NotNull] IKey key);
IEnumerable<IAnnotation> For([NotNull] IForeignKey foreignKey);
IEnumerable<IAnnotation> For([NotNull] IEntityType entityType);
IEnumerable<IAnnotation> For([NotNull] ISequence sequence);

IEnumerable<IAnnotation> ForRemove([NotNull] IModel model);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? The differ never generates DropDatabase operations...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. It's a special AlterDatabase when you're going to InitialDatabase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@bricelam
Copy link
Contributor

👍 Looking good

/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual bool IsMemoryOptimized
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given warning above, .Internal namespace?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the doc comment

@AndriySvyryd AndriySvyryd force-pushed the InMemory branch 2 times, most recently from c994932 to 0c8532f Compare September 1, 2016 21:52
bool oldNullable = false,
[CanBeNull] object oldDefaultValue = null,
[CanBeNull] string oldDefaultValueSql = null,
[CanBeNull] string oldComputedColumnSql = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if these should be grouped in the API. For example...

.AlterColumn(
    oldColumn: new ColumnModel<int>(
        isRequired: false));

...or...

.AlterColumn()
    .OldColumn<int>(
        isRequired: flase);

Might be worth discussing in a design meeting, but I also like the simplicity and consistency with Rename* of the way you have it.

@bricelam
Copy link
Contributor

bricelam commented Sep 2, 2016

:shipit:

Add ForSqlServerIsMemoryOptimized() EntityBuilder extension method
Add support for conventions to run when an annotation is set
Change conventions to not set cascade delete on foreign keys on memory-optimized tables
Add convention to configure keys and indexes as nonclustered on memory-optimized tables
Change IsClustered extension method on builders to take a bool?

Add AlterDatabaseOperation and AlterTableOperation
Add old values to all alter operations
Add migrations annotations providers for IModel and ISequence
Add migrations annotations providers for removed objects
Set migrations annotations on drop operations
Diff migrations annotations for IModel, IEntityType and ISequence

Add support for memory-optimized tables to RelationalDatabaseCleaner

Fixes #6405
Fixes #3122
@AndriySvyryd AndriySvyryd merged commit 326663a into dev Sep 2, 2016
@AndriySvyryd AndriySvyryd deleted the InMemory branch September 2, 2016 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants