Repository navigation
Conversation
给 bi_datasource / bi_dataset / bi_chart 补 owner_id(INTEGER 可空 + 索引), 存量行回填系统占位 id 0(model.SystemOwnerID,预留、永不与 bi_user.id 自增起点相碰)。 写路径 Create 显式打占位;Update 整行更新排除 owner_id(归属不随更新改写)。 读路径零行为变化:OwnerID 只在 bun model 上、json:"-",entity/契约不含它。 - 迁移 00009:可重放幂等,down 可用(已在隔离 PG18 上验 up/幂等/列/索引/回填/down)。 - tenant_id 归 Phase C(R-03),本条不带;bi_share 已由 00008 退役,不补列。 - 类型取 INTEGER 与既有预留列(bi_query/bi_dashboard/bi_dashboard_folder)一致, 偏离 issue 文字里的 BIGINT,一致性优先。 - 测试:三表各加 Create-writes-owner_id / Update-excludes-owner_id 的 sqlmock 用例。
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #171
做了什么(链条地基,#183/#184 的前置)
00009:bi_datasource / bi_dataset / bi_chart各加owner_id INTEGER(可空)+ 归属索引;存量行回填系统占位 id0(model.SystemOwnerID)。Create显式打占位;Update/UpdateColumns整行更新ExcludeColumn("owner_id")(归属不随更新改写,验收 2)。OwnerID只加在 bun model、json:"-",entity.*与 openapi 契约不含它(验收 3)。留档的决策(对应验收 5 / issue「待产品确认」)
00008退役(只标注不 DROP、代码零读写)。owner_id(bi_query/bi_dashboard/bi_dashboard_folder)均 INTEGER,一致性优先,Phase C 统一。bi_user.id(自增从 1 起)相碰;[Phase C/触发式] R-82 用户系统 v1:账号 + 首个用户即系统管理员 + Bearer 鉴权中间件 #183 落地后由请求上下文的真实用户 id 取代。验证
TestMigrationsUpToLatest(up + 幂等重跑)通过;列/索引存在、回填 UPDATE 语句有效、down 语句可执行,均实测。go vet ./...+go test -race ./...全绿(含contract_parity_test)。owner_id、Update 不含"owner_id" =。