Skip to content

Problem: managing schema evolution#1

Draft
yrashk wants to merge 7 commits intoomnigres:masterfrom
yrashk:rfc-0001-osemp
Draft

Problem: managing schema evolution#1
yrashk wants to merge 7 commits intoomnigres:masterfrom
yrashk:rfc-0001-osemp

Conversation

@yrashk
Copy link
Copy Markdown
Contributor

@yrashk yrashk commented Feb 11, 2025

It's a non-trivial task.

Solution: make a proposal to address its problems

It's a non-trivial task.

Solution: make a proposal to address its problems
Solution: use the one I intended

I meant that migrations always have to converge into a linear form
While it works, it is confusing – migration is meant to be about going from A
to B.

Solution: rename migration to revision
Solution: use yaml everywhere

Not that this is highly critical at this point, as formats may change
Comment thread rfc-0001/README.md
data/metadata.yaml
```

***data/metadata.yaml**:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we want to use some implicit value, such as disregarding tables that are not listed? In other words, would it contain an exhaustive list of tables with data?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. Implicit is not great (defaults can change). What if we always listed all tables' preferences? Would that be okay? Gives perfect understanding as to where things should stand.

Comment thread rfc-0001/README.md Outdated
| Tar | Easy to open using command-line tools | Not directly understood by Postgres unless copied through a program; uncompressed |
| Tar.(gz/bz2/...) | Same as tar + Smaller size | Same as tar |
| Zip | Same as tar + Smaller size | Same as tar |
| SQL | Can be loaded by sending into Postgres | Can modify arbitrary objects, not directly usable in command-line for file extraction |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The SQL format also seems to be more interesting when using the VCS diff between commits.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there won't be diffs here, as every file is essentially final. I also forgot to add SQLite option here, will add.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

true, I was mistakenly thinking about diffing between versions (but that would be between files in different revision directories). The point is still valid though, you could generalize Can be loaded by sending into Postgres by saying Easier to inspect.

yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 12, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 13, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 13, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 15, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 15, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 16, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 16, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 16, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 17, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 17, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 24, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 24, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 24, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 24, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 24, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 25, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 25, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to yrashk/omnigres that referenced this pull request Feb 25, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
yrashk added a commit to omnigres/omnigres that referenced this pull request Feb 27, 2025
Tracking schema evolution, especially in presence of data-native functions
(fka _stored procedures_) is a non-trivial task:

* How do we prevent data and auxiliary information (such as presence of indices) loss?
* How do we ensure that schema is evolved as intended?
* How do we make sure the correct set of extensions at correct versions is used for every specific version?
* How do we sure data-native functions correspond the correct revision of the schema?
* and so on.

Solution: implement a robust tracking solution
following [RFC0001](omnigres/rfc#1)
@yrashk
Copy link
Copy Markdown
Contributor Author

yrashk commented Mar 9, 2025

Let's see how this RFC aged against our current implementations and discoveries.

@yrashk
Copy link
Copy Markdown
Contributor Author

yrashk commented Aug 10, 2025

I suspect capturing migrations is not the best idea. It is complicated and makes it difficult to track relationships between previous and new generations.

What if simply capture the schema in the revision? If one wants to just deploy it, it's easy – no iteration over migrations, simply restore. So every capture is a snapshot of all things. We can diff them at a different time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants