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

run migration 0005 on access-api staging #464

Closed
Tracked by #7
gobengo opened this issue Mar 1, 2023 · 4 comments
Closed
Tracked by #7

run migration 0005 on access-api staging #464

gobengo opened this issue Mar 1, 2023 · 4 comments
Milestone

Comments

@gobengo
Copy link
Contributor

gobengo commented Mar 1, 2023

For some reason when I try to run the migrations on staging, they don't seem to fully apply/'stick'?

bengo@bengo ~/protocol.ai/w3protocol/packages/access-api ⚡  npx wrangler d1 migrations list __D1_BETA__ --env staging
▲ [WARNING] Processing wrangler.toml configuration:

    - 😶 Ignored: "miniflare":
      Wrangler does not use configuration in the `miniflare` section. Unless you
  are using Miniflare directly you can remove this section.
    - "env.staging" environment configuration
      - "unsafe" fields are experimental and may change or break at any time.



🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 2 commands in 0.14677099883556366ms
🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 1 command in 4.921460002660751ms
Migrations to be applied:
┌───────────────────────────────────────────────────────┐
│ Name                                                  │
├───────────────────────────────────────────────────────┤
│ 0005_drop_delegations_audience_to_accounts_did_fk.sql │
└───────────────────────────────────────────────────────┘
bengo@bengo ~/protocol.ai/w3protocol/packages/access-api ⚡  npx wrangler d1 migrations apply __D1_BETA__ --env staging
▲ [WARNING] Processing wrangler.toml configuration:

    - 😶 Ignored: "miniflare":
      Wrangler does not use configuration in the `miniflare` section. Unless you
  are using Miniflare directly you can remove this section.
    - "env.staging" environment configuration
      - "unsafe" fields are experimental and may change or break at any time.



🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 2 commands in 0.12004999816417693ms
🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 1 command in 1.940445989370346ms
Migrations to be applied:
┌───────────────────────────────────────────────────────┐
│ Name                                                  │
🌀 Mapping SQL input into an array of statements
🌀 Parsing 5 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 1 command in 0.22679200768470764ms
┌───────────────────────────────────────────────────────┬────────┐
│ Name                                                  │ Status │
├───────────────────────────────────────────────────────┼────────┤
│ 0005_drop_delegations_audience_to_accounts_did_fk.sql │ ✅       │
└───────────────────────────────────────────────────────┴────────┘
bengo@bengo ~/protocol.ai/w3protocol/packages/access-api ⚡  npx wrangler d1 migrations list __D1_BETA__ --env staging
▲ [WARNING] Processing wrangler.toml configuration:

    - 😶 Ignored: "miniflare":
      Wrangler does not use configuration in the `miniflare` section. Unless you
  are using Miniflare directly you can remove this section.
    - "env.staging" environment configuration
      - "unsafe" fields are experimental and may change or break at any time.



🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 2 commands in 0.1396310031414032ms
🌀 Mapping SQL input into an array of statements
🌀 Parsing 1 statements
🌀 Executing on __D1_BETA__ (16f0660e-2a8e-4e13-9f05-0a2a594d91ed):
🚣 Executed 1 command in 1.6049530059099195ms
Migrations to be applied:
┌───────────────────────────────────────────────────────┐
│ Name                                                  │
├───────────────────────────────────────────────────────┤
│ 0005_drop_delegations_audience_to_accounts_did_fk.sql │
└───────────────────────────────────────────────────────┘
bengo@bengo ~/protocol.ai/w3protocol/packages/access-api ⚡
@gobengo
Copy link
Contributor Author

gobengo commented Mar 1, 2023

Discovered while testing this on staging: #460
Clicking the authorize confirmation link leads to a error
Screenshot 2023-02-28 at 5 15 42 PM

@gobengo
Copy link
Contributor Author

gobengo commented Mar 1, 2023

