File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ProcessMaker \Models ;
4+
5+ use Illuminate \Database \Eloquent \Model ;
6+
7+ class SecurityLog extends Model
8+ {
9+ const UPDATED_AT = null ;
10+
11+ protected $ connection = 'data ' ;
12+
13+ /**
14+ * The attributes that aren't mass assignable.
15+ *
16+ * @var array
17+ */
18+ protected $ guarded = [
19+ 'id ' ,
20+ 'created_at ' ,
21+ ];
22+
23+ /**
24+ * Get the associated user, if any.
25+ *
26+ */
27+ public function user ()
28+ {
29+ return $ this ->belongsTo ('ProcessMaker\Models\User ' );
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Database \Migrations \Migration ;
4+ use Illuminate \Database \Schema \Blueprint ;
5+ use Illuminate \Support \Facades \Schema ;
6+
7+ class CreateSecurityLogsTable extends Migration
8+ {
9+ /**
10+ * Run the migrations.
11+ *
12+ * @return void
13+ */
14+ public function up ()
15+ {
16+ Schema::create ('security_logs ' , function (Blueprint $ table ) {
17+ $ table ->bigIncrements ('id ' );
18+ $ table ->string ('type ' , 40 )->index ();
19+ $ table ->string ('ip ' , 40 )->index ()->nullable ();
20+ $ table ->string ('user_agent ' )->nullable ();
21+ $ table ->unsignedInteger ('user_id ' )->nullable ();
22+ $ table ->timestamp ('created_at ' );
23+
24+ $ table ->foreign ('user_id ' )->references ('id ' )->on ('users ' )->onDelete ('cascade ' );
25+ });
26+ }
27+
28+ /**
29+ * Reverse the migrations.
30+ *
31+ * @return void
32+ */
33+ public function down ()
34+ {
35+ Schema::dropIfExists ('security_logs ' );
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments