GithubHelp home page GithubHelp logo

forestadmin / lumber Goto Github PK

View Code? Open in Web Editor NEW
2.1K 41.0 106.0 9.31 MB

Install Forest Admin in minutes.

Home Page: https://www.forestadmin.com

License: MIT License

JavaScript 93.27% Dockerfile 0.22% Handlebars 5.57% TSQL 0.93%
lumber nodejs backend framework

lumber's Issues

Unrecognized data type for field <field_name>

Everything worked smoothly so far, until I wanted to change a model field to be a checkbox instead of an input field for a boolean property. It seems lumber mapped the field TINYINT(1) to be DataTypes.INTEGER. So I manually changed the line in the models/model_name.js file to be type: DataTypes.BOOLEAN

When restarting lumber, the error I get is Model creation error: Error: Unrecognized data type for field <field_name>

Remote database

I am trying to use remote database.

Credentials are correct.

Enter your database connection details and then your admin interface will be automatically generated.

? What's the database type?  mysql
? What's the database name? ****
? What's the database hostname? *****
? What's the database port? 3306
? What's the database user?  remote
? What's the database password? [optional]  ****************
? Choose a project name:  lumber
error: πŸ’€  Ouch, cannot connect to the database πŸ’€

Yarn package manager - lumber-generate(1) does not exist, try --help

Installed lumber-cli via yarn (0.16.1), and couldn't get it running.

On Ubuntu 14.04, Node 6.

$ lumber generate

  lumber-generate(1) does not exist, try --help
$ lumber --help

  Usage: lumber [options] [command]


  Commands:

    generate    generate your admin microservice
    action      create a new action
    user        show your current logged user
    login       sign in to your account
    logout      sign out of your account
    help [cmd]  display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Issue with install while extracting inquirer to gunzTa?

Having an issue completing the install of lumber, resulting in the install being killed:

user@domain:~$ sudo npm install -g lumber-cli
npm WARN deprecated [email protected]: use uuid module instead
extract:inquirer β†’ gunzTa ▐ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
Killed
user@domain:~$ 

Installing on a Digital Ocean droplet, using Node.js v4.2.6 and NPM v3.5.2

Custom base application url when using lumber-generate

Hello there !

I can't wait to see this great tool connected on my project :)

lumber-generate ended successfully on my webserver (i'm not working on localhost)

However, I get
"Login
Oops, cannot reach your application. Are you sure it is running?"

because I'm not able to enter my custom base url, for instance
http://www.myproject.com:8080 instead of http://localhost:3000

How can I fix this setting, from https://app.forestadmin.com (or from the command line tool) ?

Where are the REST docs?

I read that Lumber/Forestadmin can be used to serve as a REST API for my database.

Lumber generates a lightweight web app serving a REST API hooked directly into your database, so it works out-of-the-box for MySQL and Postgres.

When browsing the tables, I get some calls in the terminal - Yes. But how do I know how to access these via my app?
There is no url provided.

Is it localhost/forest/content/65565 ? Is there no port?
Is it http://app.forestadmin.com/forest/content/65565?
None of them work.

It would be nice to have some more information on how to actually use forestadmin together with lumber, in order to have a REST API.

golang api / docker compose / searchkit

Hi guys,

Hope you are all well !

I wanted to ask u 3 quick questions:

  1. Do you have plan or know any golang based api for forestadmin ? if no, where can I find the list of all endpoints to create ? could not find any api doc online :-(

  2. Is there any docker-compose template to boostrap quickly a local demo ? (Laradock could be a good starting point ^^)

  3. How complicated it would be to extend forestadmin/lumber with searchkit to use elasticsearch ?

Cheers,
Richard

Support for virtual fields

I am defining a virtual type in my model definition.

{
  firstName: DataTypes.STRING,
  lastName: DataTypes.STRING,
  fullName: {
      type: DataTypes.VIRTUAL,
      allowNull: false,
      get: function () {
        return this.getDataValue('firstName')+' '+this.getDataValue('lastName');
      },
      set: function (fullName) {
        this.setDataValue('fullName', fullName);
      }
    },
}

The value appears in the API response and the field list where you customize the model. However, it doesn't appear on table view or detail view of the ForestAdmin page. You also can't make it the reference field.

lumber generate fail

Enter your database connection details and then your admin interface will be automatically generated.

? What's the database type? mysql
? What's the database name? adx
? What's the database hostname? localhost
? What's the database port? 3306
? What's the database user? root
? What's the database password? [optional]
? Choose a project name: adx
(node:2007) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'dbName' of undefined

Lumber generate : can't use arrow keys

Hello,

I am unable to use the arrow keys to select switch database type to mysql. Well actually I use them but it doesn't change anything. I'm using Windows and I've tried several consoles (Standard cmd, Babun, etc), none worked.
Is it possible to type in the type instead ?

Thanks

No support for MySQL geometry data type field

I have a MySQL database with table which has the following field:
geolocation: DataTypes.GEOMETRY('POINT')

While looking into that filed with simple MySQL client it has the following value:
POINT(34.7787543 32.0708966)

But Lumber/Forest shows this field as empty value, which makes it useless to update or display geo location widget. 😒

forest_ instant__customizable_admin_interface

TypeError: Router.use() requires middleware function but got a Object

macOS Sierra 10.12.1
node v6.9.1
npm v3.10.8

$ node ./bin/www
/Users/DjangoWong/Workspace/Nuboard/node_modules/express/lib/router/index.js:458
throw new TypeError('Router.use() requires middleware function but got a ' + gettype(fn));
^

TypeError: Router.use() requires middleware function but got a Object
at Function.use (/Users/DjangoWong/Workspace/Nuboard/node_modules/express/lib/router/index.js:458:13)
at EventEmitter. (/Users/DjangoWong/Workspace/Nuboard/node_modules/express/lib/application.js:219:21)
at Array.forEach (native)
at EventEmitter.use (/Users/DjangoWong/Workspace/Nuboard/node_modules/express/lib/application.js:216:7)
at fs.readdirSync.forEach (/Users/DjangoWong/Workspace/Nuboard/app.js:32:7)
at Array.forEach (native)
at Object. (/Users/DjangoWong/Workspace/Nuboard/app.js:31:28)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)

Any plans for mongo?

This looks like a great tool. The docs say "Works with every stack." Do you have any plans for mongo compatibility in the future?

Cannot load http://app.forestadmin.com/ in Chrome

(index):18 Failed to find a valid digest in the 'integrity' attribute for resource 'http://app.forestadmin.com/assets/vendor-ec23afa0468d4ab8cab27a7d84c03371.css' with computed SHA-256 integrity 'f3o9dh3mAUmWIGcfnoosbSQI6SmLKXVLoWUMtr/oNHk='. The resource has been blocked.
(index):1 Failed to find a valid digest in the 'integrity' attribute for resource 'http://app.forestadmin.com/assets/client-dece4faf4c6a4991c9e672c9d15e3169.css' with computed SHA-256 integrity 'AwYDHDelTyFq8aknJZ9H1NcGXYArhUHoSGh1z+4l6hs='. The resource has been blocked.
(index):1 Failed to find a valid digest in the 'integrity' attribute for resource 'http://app.forestadmin.com/assets/client-ec0d1837b912b92dce8508beeed7082b.js' with computed SHA-256 integrity 'S0Yp9rgUN+hmbwGAXRzvWUvRCDBVWlY0I6L0NoqhC9o='. The resource has been blocked.
(index):1 Failed to find a valid digest in the 'integrity' attribute for resource 'http://app.forestadmin.com/babel.js' with computed SHA-256 integrity '/whk9HDJbofYvhlbAxbOWe7LBj43/wz0NKHCA3LpsEk='. The resource has been blocked.

I found a possible solution here ember-cli/ember-cli#5040 (comment)
...but i think it needs to be fixed on your end.

Thanks

Update generated project

Hi,

I have done a lumber generate command at version 1 of my project API. Then i have done enhancements to the API to reach version 2. I'd like to update the version 1 project to version 2 but can't find a way to do it. Unless remove local generated project and do lumber generate again. But i now got 2 projects with same name. Is there at least a way to delete a project unless i can't update a project ?

Thanks

Bug in the website

Footer of your website:

Lumber is a project from Forest. We decided to play with new ways of enabling our users with a tool that’d be completely separated from their main application, essentially creating the admin for them. If you’re in a growing company, refer to our main website to learn more about our full featureset.

Which is your "main website", maybe create an anchor link for it? Just a small fix I presume.

Had to add an issue for this since I couldn't find a contact box

PostgreSQL CITEXT columns not present in generated sequelize models

A lumber generated, postgresql connected admin will not have any CITEXT columns present in the generated sequelize models. The suspect function is the getType() function in the table analyzer. Sequelize does not support CITEXT as a datatype according to their docs and I am unfamiliar with the framework, but it looks like you could just set CITEXT columns as Strings?

I did find confirmation that someone is successfully using CITEXT columns with sequelize.

Not works on my windows 10 machine

cd test && npm install...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at exports._errnoException (util.js:1026:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

versions:

npm : 3.10.8
nodejs : v6.9.1

Running the project entirely offline

Hello,
I was curious if it is at all possible to run the project entirely offline; and by that I mean both logic and UI. I have some clients who could be interested in this service were it not dependent on an all-time stable internet connection.

I have an inkling what the answer will be, just had to ask. You never know.
Thank you.

Database connection using SSH

Is there a way to do so ? Because database is hosted on remote server but can connect only using SSH usr/ssh key.

Cannot generate lumber project to my local database.

As mention above I try to generate lumber microservice to my local mysql database that running under wamp bundle.
I get this error message:
error: Ouch, cannot connect to the database

I also set all my credentails perfectly.

Can't reach application

Next one:

after running application it says:

Login
Oops, cannot reach your application. Are you sure it is running?

SequelizeAccessDeniedError: ER_ACCESS_DENIED_ERROR:

SequelizeAccessDeniedError: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)

Noticed this in autoenv notice:

autoenv:     DATABASE_URL=mysql://root:undefined@localhost:3306/

i wonder if that 'undefined' is causing issues.

TypeError: Cannot read property 'field' of undefined

Installation worked, got a hooray message, but this error happens when I run it.

/Users/path/to/lumber/project/node_modules/sequelize/lib/associations/belongs-to.js:64
  this.targetKeyField = this.target.rawAttributes[this.targetKey].field || this.targetKey;
                                                                 ^
TypeError: Cannot read property 'field' of undefined

Using Postgres on Heroku for DB. Installed with --ssl flag.

No support for MySQL enum and float field type?

Following #51, I found that MySQL enum and floar fields are simply ignored by Forest and not displayed at all.

We have the following field in our DB model which works and displays just fine using Sequelize:

    status: {
      type: DataTypes.ENUM,
      values: ['pending', 'listed'],
      allowNull: false,
      defaultValue: 'pending'
    },
    display_order: {
      type: DataTypes.FLOAT
    }

Running the admin UI locally

Great looking project, however I'm uncomfortable sending my database credentials to a third-party.

The gif in the README shows that at the end of setting up you get a subdomain on forestadmin.com, is there any way to instead run the server / website locally?

Unable to npm install

sudo npm install -g lumber-cli
npm http GET https://registry.npmjs.org/lumber-cli
npm http 304 https://registry.npmjs.org/lumber-cli
npm http GET https://registry.npmjs.org/bluebird
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/inquirer
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/jsonapi-serializer
npm http GET https://registry.npmjs.org/jsonwebtoken
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mysql
npm http GET https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/superagent
npm http GET https://registry.npmjs.org/superagent-promise
npm http GET https://registry.npmjs.org/sequelize
npm http GET https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/bluebird
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/jsonapi-serializer
npm http 304 https://registry.npmjs.org/lodash
npm ERR! Error: No compatible version found: inquirer@'^1.2.2'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.0","0.2.1","0.1.11","0.1.12","0.2.2","0.2.3","0.2.4","0.2.5","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.4.0","0.4.1","0.5.0","0.5.1","0.6.0","0.7.1","0.7.2","0.7.3","0.8.0","0.8.2","0.8.3","0.8.4","0.8.5","0.9.0","0.10.0","0.10.1","0.11.0","0.11.1","0.11.2","0.11.3","0.11.4","0.12.0","1.0.0","1.0.1","1.0.2","1.0.3","1.1.0","1.1.1","1.1.2","1.1.3","1.2.1","1.2.2","1.2.3"]
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:674:10)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:589:10
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:218:7
npm ERR!     at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Darwin 16.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "lumber-cli"
npm ERR! cwd /Users/Eyal/Documents/code/reviewembedder
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm http 304 https://registry.npmjs.org/jsonwebtoken
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/mysql
npm http 304 https://registry.npmjs.org/superagent
npm http 304 https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/superagent-promise
npm http 304 https://registry.npmjs.org/sequelize
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Eyal/Documents/code/reviewembedder/npm-debug.log
npm ERR! not ok code 0

