Ejemplo n.º 1
0
        public when_doing_a_schema_diff_with_no_changes_95_style()
        {
            var store1 = TestingDocumentStore.For(_ =>
            {
                _.UpsertType = PostgresUpsertType.Standard;
                _.DatabaseSchemaName = Marten.StoreOptions.DefaultDatabaseSchemaName;
                _.Schema.For<User>().Searchable(x => x.UserName).Searchable(x => x.Internal);
            });

            store1.Schema.EnsureStorageExists(typeof(User));

            // Don't use TestingDocumentStore because it cleans everything upfront.
            store2 = DocumentStore.For(_ =>
            {
                _.UpsertType = PostgresUpsertType.Standard;
                _.Connection(ConnectionSource.ConnectionString);
                _.DatabaseSchemaName = Marten.StoreOptions.DefaultDatabaseSchemaName;
                _.Schema.For<User>().Searchable(x => x.UserName).Searchable(x => x.Internal);
            });

            mapping = store2.Schema.MappingFor(typeof(User)).As<DocumentMapping>();
            diff = mapping.CreateSchemaDiff(store2.Schema);
        }