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

How to import SQL file and prisma deploy? #310

Open
chairy11 opened this issue Apr 21, 2018 · 1 comment
Open

How to import SQL file and prisma deploy? #310

chairy11 opened this issue Apr 21, 2018 · 1 comment

Comments

@chairy11
Copy link

Hi, I have import a .sql file to MySQL, with some seed data. And I edit the code in <.server/database/datamodel.graphql>.

But every time I execute prisma deploy, it would be blocked and have no advanced..What's wrong?
Does anyone know how to deal with this?

Thank you!

#  server/database/datamodel.graphql
type GraphDefinition {
    Id: ID! @unique
    GraphName: String!
    GraphTitle: String!
    GraphType: String!
    DataTable: String!
    XDescription: String!
    YDescription: String!
    Other: String
    LastModified: DateTime
}

type RealTimeRawTickData {
    Ticker: Int!
    Time: Int!
    CurTime: Int!
    CurPrice:Float
    OpenPrice:Float
    PreClosePrice :Float
    AskAvPrice:Float
    BidAvPrice:Float
    DateInserted:DateTime!
}

type TickerAdjFactor {
    Date: String
    Ticker: String!
    AdjFactor: Float!
    DateInserted: DateTime!
}

# server/src/schema.graphql

type Query {
    graphDefinition(id: ID!): GraphDefinition
    realTimeRawTickData: RealTimeRawTickData
    tickerAdjFactor: TickerAdjFactor
}

image

@keberox
Copy link

keberox commented Jun 7, 2018

@chairy11 have you tried using the seed.graphql file to import data? I think the import has to be done after the schema is deployed to the service.

https://www.prisma.io/docs/reference/service-configuration/prisma.yml/yaml-structure-ufeshusai8#seed-(optional)

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