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

Unsigned numbers not showing up in diesel print-schema for MySQL #1642

Closed
pie-flavor opened this Issue Apr 15, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@pie-flavor

pie-flavor commented Apr 15, 2018

Setup

up.sql:

CREATE TABLE users (
    id INTEGER UNSIGNED PRIMARY KEY,
    pass_hash BINARY(60) NOT NULL,
    username VARCHAR(24) NOT NULL
)

Versions

  • Rust: 1.27.0-nightly bd40cbbe1 2018-04-14
  • Diesel: 1.2.0
  • Database: MySQL 5.7.21.0
  • Operating System Windows 10 1709 build 16299.371

Feature Flags

  • diesel: --no-default-features --features mysql

Problem Description

diesel print-schema does not correctly respect unsigned integers.

What are you trying to accomplish?

Use an unsigned integer in a database.

What is the expected output?

table! {
    users (id) {
        id -> Unsigned<Integer>,
        pass_hash -> Binary,
        username -> Varchar,
    }
}

What is the actual output?

table! {
    users (id) {
        id -> Integer,
        pass_hash -> Binary,
        username -> Varchar,
    }
}

Are you seeing any additional errors?

No.

Steps to reproduce

  1. Use diesel migrate to introduce the above table schema.
  2. Run diesel print-schema and notice the lack of unsignedness.

Checklist

  • I have already looked over the issue tracker for similar issues.

sgrif added a commit that referenced this issue Apr 15, 2018

Actually output `Unsigned` types in `print-schema`
This got missed in the original PR.

Fixes #1642.

sgrif added a commit that referenced this issue Apr 15, 2018

Actually output `Unsigned` types in `print-schema`
This got missed in the original PR.

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