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

Cleanup in the DB schema #718

Merged
merged 1 commit into from
Oct 8, 2021
Merged

Cleanup in the DB schema #718

merged 1 commit into from
Oct 8, 2021

Conversation

tolikzinovyev
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

Codecov Report

Merging #718 (d880efd) into develop (b382d94) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #718   +/-   ##
========================================
  Coverage    53.10%   53.10%           
========================================
  Files           23       23           
  Lines         3642     3642           
========================================
  Hits          1934     1934           
  Misses        1450     1450           
  Partials       258      258           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b382d94...d880efd. Read the comment docs.

typeenum smallint NOT NULL,
asset bigint NOT NULL, -- 0=Algos, otherwise AssetIndex
txid bytea NOT NULL, -- base32 of [32]byte hash
txnbytes bytea NOT NULL, -- msgpack encoding of signed txn with apply data
txn jsonb NOT NULL, -- json encoding of signed txn with apply data
extra jsonb,
extra jsonb NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think extra should be nullable, it's rarely used. The asset close query handles the null case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We always write it in writer.go. I think it's better to write it than having to handle the null case.

@@ -47,10 +47,10 @@ CREATE TABLE IF NOT EXISTS account (
rewardsbase bigint NOT NULL,
rewards_total bigint NOT NULL,
deleted bool NOT NULL, -- whether or not it is currently deleted
created_at bigint NOT NULL DEFAULT 0, -- round that the account is first used
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure we don't need DEFAULT 0 for genesis accounts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we write 0 explicitly.

@tolikzinovyev tolikzinovyev merged commit 25058e5 into develop Oct 8, 2021
@tolikzinovyev tolikzinovyev deleted the tolik/schema-cleanup branch October 8, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants