Giter VIP home page Giter VIP logo

Comments (7)

simov avatar simov commented on May 17, 2024

I'll take a look at it, let's keep this issue open for now. In the meantime you can fix the varchar(null) by hand. As for the missing pk, the script is very optimistic, and for some reason it doesn't find your table's pk and in this case you should set it by hand.

You can start the admin with

$ admin -l path/to/config

to log the queries that are issued. Right now the system queries responsible for setting up the settings.json file are not logged out (they are issued in lib/db/database.js and lib/db/schema.js so you can log them out as well)

from express-admin.

simov avatar simov commented on May 17, 2024

Also @aol-nnov I don't thing this will work

"defaultValue": "uuid_generate_v4()"

You should set the defaultValue to null and hide the column from the editview, as I'm understanding this value is generated in your database when the record is created.

from express-admin.

aol-nnov avatar aol-nnov commented on May 17, 2024

@simov, that's exactly what i did - filled in by hand and it worked ;)
just reporting in :)

and as for uuid fields - they may be generated on the application side, as well as on db side if left empty. Yes, I have already to changed defaultValue to null in express-admin.

from express-admin.

simov avatar simov commented on May 17, 2024

If you intend to set values on the application side automatically use the events

You can take a look at how I generate a unique id and set it here

There isn't documentation about the exact structure of args in this 'event' but you can run the admin with --debug-brk flag and use node-inspector to see what's the data in it. As you can see there is a breakpoint on top of this function already.

from express-admin.

aol-nnov avatar aol-nnov commented on May 17, 2024

thank you for a hint, I'll look into it!

from express-admin.

simov avatar simov commented on May 17, 2024

One more example of the events can be found in the examples repository. In both cases you can open up the model file with MySql Workbench to see how the tables are visually constructed, then take a look at the configuration that is used in the admin. The structure of the example databases is identical for each database engine.

from express-admin.

simov avatar simov commented on May 17, 2024

@aol-nnov I just published a new version, so make an npm install, it's not related to this issue, but still it's important to re-install the admin

from express-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.