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

SQL Server: clean doesn't work for system-versioned temporal tables #2397

Closed
kwood612 opened this issue May 22, 2019 · 3 comments
Closed

SQL Server: clean doesn't work for system-versioned temporal tables #2397

kwood612 opened this issue May 22, 2019 · 3 comments

Comments

@kwood612
Copy link

@kwood612 kwood612 commented May 22, 2019

Which version and edition of Flyway are you using?

5.2.4

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-line

Which database are you using (type & version)?

SQL Server 2016

Which operating system are you using?

Windows 10

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
flyway clean

What did you expect to see?

No errors and a clean schema

What did you see instead?

ERROR:
Unable to drop 'mytableHistory'

SQL State : S0001
Error Code : 13552
Message : Drop table operation failed on table 'mytableHistory' because it is not supported operation on system-versioned temporal tables.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 22, 2019

Please share the smallest possible SQL file that can be used to reproduce the issue.

@kwood612
Copy link
Author

@kwood612 kwood612 commented May 22, 2019

CREATE TABLE [dbo].[TestTable](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [Name] [varchar](50) NOT NULL,
    [SysStartTime] [datetime2](7) GENERATED ALWAYS AS ROW START NOT NULL,
    [SysEndTime] [datetime2](7) GENERATED ALWAYS AS ROW END NOT NULL,
    CONSTRAINT [PK_TestTable] PRIMARY KEY CLUSTERED
	(
		[Id] ASC
	),
    PERIOD FOR SYSTEM_TIME ([SysStartTime], [SysEndTime])
)
WITH (SYSTEM_VERSIONING = ON ( HISTORY_TABLE = [dbo].[TestTableHistory] ))

@axelfontaine axelfontaine changed the title flyway clean doesn't work for SQL server system-versioned temporal tables SQL Server: clean doesn't work for system-versioned temporal tables May 22, 2019
@axelfontaine axelfontaine added this to the Flyway 6.0.0 milestone May 22, 2019
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue May 22, 2019
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 22, 2019

Thanks for the example. This has now been fixed.

@axelfontaine axelfontaine removed this from the Flyway 6.0.0 milestone May 22, 2019
@axelfontaine axelfontaine added this to the Flyway 6.0.0-beta2 milestone May 22, 2019
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants