# Collections and Smart Relationships not showing up after migrating to v8 and new development workflow

**URL:** <https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548>\
**Category:** Help me!\
**Created:** [April 25, 2022, 5:45pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548 "2022-04-25T17:45:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbeiger](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/fbeiger/32/4364_2.png) [@fbeiger](https://community.forestadmin.com/u/fbeiger)\
**Post date:** [April 25, 2022, 5:45pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/1 "2022-04-25T17:45:59Z")

</div>

> ⚠ **This is a template you must use to report issues**. ⚠

I migrated my project from v7 to v8. I added a new Collection and a `hasMany` Smart Relationship from an existing collection to the new one, like follow:

```javascript
collection("ExistingCollection", {
    fields: [{
	field: "hasMany_NewCollection_targetField",
	type: ["String"],
	reference: "NewCollection._id"
  }]
})

```

and the relationship was not showing up in the Layout Editor. Existing smart relationships are displayed, and the endpoint responsible of the new relationship is returning data, which I found confusing.

So I thought it was related to the new development workflow, as it seemed to me it was only a UI issue. Thus I migrated my project, installed the forest-cli, ran an init to setup the development environment. When I started the project, my existing collection was gone, along with few others (I believe they all have a `hasMany` relationship like the one I was trying to add).

Now I’m stuck, fortunately this is only on the Development environment, and does not impact (at least for now) my Production environment.

## Feature(s) impacted

> Please describe in this **mandatory section** the feature(s) that will be discussed in this topic.

- Smart Relationships
- Layout Editor

## Observed behavior

> Please describe in this **mandatory section** the current behavior you observe.

Collections containing `hasMany` Smart Relationships are hidden.

## Expected behavior

> Please describe in this **mandatory section** the behavior you are expecting.

Collections and Smart Relationships must be shown.

## Context

> Please provide in this **mandatory section** , the relevant information about your configuration:

- Project name: Pinpo Admin
- Team name: Operations
- Environment name: DEVELOPMENT
- Agent type & version: “forest-express-mongoose”: “8.6.7”
- Recent changes made on your end if any: Migrated to v8 and project to new development workflow.

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [April 26, 2022, 8:02am UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/2 "2022-04-26T08:02:52Z")

</div>

Hey @fbeiger, and welcome to our community 👋

Could you share (Here or as DM) the real collection name that disappear (So I could check on my end if I’m able to spot the reason)?

Also, I can see that you did not create a branch on your development environment.  
I’m pretty sure that’s not the issue here, but could be worth trying.

Could you also check if that collection & the associated relationship are correctly set in your `.forestadmin-schema.json`? (I can see on my end that you development environment & your production do not share the same schema, which is a good new if you introduced a new field/collection)

Thanks in advance 🙏

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [April 27, 2022, 1:21pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/6 "2022-04-27T13:21:31Z")

</div>

Hi @fbeiger 👋 Can you confirm the issue happen only on smart relationship ?

---

<div class="post-metadata">

**Author:** ![fbeiger](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/fbeiger/32/4364_2.png) [@fbeiger](https://community.forestadmin.com/u/fbeiger)\
**Post date:** [April 27, 2022, 1:34pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/7 "2022-04-27T13:34:04Z")

</div>

Hi @Arnaud_Moncel

As I mentioned, 2 Collections disappeared as well. I suspect it is because they have a similar `hasMany` Smart Relationship, but I don’t really know for sure.

---

<div class="post-metadata">

**Author:** ![fbeiger](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/fbeiger/32/4364_2.png) [@fbeiger](https://community.forestadmin.com/u/fbeiger)\
**Post date:** [April 27, 2022, 2:05pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/8 "2022-04-27T14:05:56Z")

</div>

Something I just figured out, I migrated my project to the new development tools without asking the support, it may have an impact.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/f270412510ac1b39f4c965f706df37ef12f20999.png)

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [April 27, 2022, 3:05pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/9 "2022-04-27T15:05:40Z")

</div>

I see a thing on our end, The Agency model seem to be empty on your rendering.  
But it seem well configured on your `.forestadmin-schema.json`.  
I didn’t see any errors on our side, so it is pretty strange.  
I suggest you to create a new development environment and try again to see if the issue persist or not.

In order to understand what happen, how do you create this environment ?

let me know 🙏

---

<div class="post-metadata">

**Author:** ![fbeiger](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/fbeiger/32/4364_2.png) [@fbeiger](https://community.forestadmin.com/u/fbeiger)\
**Post date:** [April 28, 2022, 3:25am UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/10 "2022-04-28T03:25:55Z")

</div>

Hey @Arnaud_Moncel,

I already deleted and recreated the development environment, and the issue was still persisting.

I just followed the steps given in [Development workflow - Developer guide](https://docs.forestadmin.com/documentation/getting-started/development-workflow) :

- I installed `forest-cli`
- Ran `forest init` and pretty much press ‘Y’ for every question asked
- Ran `yarn start` to start the project

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [April 28, 2022, 10:36am UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/11 "2022-04-28T10:36:17Z")

</div>

Hi @fbeiger after long research, the issue probably come from the definition of two smart action.

One based on `Agency` model with `Exporter les leads` name and on the field `Tags (au moins un des tags sélectionnés)`.

And another based on `AgencyFeature` model with `Exporter les leads` name and on the field `Tags (au moins un des tags sélectionnés)`.

All these fields are `['Enum']` type and the `enums` option does not allow `null` value.  
Can you remove this options and restart your server please? And let me know if it fix your issue? 🙏

---

<div class="post-metadata">

**Author:** ![fbeiger](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/fbeiger/32/4364_2.png) [@fbeiger](https://community.forestadmin.com/u/fbeiger)\
**Post date:** [April 28, 2022, 2:07pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/12 "2022-04-28T14:07:58Z")

</div>

Hey @Arnaud_Moncel, it seems to have done the trick! Thanks a lot.

Indeed the field `Tags (au moins un des tags sélectionnés)` was was based on another object and a variable was missing.

Thanks again for your responsiveness!

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [April 28, 2022, 2:19pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/13 "2022-04-28T14:19:06Z")

</div>

Happy to hear that! Don’t hesitate if you have more questions.

---

<div class="post-metadata">

**Author:** ![fbeiger](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/fbeiger/32/4364_2.png) [@fbeiger](https://community.forestadmin.com/u/fbeiger)\
**Post date:** [May 2, 2022, 2:57pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/15 "2022-05-02T14:57:35Z")

</div>

Hi @Arnaud_Moncel,

I have another issue that may be related. After fixing my schema, I did some changes again then uploaded a new schema using my CI. On the other hand I did some changes in my layout (in the my Development environment, on the “leads” branch) and when I tried to `forest deploy` my changes I had the following message: `× Source and destination environments must have the same schema. Please check your environments code is synchronized.`.

I went to see the Layout on my Production env, and there is a missing Smart Relationship on the `Agency` collection: `hasMany_Lead_originAgency`.

Everything works fine on my Development env though.

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [May 2, 2022, 3:23pm UTC](https://community.forestadmin.com/t/collections-and-smart-relationships-not-showing-up-after-migrating-to-v8-and-new-development-workflow/4548/16 "2022-05-02T15:23:16Z")

</div>

Hi @fbeiger 👋 please open a new thread to talk about your new issue. 🙏