Almost nothing in folder after generating

$ lumber generate
Enter your database connection details and then your admin interface will be automatically generated.

? What's the database type?  postgres
? What's the database name? [REDACTED]
? What's the database hostname? localhost
? What's the database port? 5432
? What's the database user?  [REDACTED]
? What's the database password? [optional]  ********
? Choose a project name:  rx

cd rx && npm install...
npm WARN enoent ENOENT: no such file or directory, open '/Users/daniel.russell/rx/package.json'
npm WARN rx No description
npm WARN rx No repository field.
npm WARN rx No README data
npm WARN rx No license field.

πŸ‘  Hooray, installation success! πŸ‘

Run your admin microservice:
$ cd "rx" && node ./bin/www

No package.json generated, so npm install does nothing. Inside the generated folder are empty etc and node_modules folders.

This is on OS X El Capitan 10.11.1 using Node version 5.6.0.

There is no package.json but installation success!

cd forestadmin && npm install...
npm WARN enoent ENOENT: no such file or directory, open '/var/www/html/laravel/forestadmin/package.json'
npm WARN forestadmin No description
npm WARN forestadmin No repository field.
npm WARN forestadmin No README data
npm WARN forestadmin No license field.

πŸ‘ Hooray, installation success! πŸ‘

Run your admin microservice:
$ cd "forestadmin" && node ./bin/www

Support providing a schema name when generating a project

When generating a project, the user should be able to provide a schema name from which the tables will be read.
This is especially useful for larger projects which heavily rely on schema as namespaces.

Please note that for PostgreSQL, the current version of Sequelize does not support providing a schema name to the showAllTables and describeTable methods of QueryInterface (there is a pull request for this issue).

Project generation fails when schema is empty

The CLI project generation process will fail if the provided schema (currently hard coded to public) of the PostgreSQL database provided is empty.
A reasonable expectation would be to either that it successfully creates a fully fledged project with no models present, or that the CLI reports a meaningful error message to the user.

Because the CLI does not currently support providing a schema name as an argument, databases which do not store their tables inside the public schema cannot be used.

Unable to start Lumber

Getting this error:

➜  ~/workspace/Bumpers-localhost  node bin/www
/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/belongs-to.js:64
  this.targetKeyField = this.target.rawAttributes[this.targetKey].field || this.targetKey;
                                                                 ^

TypeError: Cannot read property 'field' of undefined
    at new BelongsTo (/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/belongs-to.js:64:66)
    at .belongsTo (/Users/imownbey/workspace/Bumpers-localhost/node_modules/sequelize/lib/associations/mixin.js:106:23)
    at sequelize.define.classMethods.associate (/Users/imownbey/workspace/Bumpers-localhost/models/episode_authors.js:10:15)
    at /Users/imownbey/workspace/Bumpers-localhost/models/index.js:34:19
    at Array.forEach (native)
    at Object.<anonymous> (/Users/imownbey/workspace/Bumpers-localhost/models/index.js:32:17)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:4% 

Oops, cannot reach your application. Are you sure it is running?

Hi,
First of all, great job guys :)

Little problem here. I got the following message when I try to login in the admin UI:

Login 
Oops, cannot reach your application. Are you sure it is running?

even though I'm sure it's running on my server. Tested it on Chrome and Safari.

Best,
julien

Wrong error with the generator

Hi !

If you want to create a project with lumber generate whose name already exists it returns you this error : >> πŸ”₯ The project name should only contains alphanumeric, dash and underscore characters. πŸ”₯

When running lumber generate - Unhandled 'error' event

lumber generate
β„ΉοΈŽ Enter your database connection details and then your admin interface will be automatically generated.
β„ΉοΈŽ Your database credentials are safe. They are only stored in the Lumber generated microservice.

? What's the database type? postgres
? What's the database name? root
? What's the database hostname? localhost
? What's the database port? 5432
? What's the database user? root
? What's the database password? [optional] ****
? Choose a project name: proaj

cd proaj && npm install...
events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn npm ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

lumber cli on Windows fails

After installing on Windows 10 x64 and trying to do any of the commands give the following error:

lumber generate
module.js:457
    throw err;
    ^

Error: Cannot find module "C:\Users\users\AppData\Roaming\npm\node_modules\lumber-cli\index-generate"
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

node -v
v6.7.0
npm -v
3.10.7

nothing happens

Nothing happens when I run it, tried with and without sudo.
It just ends without any kind of error message, and nothing is generated in the folder.

The usual success messages that are shown in the video like "Hooray, installation success!" and "Run your admin microservice" are not displayed at all.

Ubuntu 16.
Node 6.5.0

daniel@sputnik:~/bikedafirma/lumber$ sudo lumber generate
Enter your database connection details and then your admin interface will be automatically generated.

? What's the database type?  mysql
? What's the database name? bikedafirma
? What's the database hostname? localhost
? What's the database port? 3306
? What's the database user?  root
? What's the database password? [optional]  
? Choose a project name:  bblumber
daniel@sputnik:~/bikedafirma/lumber$ 

ER_BAD_FIELD_ERROR: Unknown column 'created_at' in 'field list'

Hi Louis,

I successfully setup my admin and most tables worked fine but I had issues loading my tables that contained the fields createdAt and updateAt.

My console outputted the following error:

GET http://localhost:3000/forest/user?fields%5Buser%5D=id%2CisAdmin%2Cemail%2Cp…dated_at&page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=-id&timezone=%2B00%3A00 400 (Bad Request)
vendor-89886a0….js:10 Error: Ember Data Request GET http://localhost:3000/forest/user returned a 400
Payload (application/json; charset=utf-8)
[object Object]
    at i.t (vendor-89886a0….js:10)
    at i (vendor-89886a0….js:25)
    at n.handleResponse (vendor-89886a0….js:25)
    at n.handleResponse (client-d59da52….js:33)
    at n [as handleResponse] (vendor-89886a0….js:11)
    at n.c.error (vendor-89886a0….js:25)
    at u (vendor-89886a0….js:3)
    at Object.fireWith [as rejectWith] (vendor-89886a0….js:3)
    at r (vendor-89886a0….js:4)
    at XMLHttpRequest.<anonymous> (vendor-89886a0….js:5)

With a network response of:

{
  "errors": [{
    "detail": "ER_BAD_FIELD_ERROR: Unknown column 'created_at' in 'field list'"
  }]
}

I also inspected my terminal output and saw:

[forest] 🌳🌳🌳  ER_BAD_FIELD_ERROR: Unknown column 'created_at' in 'field list'

I went into my database and added a new column called created_at (and updated_at, as this caused the same issue) then everything worked fine.

I'm a bit confused as to why the admin is looking for this field.

Let me know your thoughts.

Cheers,
Tahir

Erro: $ node ./bin/www

~ /project-test/ $ node ./bin/www
~ /project-test/node_modules/express/lib/router/index.js:458
throw new TypeError('Router.use() requires middleware function but got a ' + gettype(fn));
^
TypeError: Router.use() requires middleware function but got a Object
at Function.use (~ /project-test/node_modules/express/lib/router/index.js:458:13)
at EventEmitter. (~ /project-test/node_modules/express/lib/application.js:219:21)
at Array.forEach (native)
at EventEmitter.use (~ /project-test/node_modules/express/lib/application.js:216:7)
at fs.readdirSync.forEach (~ /project-test/app.js:32:7)
at Array.forEach (native)
at Object. (~ /project-test/app.js:31:28)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)

Bad relationship

My project build over Laravel 5.1 and the Database Shema. I have a trouble with the field name of relationships.

I have the next code:

Organismos hasMany Programas and Programas belongsTo Organismos

Organismos

module.exports = (sequelize, DataTypes) => {
  let models = sequelize.models;

  var Model = sequelize.define('organismos', {
    title: {
      type: DataTypes.STRING,
    },
    disabled: {
      type: DataTypes.INTEGER,
    },
  }, {
    classMethods: {
      associate: () => {
        // hasMany relationships
        Model.hasMany(models.programas);
      }
    },
    tableName: 'organismos',
    
    timestamps: false,
  });

  return Model;
};

Porgramas

module.exports = (sequelize, DataTypes) => {
  let models = sequelize.models;

  var Model = sequelize.define('programas', {
    organismo_id: {
      type: DataTypes.INTEGER,
    },
    title: {
      type: DataTypes.STRING,
    },
  }, {
    classMethods: {
      associate: () => {
        // hasMany relationships
        Model.hasMany(models.ejes);

        // BelongsTo relationships
        Model.belongsTo(models.organismos, {
          foreignKey: 'organismo_id',
        });
      }
    },
    tableName: 'programas',
    underscored: true,
    timestamps: false,
  });

  return Model;
};

I write the foreign key is organismo_id but the lumber get the next error:
{"errors":[{"detail":"ER_BAD_FIELD_ERROR: Unknown column 'organismoId' in 'field list'"}]}

Can't I change this?

Unable to generate

I was unable to generate or do any other commands, Below is what i get..

`E:\lumberTest>lumber generate
module.js:457
throw err;
^

Error: Cannot find module 'C:\Users\Fred\AppData\Roaming\npm\node_modules\lumber-cli\index-generate'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3`

Deploy to production

I click the Deploy button in http://app.forestadmin.com/ to deploy from Development to Production then access the admin panel via the email you sent me, but error prompt from web
Login Forest cannot retrieve any users for the project you're trying to unlock.
and
[forest] 🌳🌳🌳 Cannot retrieve the project you're trying to unlock. Can you check that you properly copied the Forest secret key in the forest_liana initializer?
from the console.

I've already set env.FOREST_SECRET_KEY.value to the secret_key from Production environment.

Intercom or Stripe integrations

Firstly, I love this - I have an API only app so this was an amazing addition to your suite :)

Does Lumber have all the same features as Forest?
e.g. How do we implement an Intercom integration?

Model creation error and unable to access application

Following successful installation, I get the following error when running the node ./bin/www command:

user@domain:~$ cd "ExpertC" && node ./bin/www
Model creation error: SyntaxError: Unexpected token *
🌳 Open your admin UI: http://app.forestadmin.com 🌳

While the final message appears to indicate success, it the ssh locks and I'm forced to Ctrl+C.

Running curl -I http://localhost:3000/forest also appears to indicate that the server isn't running:

user@domain:~/ExpertC$ curl -I http://localhost:3000/forest
curl: (7) Failed to connect to localhost port 3000: Connection refused

Any help gratefully appreciated. I did run into some memory issues on the original install, but having added a swap file to server, that appears to have been fixed. Is it possible I'm encountering more memory-related issues here?

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.