after poking around I think the migration ran, but cf refused to execute the last two lines (but also didn't error?)

DROP TABLE delegations;
ALTER TABLE delegations_new RENAME TO delegations;

I see in cloudflare staging that there is still a delegations table with the schema from before migration.
There is also the delegations_new table created in the migration.

Maybe d1 doesn't support dropping table nor renaming?

@heyjay44 heyjay44 added this to the w3up phase 3 milestone Mar 1, 2023
@gobengo
Copy link
Contributor Author

gobengo commented Mar 1, 2023

I need to modify the sql schema again via migration as part of #459 , which on the whole I still need in order to fully verify on staging #393
I'm going to do that first and, once merged, get this 0005 migration working on staging along with any subsequent ones I add there.

gobengo added a commit that referenced this issue Mar 3, 2023
…delegations -> delegations_old and create a new delegations (#468)

Note:
* this is just for consideration because @Gozala and I are both curious
whether cloudflare migrations will allow the rename. It would be good to
know.
* But i actually think it would probably be best to use
#469 over time

Motivation:
* try out something @Gozala and I came up with for
#464
@gobengo
Copy link
Contributor Author

gobengo commented Mar 3, 2023

This change to the migration ended up having it 'stick'.
#469
https://github.com/web3-storage/w3protocol/actions/runs/4326422423/jobs/7553830691#step:7:52

but to do it required not doing the DROP TABLE nor RENAME

@gobengo gobengo closed this as completed Mar 3, 2023
gobengo added a commit that referenced this issue Apr 11, 2023
…delegations -> delegations_old and create a new delegations (#468)

Note:
* this is just for consideration because @Gozala and I are both curious
whether cloudflare migrations will allow the rename. It would be good to
know.
* But i actually think it would probably be best to use
#469 over time

Motivation:
* try out something @Gozala and I came up with for
#464
Peeja pushed a commit to storacha/upload-service that referenced this issue Jan 17, 2025
…ads (storacha#502)

we'll probably want to rework this in the future, but I think this
probably looks good enough for now:


<img width="1223" alt="Screenshot 2023-04-07 at 1 47 15 PM"
src="https://user-images.githubusercontent.com/1113/230676964-186cb768-c7a6-4fe2-8e92-b8e153e57418.png">
<img width="369" alt="Screenshot 2023-04-07 at 1 47 29 PM"
src="https://user-images.githubusercontent.com/1113/230676965-589803a8-9fde-4505-8d92-5273aaa3ad83.png">
resolves storacha#464
Peeja pushed a commit to storacha/upload-service that referenced this issue Jan 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.5.0](storacha/w3ui@w3console-v1.4.1...w3console-v1.5.0)
(2023-05-09)


### Features

* add warnings about the public and permanent nature of w3up uploads
([storacha#502](storacha/w3ui#502))
([6cc58f8](storacha/w3ui@6cc58f8)),
closes [storacha#464](storacha/w3ui#464)
* get w3console looking acceptable on mobile
([storacha#500](storacha/w3ui#500))
([118cb22](storacha/w3ui@118cb22))
* remove space creator from sidebar
([storacha#509](storacha/w3ui#509))
([40bc621](storacha/w3ui@40bc621))
* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([e1ee301](storacha/w3ui@e1ee301))
* upload progress
([storacha#499](storacha/w3ui#499))
([6c9de97](storacha/w3ui@6c9de97))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([78aee2a](storacha/w3ui@78aee2a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
Peeja pushed a commit to storacha/upload-service that referenced this issue Jan 29, 2025
…ads (storacha#502)

we'll probably want to rework this in the future, but I think this
probably looks good enough for now:


<img width="1223" alt="Screenshot 2023-04-07 at 1 47 15 PM"
src="https://user-images.githubusercontent.com/1113/230676964-186cb768-c7a6-4fe2-8e92-b8e153e57418.png">
<img width="369" alt="Screenshot 2023-04-07 at 1 47 29 PM"
src="https://user-images.githubusercontent.com/1113/230676965-589803a8-9fde-4505-8d92-5273aaa3ad83.png">
resolves storacha#464
Peeja pushed a commit to storacha/upload-service that referenced this issue Jan 29, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.5.0](storacha/w3ui@w3console-v1.4.1...w3console-v1.5.0)
(2023-05-09)


### Features

* add warnings about the public and permanent nature of w3up uploads
([storacha#502](storacha/w3ui#502))
([ad0632c](storacha/w3ui@ad0632c)),
closes [storacha#464](storacha/w3ui#464)
* get w3console looking acceptable on mobile
([storacha#500](storacha/w3ui#500))
([3e512df](storacha/w3ui@3e512df))
* remove space creator from sidebar
([storacha#509](storacha/w3ui#509))
([d5f5536](storacha/w3ui@d5f5536))
* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
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

No branches or pull requests

2 participants