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

Drop migration for ForeignReference #23605

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Drop migration for ForeignReference #23605

merged 3 commits into from
Mar 23, 2023

Conversation

wolfogre
Copy link
Member

Fix #21086 (comment)

Related to #21721

@wolfogre wolfogre added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. outdated/backport/v1.19 This PR should be backported to Gitea 1.19 labels Mar 21, 2023
@wolfogre wolfogre added this to the 1.20.0 milestone Mar 21, 2023
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 21, 2023
@wxiaoguang
Copy link
Contributor

I guess DropForeignReferenceTable should also be fixed together, make it ignore the error

@wolfogre
Copy link
Member Author

I guess DropForeignReferenceTable should also be fixed together, make it ignore the error

Maybe it's safe to drop a nonexistent table?

image

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 21, 2023

I guess DropForeignReferenceTable should also be fixed together, make it ignore the error

Maybe it's safe to drop a nonexistent table?

Hmm, I am not sure. Some XORM behaviors are counterintuitive (I guess a better name could be DropTableIfExists()). if it's designed to do so, then no question from my side.

@zeripath
Copy link
Contributor

As far as I can see xorm will tolerate dropping a non-existent table - in fact the comment preceding sess.DropTable promises this:

// DropTable drop table will drop table if exist, if drop failed, it will return error
func (session *Session) DropTable(beanOrTableName interface{}) error {
	if session.isAutoClose {
		defer session.Close()
	}

	return session.dropTable(beanOrTableName)
}

and the function dropTable is used by the code for DropTables so I think this is fine.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 23, 2023
@zeripath zeripath enabled auto-merge (squash) March 23, 2023 18:37
@delvh delvh added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 23, 2023
@zeripath zeripath merged commit 9f39def into go-gitea:main Mar 23, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Mar 23, 2023
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Mar 23, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 24, 2023
* upstream/main:
  Fix incorrect `HookEventType` of pull request review comments (go-gitea#23650)
  [skip ci] Updated translations via Crowdin
  Fix codeblocks in the cheat sheet (go-gitea#23664)
  Drop migration for ForeignReference (go-gitea#23605)
  Fix new issue/pull request btn margin when it is next to sort (go-gitea#23647)
  A tool to help to backport locales, changes source strings to fix other broken translations (go-gitea#23633)
  Fix incorrect `show-modal` and `show-panel` class (go-gitea#23660)
  Restructure documentation. Now the documentation has installation, administration, usage, development, contributing the 5 main parts (go-gitea#23629)
  Check LFS/Packages settings in dump and doctor command (go-gitea#23631)
  Use a general approach to show tooltip, fix temporary tooltip bug (go-gitea#23574)
  Improve workflow event triggers (go-gitea#23613)
  Improve `<SvgIcon>` to make it output `svg` node and optimize performance (go-gitea#23570)
@lunny lunny removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 24, 2023
jolheiser pushed a commit that referenced this pull request Mar 24, 2023
Backport #23605 by @wolfogre

Fix
#21086 (comment)

Related to #21721

Co-authored-by: Jason Song <i@wolfogre.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.19 This PR should be backported to Gitea 1.19 skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Primary keys are required in MySQL DB cluster
6 participants